cancel
Showing results for 
Search instead for 
Did you mean: 

create dashlet in share to display json returned result

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

I have the following url which gives me the desired list of documents in json format.

http://localhost:8080/share/proxy/alfresco/slingshot/doclib/doclist/documents/node/alfresco/company/...

I want to create a dashlet to display this data. I have tried the normal approach mentioned in this https://forums.alfresco.com/en/viewtopic.php?f=48&t=43126 but with no success. I cannot seem to get the right URL and hence getting the error :

Script url /service/ui/doclist does not map to a Web Script.
org.springframework.extensions.webscripts.WebScriptException: 10210001 Script url ******* does not map to a Web Script.


Can somebody please suggest what is the correct url i should try reaching in the following call :
var json = remote.call("_______________");

Thanks in advance!
11 REPLIES 11

ddraper
World-Class Innovator
World-Class Innovator
What url do you have configured in your dashlet's WebScript descriptor file?

Regards,
Dave

n_pancholi87
Champ in-the-making
Champ in-the-making
Hi Dave,

Thanks for your quick response.
The following is the share webscript that works for me.
http://localhost:8080/share/proxy/alfresco/slingshot/doclib/doclist/documents/node/alfresco/company/...

Hence, I tried checking the doclist.get.desc.xml (I am not sure if this is the webscript I am supposed to be looking at) file and following is the URL there :
  <url>/ui/doclist?f={filter?}&amp;p={path?}&amp;q={query?}</url>
  <url>/ui/doclist.atom?f={filter?}&amp;p={path?}&amp;q={query?}</url>

but this does not seem to give the right result which I want to achieve.

share/proxy/alfresco/slingshot/doclib/doclist/ maps to which file in share, i am not sure.

ddraper
World-Class Innovator
World-Class Innovator
The prefix of "/proxy/alfresco" to a URL tells Share to run a WebScript hosted on the Repository tier. If you have created your WebScript on Share then you just need to access it via: "/service" (e.g. /share/service/ui/doclist)

However, your response seems to indicate that you're actually looking at the Alfresco default doclist.get.desc.xml WebScript which doesn't define the URL that you're reporting. I'm assuming that you've created a new WebScript with the URL starting "ui/doclist" ?

Regards,
Dave

n_pancholi87
Champ in-the-making
Champ in-the-making
Hey, that was informative!
i guess this /ui/doclist is confusing.
If i just keep that aside and only look at a default functionality, i have this "share/proxy/alfresco/slingshot/doclib/doclist/documents/node", then which file do i refer to? I cannot find the right desc file for this.

n_pancholi87
Champ in-the-making
Champ in-the-making
Actually what i am trying to do is to create a dashlet, which is going to display a user's "favourite" documents/folders from the alfresco repository. I am using this url, as i mentioned above, it seems to return the right result in json format. Now need to use this json and display it in dashlet, this is where I am stuck.

Regards

ddraper
World-Class Innovator
World-Class Innovator
If you look at "alfresco/service/index" and "share/service/index" you can select to browse by URI and will be able to view all of the information on each WebScript registered. You should be aware that the the WebScripts starting with "slingshot" are for internal Alfresco use - although you can make use of them as are, any issues you have with calling them directly will not be supported - see http://wiki.alfresco.com/wiki/Web_Script_Lifecycle

Regards,
Dave

n_pancholi87
Champ in-the-making
Champ in-the-making
Thank you so much for the details..!!
Can you suggest if there is any other approach to what Im trying to achieve?

ddraper
World-Class Innovator
World-Class Innovator
I'm not sure why you're just not using the out-of-the-box available "My Documents" dashlet - this has a drop down menu which allows you to view "My favourites"

Regards,
Dave

n_pancholi87
Champ in-the-making
Champ in-the-making
Yes Dave,
it does work, but only for site documents/document library, correct me if im wrong please.
I need documents in alfresco repository which are marked as favourite. I can see these when i click on "repository" in alfresco share, and on the left panel click "My favourites".
But simulatneously i need to make these available on the dashboard too.