02-10-2009 11:30 AM
02-11-2009 06:36 AM
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{
System.out.println("Update1");
ContentService cs = serviceRegistry.getContentService();
System.out.println("Update2");
ContentReader cr = cs.getReader(nodeRef, ContentModel.PROP_CONTENT);
System.out.println("Update3");
System.out.println(cr.getContentString()); //debug de leitura
System.out.println("Update4");
//cr = FileContentReader.
//.getSafeContentReader(cr,Application.getMessage(req.getSession(), MSG_ERROR_CONTENT_MISSING), nodeRef, cr);
try
{
InputStream is = cr.getContentInputStream();
}
catch(ContentIOException e)
{
System.out.println("error: " + e.getMessage());
System.out.println("Stack trace: " + e.getStackTrace().toString());
}
}
02-27-2009 11:11 AM
04-30-2009 05:39 AM
05-04-2009 07:35 AM
tempFromFile = TempFileProvider.createTempFile(
"OpenOfficeMetadataExtracter-", ".ott");
reader.getContent(tempFromFile);
String sourceUrl = toUrl(tempFromFile, connection);
XComponentLoader desktop = connection.getDesktop();
PropertyValue[] loadProps = new PropertyValue[2];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "AsTemplate";
loadProps[0].Value = new Boolean(true);
loadProps[1] = new PropertyValue();
loadProps[1].Name = "Hidden";
loadProps[1].Value = new Boolean(true);
// load
return desktop.loadComponentFromURL(sourceUrl, "_blank", 0, loadProps);
System.out.println("Added Template needed Information");
// load template with User fields
XComponent xTemplateComponent = template;
XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier) UnoRuntime
.queryInterface(XTextFieldsSupplier.class, xTemplateComponent);
// access the TextFields and the TextFieldMasters collections
XNameAccess xNamedFieldMasters = xTextFieldsSupplier
.getTextFieldMasters();
XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier
.getTextFields();
// iterate over hashtable and insert values into field masters
// recipient is Hashtable with the data needed by the template
java.util.Enumeration<String> keys = recipient.keys();
while (keys.hasMoreElements()) {
// get column name
String key = (String) keys.nextElement();
System.out.println("Adding " + key);
// access corresponding field master
Object fieldMaster = xNamedFieldMasters
.getByName("com.sun.star.text.FieldMaster.User." + key);
// query the XPropertySet interface, we need to set the Content
// property
XPropertySet xPropertySet = (XPropertySet) UnoRuntime
.queryInterface(XPropertySet.class, fieldMaster);
System.out.println("Before Add");
// insert the column value into field master
xPropertySet.setPropertyValue("Content", recipient.get(key));
// System.out.println("After Add " + recipient.get(key).toString());
}
// afterwards we must refresh the textfields collection
XRefreshable xRefreshable = (XRefreshable) UnoRuntime.queryInterface(
XRefreshable.class, xEnumeratedFields);
xRefreshable.refresh();
05-07-2009 04:32 AM
05-07-2009 07:16 AM
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "MS Word 97";
04-12-2012 06:59 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.