07-14-2010 06:02 AM
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
String text = textoHTML;
ContentFormat contentFormat = new ContentFormat("application/msword", "UTF-8");
contentService.write(content, Constants.PROP_CONTENT, text.getBytes(), contentFormat);
07-15-2010 03:29 AM
07-15-2010 05:50 AM
07-15-2010 06:31 AM
07-15-2010 08:16 AM
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home", Constants.ASSOC_CONTAINS, null);
String id=companyHomeParent.getUuid();
Reference nodeRef = new Reference(storeRef, id, null);
ContentReader reader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
if (reader != null && reader.exists())
{
// get the transformer
ContentTransformer transformer = contentService.getTransformer(reader.getMimetype(), MimetypeMap.MIMETYPE_TEXT_PLAIN);
// is this transformer good enough?
if (transformer == null)
{
// We have a transformer that is fast enough
ContentWriter writer = contentService.getTempWriter();
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
try
{
transformer.transform(reader, writer);
// point the reader to the new-written content
reader = writer.getReader();
// Check that the reader is a view onto something concrete
if (!reader.exists())
{
throw new ContentIOException("The transformation did not write any content, yet: \n"
+ " transformer: " + transformer + "\n" + " temp writer: " + writer);
}
}
catch (ContentIOException e)
{
}
}
}
07-16-2010 02:57 AM
07-16-2010 03:15 AM
07-19-2010 03:09 AM
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
ServiceRegistry serviceRegistry = (ServiceRegistry) context.getBean(ServiceRegistry.SERVICE_REGISTRY);
Pero me da la impresión de que para utilizar estas clases de Spring, necesitaria el entorno, que yo no tengo. Eestoy haciendo un portlet para liferay, java basico y no tengo el alfresco instalado en el mismo sitio que el liferay, por lo que cuando va a buscar el application-context.xml, no lo encuentra logicamente…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.