07-23-2010 07:22 AM
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home", Constants.ASSOC_CONTAINS, null);
companyHomeParent.setChildName("cm:" + name);
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);
NamedValue[] titledProps = new NamedValue[2];
titledProps[0] = Utils.createNamedValue(Constants.PROP_TITLE, titulo);
titledProps[1] = Utils.createNamedValue(Constants.PROP_DESCRIPTION, descripción);
CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_TITLED, titledProps, null, "1");
CML cml = new CML();
cml.setCreate(new CMLCreate[] {create});
cml.setAddAspect(new CMLAddAspect[] {addAspect});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
Reference content = result[0].getDestination();
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
String text = textoHTML;
// hay que darle el formato segun el tipo!!!
ContentFormat contentFormat=null;
if (tipo.equalsIgnoreCase("html")){
contentFormat = new ContentFormat("application/msword", "UTF-8");
}
if (tipo.equalsIgnoreCase("txt")){
contentFormat = new ContentFormat("plain/text", "UTF-8");
}
if (tipo.equalsIgnoreCase("pdf")){
contentFormat = new ContentFormat("application/pdf", "UTF-8");
}
contentService.write(content, Constants.PROP_CONTENT, text.getBytes(), contentFormat);
String luceneQuery ="@cm\\:name:"+name+"" ;
Query query = new Query("lucene", luceneQuery);
Store storeRef = new Store("workspace", "SpacesStore");
Agradeceria cualquier indicación porque llevo varios dias con este embrollo y no doy con la solución…07-23-2010 11:17 AM
07-26-2010 04:20 AM
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.