04-14-2008 12:21 PM
04-15-2008 08:13 AM
04-15-2008 10:38 AM
/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.... Trade/{http://www.alfresco.org/model/content/1.0}Head Quarter Shared Services/{http://www.alfresco.org/model/content/1.0}Finance/{http://www.alfresco.org/model/content/1.0}1 - BUDGET/{http://www.alfresco.org/model/content/1.0}Budget 2007
09:04:45,113 DEBUG [org.alfresco.repo.webservice.Utils] Resolving path: /app:com
pany_home/cm:GL_x0020_TRADE/cm:Head_x0020_Quarter_x0020_Shared_x0020_Services/cm
:Finance/cm:_x0031__x0020_-_x0020_BUDGET/cm:Budget_x0020_2007
09:04:45,124 ERROR [org.alfresco.repo.webservice.accesscontrol.AccessControlWebS
ervice] Unexpected error occurred
java.lang.IllegalStateException: Failed to resolve to a single NodeRef with para
meters (store=workspace:SpacesStore uuid=null path=/app:company_home/cm:GL_x0020
_TRADE/cm:Head_x0020_Quarter_x0020_Shared_x0020_Services/cm:Finance/cm:_x0031__x
0020_-_x0020_BUDGET/cm:Budget_x0020_2007), found 0 nodes.
import org.alfresco.webservice.util.ISO9075;
public String BuildAlfrescoPath(String javaPath)
{
String inter=new String("");
String rootPath="/app:company_home";
String alfPath;
// Il faut transformer javapath avant lui avoir rajoute cm: et app:
// attention on ne touche pas aux slash
// donc on va de / en / pour construire notre nouvelle string:
int pos=0;
int trouve=0,length=javaPath.length();
while(pos<length && (trouve=javaPath.indexOf("/",pos))>=pos){
if(trouve>pos){
inter+="/";
alfPath=javaPath.substring(pos,trouve);
inter+=ISO9075.encode(alfPath);
}
pos=trouve+1;
}
if(trouve==0){
// le cas de bord ou javaPath vaut /
return(rootPath);
}
// ne pas oublier le bout de string apres le dernier /
length=inter.length();
if(trouve<0){
inter+="/";
alfPath=javaPath.substring(pos);
inter+=ISO9075.encode(alfPath);
}
else{// on a trouve un / a la fin?
// Attention, a cause de la ligne qui suit il faut enlever le dernier / si il y en a un
if(inter.substring(length-1).equals("/")==true){
inter=inter.substring(0,inter.length()-2);
}
}
inter= inter.replace("/", MyConstants.MYCM);
alfPath=rootPath+inter;
return alfPath;
}
MyConstants.MYCM="/cm:";
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.