cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing node details page from web script

slothrop
Champ in-the-making
Champ in-the-making
I have a web script that does a lucene search for documents that have certain values for custom metadata fields.  The ftl that displays the results includes a link to the content of the node:


<#list resultset as result>
   <td><a href="${url.serviceContext}/api/node/content/${result.node.nodeRef.storeRef.protocol}/${result.node.nodeRef.storeRef.identifier}/${result.node.nodeRef.id}/${result.name?url}/?guest=true">Link</a></td>
<#list>

I would like to include a link to the node's detail page that would allow users (after logging in) to edit the metadata for the node.  Is this possible?
3 REPLIES 3

slothrop
Champ in-the-making
Champ in-the-making
When I try something like (in I.E.8):

<td><a href="${url.context}/navigate/showDocDetails/webdav/${result.node.nodeRef.storeRef.protocol}/${result.node.nodeRef.storeRef.identifier}/${result.node.nodeRef.id}">Details Link</a></td>

I get a popup that says:

The webpage you are viewing is trying to close the tab.  Do you want to close this tab?

A blank page appears when I click No.  Mozilla Firefox doesn't give me the popup.  It just gives me the blank page.

mabayona
Champ on-the-rise
Champ on-the-rise

slothrop
Champ in-the-making
Champ in-the-making
Thank you, mabayona.

I have been looking at the URL Addressability page.  What I found was:

<td><a href="${url.context}/navigate/showDocDetails/webdav${result.node.displayPath}">Details Link</a></td>

Which generates urls like:

http://localhost:8080/alfresco/showDocDetails/webdav/company_home/JCE/Journal/Issues/1977/Nov

Leads to the browser trying to close the tab.

The following:

<td><a href="${url.context}/navigate/browse/${result.node.nodeRef.storeRef.protocol}/${result.node.nodeRef.storeRef.identifier}/${result.node.nodeRef.id}">Details Link</a></td>
Which generates urls like:

http://localhost:8080/alfresco/navigate/browse/workspace/SpacesStore/2c0aa7d7-a49d-4c90-86ad-9679f2d...

Takes me to the node.  I can open the details page but since I have only guest access, I can't edit the metadata.

I was hoping that I would be redirected to the login page before the details page so I could edit the metadata.  I think that showDocDetails is supposed to do this but every permutation I have tried on that hasn't worked.