cancel
Showing results for 
Search instead for 
Did you mean: 

Invoking a java class in share

rabidpilot
Champ in-the-making
Champ in-the-making
Hi all,

I know this can be done on alfresco by putting the jar in the alfresco.war/WEB-INF/lib folder and then
adding the bean to the alfresco.war/WEB-INF/classes/alfresco/script-services-context.xml

I tried to do the same thing with share but I can't find the script-services-context.xml file.

Thanks,
6 REPLIES 6

mitpatoliya
Star Collaborator
Star Collaborator
If you are doing anything with the share you have to search the things inside the Webapp/share only.
Which article you are referring for this? and what exactly you want to achieve?

rabidpilot
Champ in-the-making
Champ in-the-making
here is a link to the article that talks about it.

http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-w...


We have a internal web site where Time is entered based on Projects. We were hoping to have a share site dashlet that could access the a web service and be able to enter the time with out the need of accessing the site directly.  The way the web service was setup it accepts requests via http or soap.

The article that I linked to above shows how to get information and I can get that part to work with out any issues on the Alfresco side but haven't had any luck on sending data to the web service and have no clue on how I could even begin to try it on the share side.


Hope that helps.  I would post the code but it belongs to my employers and they don't want it made public.

Thanks for help as new to alfresco/share environment.

mitpatoliya
Star Collaborator
Star Collaborator
this is how you can call your java class.

do the following entry in your script-services-context.xml

<bean id="activitiesScript" parent="baseJavaScriptExtension" class="yourjavaclass">
        <property name="extensionName">
            <value>customobj</value>
        </property>              
    </bean>

Now can create your java class and have some your apis ex.test().
then in java script you can call you api in the alfresco java script by mentioning like customobj.test();
once you get the control in java you can call any web service or whatever you like.

rabidpilot
Champ in-the-making
Champ in-the-making
Thanks for the reply,

I was able to make the code work on our Alfresco server but I would like to do the same
thing on the Share side but I don't think share has a file script-services-context.xml

mitpatoliya
Star Collaborator
Star Collaborator
then you gotta problem as share totally surf based.
which is totally js webscript based.
It will be treaky to inject some java class in between or to call other webservice.
please share it across if you find anything.

rabidpilot
Champ in-the-making
Champ in-the-making
Thank you for your help on this.  If I figure anyting out I will update the post.

Well I've spend too much R&D time on this and was re tasked  to our backup plan. so I just customized the Web view Dashlet to display the website of the internal site.

who knows maybe will revisit this when  there more time  :wink: