As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
props = new Array(1); props["app:editInline"] = true; document.addAspect("app:inlineeditable", props);
NamedValue[] editInlineProps = new NamedValue[1]; editInlineProps[0] = Utils.createNamedValue(Constants.PROP_EDITINLINE, "true"); CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_INLINEEDIT, editInlineProps, null, "1");
… <aspect name="app:inlineeditable"> <title>Inline Editable</title> <properties> <property name="app:editInline"> <title>Edit Inline</title> <type>d:boolean</type> </property> </properties> </aspect> …
// Creamos la referencia del nodo padre, donde se añadira el contenido // En este caso el nodo padre es company_home Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home", Constants.ASSOC_CONTAINS, null); // Asignamos un nombre para el nodo que vamos a crea en company_home String name = nombre; [b] companyHomeParent.setChildName("cm:" + name); [/b] // Comienza la construcción de nodo NamedValue[] contentProps = new NamedValue[1]; contentProps[0] = Utils.createNamedValue(Constants.PROP_NAME, name); CMLCreate create = new CMLCreate("1", companyHomeParent, null, null, null, Constants.TYPE_CONTENT, contentProps); // Añadimos aspectos al nodo NamedValue[] titledProps = new NamedValue[2]; titledProps[0] = Utils.createNamedValue(Constants.PROP_TITLE, titulo); titledProps[1] = Utils.createNamedValue(Constants.PROP_DESCRIPTION, descripcion); CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_TITLED, titledProps, null, "1"); //añado aspecto editar online NamedValue[] inline=new NamedValue[1]; inline[0]=Utils.createNamedValue(createQNameString("http://www.alfresco.org/model/content/1.0", "editInline"), "true"); CMLAddAspect addAspectInline=new CMLAddAspect(createQNameString("http://www.alfresco.org/model/content/1.0", "inlineeditable"), inline, null, "1"); // Contruimos CML Block, con el nodo y sus aspectos CML cml = new CML(); cml.setCreate(new CMLCreate[] {create}); cml.setAddAspect(new CMLAddAspect[] {addAspect}); cml.setAddAspect(new CMLAddAspect[] {addAspectInline}); // Creamos y recuperamos el contenido vía Repository Web Service UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml); Reference content = result[0].getDestination(); // // Escribimos el contenido // ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService(); ContentFormat contentFormat = new ContentFormat(tipo, "UTF-8"); contentService.write(content, Constants.PROP_CONTENT,archivo , contentFormat);
//añado aspecto editar online NamedValue[] inline=new NamedValue[1]; inline[0]=Utils.createNamedValue(createQNameString("http://www.alfresco.org/model/application/1.0", "editInline"), "true"); CMLAddAspect addAspectInline=new CMLAddAspect(createQNameString("http://www.alfresco.org/model/application/1.0", "inlineeditable"), inline, null, "1");