public static void crearEspacio() {
try {
ParentReference parentReference = new ParentReference(
STORE,
null,
"/app:company_home/",
Constants.ASSOC_CONTAINS,
Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "sample_folder"));
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, "AAA")};
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_FOLDER, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);
System.out.println("ESPACIO CREADO!!");
}
catch (Exception exception)
{
System.out.println("EXCEPTION "+exception.getMessage());
}
}
ParentReference parentReference = new ParentReference(
STORE,
null,
"/app:company_home/AAA",
Constants.ASSOC_CONTAINS,
Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "sample_folder"));
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, "BBB")};
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>org.alfresco.service.cmr.repository.XPathException: Error executing xpath:
xpath: /app:company_home/</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:341)
Reference padre = results[0].getDestination();
private static ParentReference damePadreRef(Store almacen,Reference carpetaRef){
return new ParentReference(almacen,carpetaRef.getUuid(),carpetaRef.getPath(),Constants.ASSOC_CONTAINS,null);
}
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>org.alfresco.service.namespace.InvalidQNameException: Argument qname is mandatory</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
private static ParentReference damePadreRef(Store almacen,Reference carpetaRef){
return new ParentReference(almacen,carpetaRef.getUuid(),carpetaRef.getPath(),Constants.ASSOC_CONTAINS,
Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "espacio_hijo"));
}
¿a ti te funciona sin definir la QName?
Reference refer = new Reference(STORE, null, "/app:company_home/*[@cm:name=\"" + "AAA" + "\"]" + "/*[@cm:name=\"" + "BBB" + "\"]" );
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.