07-02-2010 04:19 AM
07-02-2010 07:34 AM
07-06-2010 04:41 AM
07-06-2010 12:16 PM
07-07-2010 03:01 AM
07-07-2010 04:20 AM
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");
07-07-2010 04:59 AM
07-07-2010 06:00 AM
…
<aspect name="app:inlineeditable">
<title>Inline Editable</title>
<properties>
<property name="app:editInline">
<title>Edit Inline</title>
<type>d:boolean</type>
</property>
</properties>
</aspect>
…
07-07-2010 06:21 AM
// 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);
07-07-2010 08:20 AM
//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");
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.