cancel
Showing results for 
Search instead for 
Did you mean: 

metadata from a word document

col_edinburgh
Champ in-the-making
Champ in-the-making
I have created a custom content type with properties for 'project id' and 'project manager'. Problem is these are field on a form created in ms word. Is it possible to extract this data from the content of the form? Any pointers to show how would be much appreciated.
1 REPLY 1

cheffilet
Champ in-the-making
Champ in-the-making
I dont know exactly if it is possible but you should have a look on following i´ve prepared for you:



Map<QName, Serializable> extractorProps = new HashMap<QName, Serializable>();
//get extracter through Springlookup ref="metadataExtracterRegistry"
ContentReader cr = contentService.getReader(theNodeRef, ContentModel.PROP_CONTENT);
                  extracter.extract(cr, extractorProps);
//read out the author and so on
if(extractorProps.get(ContentModel.PROP_AUTHOR) != null)
   theProperties.put(ContentModel.PROP_AUTHOR, extractorProps.get(ContentModel.PROP_AUTHOR));
                 
if(extractorProps.get(ContentModel.PROP_TITLE) != null)
   theProperties.put(ContentModel.PROP_TITLE, extractorProps.get(ContentModel.PROP_TITLE));
                 
if(extractorProps.get(ContentModel.PROP_DESCRIPTION) != null)
   theProperties.put(ContentModel.PROP_DESCRIPTION, extractorProps.get(ContentModel.PROP_DESCRIPTION));