cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Webscript

rutaveejshah
Champ in-the-making
Champ in-the-making
Hello Everyone!

I have craete a webscript in alfresco. I have call that webscript from share yui user interface. Now for calling that webscript i have used the whole path like  http://localhost:8080/alfresco/service/{web script url} NOw is there any service url avilable which will replace http://localhost:8080/alfresco/service .
For example for calling the share webscript the Url is Alfresco.constants.PROXY_URI = http://localhost:8080/share/proxy/alfresco/.

Please any one has any idea reply me.

Thanks
2 REPLIES 2

niketapatel
Star Contributor
Star Contributor
Hi rutaveejshah,

The variable you are referring - Alfresco.constants.PROXY_URI is for calling Alfresco webscripts only from Share client side js.

Example :

http://localhost:8080/alfresco/service/api/people/admin/preferences [Alfresco script]
Alfresco.constants.PROXY_URI +  "api/people/admin/preferences" which will  be http://localhost:8080/share/proxy/alfresco/api/people/admin/preferences [From Share client side js]

Need to use proxy for ajax call as a work around solution for cross site scripting .

If you are calling alfresco script from share script js controller then no  need to use prpxy, you can use remote object.

tytanix
Champ in-the-making
Champ in-the-making
Hello, is there any way to disable the call to /proxy/alfresco/api?
By now, i'm trying to automatically access to edit-metadata page after uploading a file via the html-uploader. I've added this little piece of code

<blockcode>

//Show edit-metadata form after upload (by Tiziano)
var nodeRefURL="edit-metadata?nodeRef=" + response.nodeRef;
Alfresco.util.navigateTo(nodeRefURL);

</blockcode>

at the end of _onUploadSucces method in html-upload.js.
The script works correctly but, when parsing the url to the browser, /proxy/alfresco/api is added between share/ and /page and this results in 404 error-page not found.
If i delete /proxy/alfresco/api from the url, the edit-metadata page is displayed correctly.

For example
correct URL
<blockcode>
http://debianalfrescotest:8080/share/page/edit-metadata?nodeRef=workspace://SpacesStore/407f179a-8d7...
</blockcode>

parsed URL (results in 404 error)
<blockcode>
http://debianalfrescotest:8080/share/proxy/alfresco/api/page/edit-metadata?nodeRef=workspace://Space...
</blockcode>

So, how can I disable the call to /proxy/alfresco/api?