0

Context:

I have a webpage with an applet in the Share side. The webpage can be seen through the link

localhost:8080/share/page/hdp/ws/my-page?file=nodeRefOfFile

Problem:

I define a custom workflow. I want integrate this applet in the workflow for the user accept the task.

I define a Java class in repository side that is called in workflow.

How can I call the webpage (Share side) in JAVA class that I use in the workflow. In JAVA class I have a nodeRef of the file of the workflow, but I don't know too how can I refresh file on javascript and gives the nodeRef to JAVA. My problem is communicate JAVA (repository) with javascript (share).

I have to make a webscript repository with the page? Any suggestion?

PRVS
  • 1,612
  • 4
  • 38
  • 75

1 Answers1

2

Answer changed: the OP is trying to integrate an applet with the Share workflow. I'd highly recommend loading the applet inside of a new custom component and calling the applet from the task's workflow validation.

The component itself can calculate the url of the file you want to sign, or you can read the form data and get the url of the file with Ajax. Finally, the applet will need to write the signed file into a hidden field (via base64). Before posting the workflow form, you can use ajax to send the file to the repository. Use the share proxy url to avoid needing to authenticate with the repository.

matthew p.
  • 405
  • 2
  • 9
  • But my question it's the opposite. I have a webpage webscript on Share with `user`. In this webpage I have an applet. I have a Java class on the repository and I can access the file (I have the NodeRef), and call the webpage (my page is not under /alfresco/service but share/page/hdp/ws/mypage. Then I want to pass the NodeRef for the applet (javascript)... Then, I run applet and after this I want to receive in the Java the new NodeRef (updated with modifications). But the situation of call webpage, its under share/page/hdp/ws/mypage . – PRVS Nov 25 '15 at 16:43
  • I'm having a difficult time understanding your question and comments. If you could rephrase your question (maybe have a coworker with strong English help you out), it would be easier to understand your issue and get you a good reply. – matthew p. Nov 25 '15 at 16:55
  • I have my workflow tasks on repository side (only the form is on the share side). But I want to call a webpage (where is on the share side) /share/page/hdp/ws/newpage, on the accept button of the user task with a Java repository class. But the webpage is on share side so, I get an error 401 unauthorized when I want to open the Page. This is the first Problem. The second is comunicate Java repository class (where i want to call the webpage) with the Applet (javascript share side) that I have on webpage. – PRVS Nov 25 '15 at 17:55
  • If you dont understand please say me and i try to explain better. Please. – PRVS Nov 25 '15 at 20:20
  • Can you help me please? – PRVS Nov 26 '15 at 21:06
  • I can try, but I'm still having a hard time understanding your problem. I would suggest for you to edit your original question and first list out all of your components, say exactly what they are, where they are, and what they do. Use formatting! Then try and very clearly explain what you are trying to accomplish and how you are trying to do so. I would suggest looking at other complex posts make here and trying to copy that. If it doesn't take you 20-30 minutes to write you are doing it wrong. – matthew p. Nov 27 '15 at 08:44
  • I edit my original question. I think now it's explicit. – PRVS Nov 27 '15 at 22:12
  • Your question still isn't proper English: "How can I call the webpage (Share) on JAVA class that I use on the workflow?" The prepositions in this paragraph are wrong, so I can't really tell what you are trying to do. For example, you use "on" about 6 times, but you should probably say "in" or "from", and that will make a big difference in what you mean. – matthew p. Nov 30 '15 at 08:31
  • I improved my english again. But i can resume one of my problems in one line: call a share page localhost:8080/share/page/hdp/ws/my-page in a JAVA class in the repository side without make an authentication with a explicit user / password in JAVA. Your answer is the opposed to what I want. I only want this in this time! – PRVS Nov 30 '15 at 09:53
  • 1
    It's still very unclear and grammatically incorrect. I really think you need to get it proofread by someone with better English, preferably someone with a technical background. – matthew p. Nov 30 '15 at 10:19
  • 1
    Yes, the English has multiple mistakes which make your meaning unclear. What you want to do is obviously clear for you, but you need to understand it will not be clear to others, especially if it is an unusual request. – matthew p. Nov 30 '15 at 11:47
  • But what you don't undestand? Everything is impossivel. We are trying to get to a conclusion in five days... – PRVS Nov 30 '15 at 11:50
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/96546/discussion-between-matthew-p-and-prvs). – matthew p. Nov 30 '15 at 11:51
  • if you can go to chat later, I have a question. Thank you. – PRVS Nov 30 '15 at 14:58
  • Can we task again about this? I need help. In the part of `loading the applet inside of a new custom component ` this is with a form share? And `calling the applet from the task's workflow validation.` where is this ? Or where I can read about this? – PRVS Jan 28 '16 at 10:52