calling upload webscript using ajax and json callback
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2015 09:28 AM
Hi All,
I am new to Alfresco.
My requirement is that I need to upload file (from my webclient IE9 HTML4) to Alfresco and get an id back with which it can be accessed later.
I think the above can be achieved by using Upload webscript (POST for data to http://localhost:8080/alfresco/service/api/upload).
This webscript returns Json back. I need to parse this Json and fetch noderef.
I need to do this using AJAX (jquery or XMLHTTPRequest).
I found that webscripts that return Json can use alf_callback to handle the reply.
I created very rudimentary html page to test this out.
In a post I saw that in order to get the alf_callback to work, we need to enable it using custom-web-context.xml.
I am not able to get the custom-web-context.xml configured properly
I tried the following:
<beans>
<bean id="webscripts.container" class="org.alfresco.repo.web.scripts.TenantRepositoryContainer" parent="baseAlfrescoRepositoryContainer" init-method="setup">
<property name="name"><value>Repository</value></property>
<property name="allowCallbacks"><value>true</value></property>
</bean>
</beans>
and the following:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="webscripts.container" parent="webscripts.abstractcontainer" class="org.springframework.extensions.webscripts.PresentationContainer">
<property name="name"><value>Repository</value></property>
<property name="allowCallbacks"><value>true</value></property>
</bean>
</beans>
But both did not work.
I am not able to get the custom-web-context.xml configured properly.
Could you please help?
Thanks
Harshit
I am new to Alfresco.
My requirement is that I need to upload file (from my webclient IE9 HTML4) to Alfresco and get an id back with which it can be accessed later.
I think the above can be achieved by using Upload webscript (POST for data to http://localhost:8080/alfresco/service/api/upload).
This webscript returns Json back. I need to parse this Json and fetch noderef.
I need to do this using AJAX (jquery or XMLHTTPRequest).
I found that webscripts that return Json can use alf_callback to handle the reply.
I created very rudimentary html page to test this out.
In a post I saw that in order to get the alf_callback to work, we need to enable it using custom-web-context.xml.
I am not able to get the custom-web-context.xml configured properly
I tried the following:
<beans>
<bean id="webscripts.container" class="org.alfresco.repo.web.scripts.TenantRepositoryContainer" parent="baseAlfrescoRepositoryContainer" init-method="setup">
<property name="name"><value>Repository</value></property>
<property name="allowCallbacks"><value>true</value></property>
</bean>
</beans>
and the following:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="webscripts.container" parent="webscripts.abstractcontainer" class="org.springframework.extensions.webscripts.PresentationContainer">
<property name="name"><value>Repository</value></property>
<property name="allowCallbacks"><value>true</value></property>
</bean>
</beans>
But both did not work.
I am not able to get the custom-web-context.xml configured properly.
Could you please help?
Thanks
Harshit
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2015 05:55 AM
Hello There,
I need to integrate the "webscript" methods with my applcation and i can do that only by using Alfresco's exposed "REST/SOAP" API's. I see many topics on the Alfresco site but did't find a good documentation.
Kindly provide me a link/documentation from where i can easily use the methods exposed REST/SOAP API's and use it in my application.
Thanks,
Sumit Kumar
I need to integrate the "webscript" methods with my applcation and i can do that only by using Alfresco's exposed "REST/SOAP" API's. I see many topics on the Alfresco site but did't find a good documentation.
Kindly provide me a link/documentation from where i can easily use the methods exposed REST/SOAP API's and use it in my application.
Thanks,
Sumit Kumar
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2015 07:01 AM
To integrate with third part application, you can CMIS instead of using webscript.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2015 12:13 AM
I also need to know how to start deploying using webscript. please complete the topic if you find a solution for that.
