cancel
Showing results for 
Search instead for 
Did you mean: 

Favorites webscript not working

kingkong
Champ in-the-making
Champ in-the-making
Hey everybody,

when programming against Alfresco I encountered a problem with the favorites function.

I'm using the following webscript:
http://localhost:8080/alfresco/service/slingshot/doclib/doclist/all/node/alfresco/company/home?filte...

Locally, it return all folders and documents that I marked as favorites. I'm using this information to display the favorites in another page.

Unfortunately, the web script is not working on a server. There are no errors or exceptions, but the script simply returns that there are no favorites (emtpy result set). Also the alfresco.log does not show any errors.
I also found out, that the MyFavorites dashlet of the native Alfresco version is not working for the server as it also does not show any favorited documents.
Locally, this again is working perfectly fine (http://localhost:8081/share/page/context/mine/myfiles#filter=favourites&page=1).

Thanks a lot in advance.

Kind regards

KingKong

1 REPLY 1

gawadesk
Star Contributor
Star Contributor
Not sure why something working on locally is not working on server.

What I can see is to get list of favorite documents you are using doclist webscript with parameter. This is the way to get favorite document but not the ideal way. To get list of favorite documents Alfresco providing <a href="http://docs.alfresco.com/5.0/pra/1/concepts/pra-favorites-get-favorites.html">REST API </a>. By using it you can get list of favorite document for particular user.  


  http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/people/gawadesk/favorites



This will provide list of favorite document for user mentioned in URL in JSON format. You can always parse that JSON and display in your page.

Please let me know if this solve your problem.