cancel
Showing results for 
Search instead for 
Did you mean: 

searching the content by blog search web Script

roy1
Champ in-the-making
Champ in-the-making
Hello
I am using blog search(http://localhost:8080/alfresco/service/sample/blog/search?q=tutorial&guest=true) web script,
this web script show the contents but when i try to click on content it ask for user name and password authentication but
i want to access the content without user name and password. so please suggest me what should i do……
i am waiting for your response………
1 REPLY 1

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi

The same thing that I mentioned earlier applies here. The link to the content is actually another webscript.

Try using this link

http://localhost:8080/alfresco/service/api/node/content/workspace/SpacesStore/1e0fcb69-0c95-4294-956...

If you look at the source code of blogsearch.get.html.ftl ( pasted below ) you will get the idea.


<html>
  <body>
    <img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" />
    Blog query: ${args.q}
    <br>
    <table>
<#list resultset as node>
     <tr>
       <td><img src="${url.context}${node.icon16}"/>
       <td><a href="${url.serviceContext}/api/node/content/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/${node.name?url}">${node.name}</a>
     </tr>
</#list>
    </table>
  </body>
</html>

you could also use direct download links like

http://localhost:8080/alfresco/d/d/workspace/SpacesStore/1e0fcb69-0c95-4294-9566-9543cae0de25/Alfres...

This will look like below in your ftl. Link produced by the below code should not require any authentication.


<td><a href="${url.serviceContext}/d/d/{node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}

Please refer the the Webscript wiki ( http://wiki.alfresco.com/wiki/Web_Scripts)  and the source code to understand better.



Best Regards,
Shagul