cancel
Showing results for 
Search instead for 
Did you mean: 

remove username,password from search webscript in alfresco??

mgovind
Champ in-the-making
Champ in-the-making
hi
is it possible to remove user name and password from search webscript in alfresco if yes then please help me…….
2 REPLIES 2

zaizi
Champ in-the-making
Champ in-the-making
Can you provide more details of which web script you are referring to and how that web script is being used / called?

mgovind
Champ in-the-making
Champ in-the-making
hi im using folder.get.desc.xml for display the contents of folder but i want that it display the contents without any username and password…………

code is…
folder.get.desc.xml

<webscript>
<shortname>Folder Listing Sample</shortname>

<description>
Sample demonstrating the listing of folder contents
</description>
<url>/sample/folder/{path}</url>
<format default="html">argument</format>
<authentication>guest</authentication>
<transaction>required</transaction>
</webscript>

folder.get.html.ftl

<html>
  <head>
    <title>${folder.displayPath}/${folder.name}</title>
  </head>
  <body>
   
   
    <table>
<#assign i=0>
<#assign n=0>
<#if folder?exists>

<#if folder1?exists>

<#list folder1.children as child>


    
       <#if child.isDocument>
   <#if i=0>
   <b>Books and Publications</b>
   <br>
   <#assign i=1>
   </#if>
   <#assign n=1>
    <tr>
         <td><td><a href="${url.serviceContext}/api/node/content/${child.nodeRef.storeRef.protocol}/${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}">${child.name}</a>
   </tr>
      </#if>
    
</#list>
</#if>
    </table>
    <table>
<#assign i=0>
<#if folder2?exists>
<#list folder2.children as child>

    
       <#if child.isDocument>
<#if i=0>
<br>
<br>
<b>Promotional Contents</b>
<br>
<#assign i=1>
</#if>
         <tr>
       <#assign n=2>
         <td><td><a href="${url.serviceContext}/api/node/content/${child.nodeRef.storeRef.protocol}/${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}">${child.name}</a>
      </tr>
       </#if>
    
</#list>
</#if>
   </table>
    <table>
<#assign i=0>
<#if folder3?exists>
<#list folder3.children as child>

    
       <#if child.isDocument>
<#if i=0>
<br>
<br>
<b>Voice Blogs</b>
<br>
<#assign i=1>
</#if>
   <#assign n=3>
       <tr> 
         <td><td><a href="${url.serviceContext}/api/node/content/${child.nodeRef.storeRef.protocol}/${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}">${child.name}</a>
   </tr>
       </#if>
    
</#list>
</#if>
   </table>
    <table>
<#assign i=0>
<#if folder4?exists>
<#list folder4.children as child>

    
       <#if child.isDocument>
<#if i=0>
<br>
<br>
<b>Mined and Associated Contents</b>
<br>

<#assign i=1>
</#if>
   <#assign n=4>
   <tr>        
         <td><td><a href="${url.serviceContext}/api/node/content/${child.nodeRef.storeRef.protocol}/${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}">${child.name}</a>
   </tr>
       </#if>
    
</#list>
</#if>
</#if>
<#if n=0>
<B>No Data Found</B>
</#if>
    </table>
  </body>
</html>

<#macro encodepath node><#if node.parent?exists><@encodepath node=node.parent/>/${node.name?url}</#if></#macro>


folder.get.js

// locate folder by path
// NOTE: only supports path beneath company home, not from root
var p=url.extension;
var folder = roothome.childByNamePath(p);
var folder1=folder;
var folder2=folder;
var folder3=folder;
var folder4=folder;
p=p+"/Books and Publications";


try{
folder1 = roothome.childByNamePath(p);
}
catch(err){
folder1=folder
}
p=url.extension;

p=p+"/Promotional Contents";
try{
folder2 = roothome.childByNamePath(p);
}
catch(err){
folder2=folder
}
p=url.extension;

p=p+"/Voice Blogs";
try{
folder3 = roothome.childByNamePath(p);
}
catch(err){
folder3=folder
}
p=url.extension;

p=p+"/Mined and Associated Contents";
try{
folder4= roothome.childByNamePath(p);
}
catch(err){
folder4=folder
}
if (folder == undefined || !folder.isContainer)
{
folder = companyhome.childByNamePath("/data");

}
model.folder=folder;
model.folder1 = folder1;
model.folder2 = folder2;
model.folder3 = folder3;
model.folder4 = folder4;