cancel
Showing results for 
Search instead for 
Did you mean: 

Metadata Extracter

stebans
Champ in-the-making
Champ in-the-making
Hi all,

I'm currently writing a MetadataExtracter from Word Documents. I want to extract other properties than the default ones (author, title, description) from the properties (like keywords) and from the parsing of the document.  I wrote a Java class which extends the org.alfresco.repo.content.metadata.OfficeMetadataExtracter I could find in Alfresco SDK.

But how can I save the extracted metadata from the Java class?  There exists the ContentModel with a few metadata (ContentModel.PROP_AUTHOR, etc.), but how could I write say document keywords.  Where should I define the PROP_KEYWORD metadata?  Could the property be simply defined in a new ContentModel.xml?

Sorry if the answer is obvious, maybe it's simple Java, but I'm lost!

Thanks,
Best regards,
Stéphane
8 REPLIES 8

stebans
Champ in-the-making
Champ in-the-making
Hi,

first of all, I hadn't seen there was another post about the same subject and with almost the same title (http://forums.alfresco.com/viewtopic.php?t=5687), but anyway I found the information which is in this thread on myself.

Anyway, I still cannot make the Extracter extract the metadata!  Here's what I did, and, hopefully someone will be able to help me finish all this up…

1. "my custom model" xml file

<model name="my:model" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <namespaces>
      <namespace uri="http://***/model/dictionary/1.0" prefix="my" />
   </namespaces>

   <types>
      <type name="my:model">
         <title>My Model for Documents Metadata</title>
         <parent>cm:content</parent>
         <properties>   
            <property name="my:keywords">
               <title>Keywords for my document</title>
               <description>Keywords for my document</description>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </type>
   </types>
</model>


2. web client configuration

   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:model"/>
      </content-types>
   </config>
   <config evaluator="node-type" condition="my:model">
      <property-sheet>
         <show-property name="my:keywords" />
      </property-sheet>
   </config>

3. Java class which I'm really not sure about.

package my.pckg;

import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Map;

import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.metadata.OfficeMetadataExtracter;
import org.alfresco.service.cmr.repository.ContentIOException;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.namespace.QName;
import org.apache.poi.hpsf.PropertySet;
import org.apache.poi.hpsf.PropertySetFactory;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.poifs.eventfilesystem.POIFSReader;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;


public class MyOfficeMetadataExtracter extends OfficeMetadataExtracter {

   static final QName PROP_KEYWORDS = QName.createQName("http://***/model/dictionary/1.0", "keywords");
   
   public MyOfficeMetadataExtracter() {
      new OfficeMetadataExtracter();
   }

   public void extractInternal(ContentReader reader,
         final Map<QName, Serializable> destination) throws Throwable {
         
      POIFSReaderListener readerListener = new POIFSReaderListener() {

         public void processPOIFSReaderEvent(final POIFSReaderEvent event) {
            try {
               PropertySet ps = PropertySetFactory.create(event.getStream());
               if (ps instanceof SummaryInformation){
                  SummaryInformation si = (SummaryInformation) ps;
                  
                  //trimPut(ContentModel.PROP_AUTHOR, si.getAuthor(), destination);
                  trimPut(PROP_KEYWORDS, si.getKeywords(), destination);                                      
                  
               }

            } catch (Exception ex) {
               throw new ContentIOException("Property set stream: "
                     + event.getPath() + event.getName(), ex);
            }
         }
      };
      
      InputStream is = null;
      try {
         is = reader.getContentInputStream();
         POIFSReader poiFSReader = new POIFSReader();
         poiFSReader.registerListener(readerListener, SummaryInformation.DEFAULT_STREAM_NAME);
         poiFSReader.read(is);
      } catch (Exception e) {
         //…
      } finally {
         if (is != null){
            try {
               is.close();
            } catch (IOException e) {
               //…
            }
         }
      
      }
   }
}

4. Bean registration in "content-services-context-xml"

   <bean class="my.pckg.MyOfficeMetadataExtracter" parent="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" />

I don't know if the class is supposed to work at all. Is QName PROP_KEYWORDS = QName.create(namespace, property_name) the right way to go? I'm lost!

Even if it worked out, I don't understand the way to make the mapping between Word documents of my custom content type and the extracter. Where should I configure the mapping?

Hope I'm not too far from the solution and my question is clear enough for a tip…

Thanks
Best Regards
Stéphane

stebans
Champ in-the-making
Champ in-the-making
Hi,

I've been spending a lot of time for extracting and viewing custom metadata from Word documents. But I'm not there yet 😞

I replaced OfficeMetadataExtracter with my own class and it worked out. I was able to modify metadata such as author using a QName
static final QName MYPROP_AUTHOR = QName.createQName("http://www.alfresco.org/model/content/1.0", "author");
[…]
trimPut(MYPROP_AUTHOR, "whatever author", destination);
which is correctly reflected on the web view.
But I couldn't make it with properties from my model (be it "content type" or "custom aspect"), although I think I use the exact same way:

static final QName MYPROP = QName.createQName("http://my.own/model/content/1.0", "myprop");
[…]
trimPut(MYPROP, "some text", destination);
How to be certain of the QName of my property?

Have some developers been successful with a similar case (no doubt about it!)??

Regards
Stéphane

stebans
Champ in-the-making
Champ in-the-making
Hi all,

thanks to amarendrakt, I have the solution to this blatant issue: I hadn't added the rule "Extract Metadata" Smiley Surprisedops:. I can't even believe I have forgotten about the rule. Please, write it in red somewhere, in case somebody forgets to add the rule as I did.  Maybe I forgot because the "default" metadata (TITLE, AUTHOR,…) are extracted in all cases.

Again, thank you to amarendrakt and the community.
Stéphane

fhomasp
Champ in-the-making
Champ in-the-making
Interesting thread this one.  I have a certain few questions abouut this applied to my specific situation.
I'm working with applying an aspect to the documents which define custom properties and I'd like to be able to extract them both in a Java program and in the Web interface.  At this point the web interface will be prioritized.  I'll go about posting my model with aspect and the config files I used with their changes.

rlsCVModel.xml in …\extension
     <!– Definition of new Content Type: Real CV –>
      <type name="rls:cv">
         <title>Real CV</title>
         <parent>cm:content</parent>
         <properties>
            <property name="rls:name">
               <type>d:text</type>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>cm:versionable</aspect>
            <aspect>rls:locatable</aspect>           
         </mandatory-aspects>
      </type>
     
    </types>
   
    <aspects>
     
      <!– Definition of new Content Aspect: Locatable –>
      <aspect name="rls:locatable">
         <title>Locatable</title>
         <properties>
            <property name="rls:address">
               <type>d:text</type>
            </property>
            <property name="rls:city">
               <type>d:text</type>
            </property>
         <property name="rls:postalCode">
               <type>d:text</type>
            </property>
            <property name="rls:country">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
     
   </aspects>

custom-model-context.xml (alfresco 2.9B)
<beans>

    <!– Registration of new models    –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/rlsCVModel.xml</value>
            </list>
        </property>
    </bean>

</beans>

web-client-config-custom.xml
<config evaluator="string-compare" condition="Content Wizards"> 
      <content-types>
         <type name="rls:cv"/>
      </content-types>
</config>
   <config evaluator="node-type" condition="rls:cv">
      <property-sheet>
         <show-property name="rls:name" />
      </property-sheet>
   </config>

<config evaluator="aspect-name" condition="rls:locatable">
      <property-sheet>
         <show-property name="rls:address"/>
         <show-property name="rls:city"/>
         <show-property name="rls:postalCode"/>
      <show-property name="rls:country"/>
      </property-sheet>
   </config>

<config evaluator="string-compare" condition="Action Wizards">
      <types>
         <type name="folder" displayLabelId="space"/>
         <type name="content"/>
      </types>
      <aspects> 
         <aspect name="rls:locatable" displayLabel="Locatable"/>
      </aspects>
</config>


custom-metadata-extractors-context.xml
<beans>

    <bean id="extracter.Office" class="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" parent="baseMetadataExtracter" >
        <property name="inheritDefaultMapping">
            <value>true</value>
        </property>
        <property name="mappingProperties">
            <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
               <property name="location">
                  <value>classpath:alfresco/extension/custom-office-extracter-mappings.properties</value>
               </property>
            </bean>
        </property>
    </bean>

</beans>

custom-office-extracter-mappings.properties
This is probably where I'm supposed to make it happen.  Although I'm unsure how the link between the actual word document and the fields I specified in the aspect exists.  I haven't exactly found a great source of info on that problem as well, but that might just be me.
namespace.prefix.cm=http://www.alfresco.org/model/content/1.0
name=cm:description
rls:address=address

jglezar
Champ in-the-making
Champ in-the-making
I have the same needs as you. I'll take a look at your examples, but where did you add the rule?

Thanks,

Javier

kenneth_thorman
Champ in-the-making
Champ in-the-making
I am trying to get this working as well.

I feel that I am fairly close but have found an open jire issue that might indicate that this is not something you can do without Java coding.
Can anyone confirm this?

This is my log, the strange thing is that even though I can see the metadata extraction in the log and I know there is the korresponding property in the document it does not pick it up

00:10:26,646 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Loading model from alfresco/extension/uniitModel.xml
00:10:26,648 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Registered model uniit:model
00:10:26,648 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Registered namespace 'http://www.uniit.dk/model/content/1.0' (prefix 'uniit')
00:10:27,613 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from author to [{http://www.alfresco.org/model/content/1.0}author]
00:10:27,614 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from lastSaveDateTime to [{http://www.alfresco.org/model/content/1.0}modified]
00:10:27,614 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from subject to [{http://www.alfresco.org/model/content/1.0}description]
00:10:27,614 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from DokDato to [{http://www.uniit.dk/model/content/1.0}docdato]
00:10:27,615 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from title to [{http://www.alfresco.org/model/content/1.0}title]
00:10:27,616 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from subject to [{http://www.alfresco.org/model/content/1.0}description]
00:10:27,616 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from author to [{http://www.alfresco.org/model/content/1.0}author]
00:10:27,616 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from lastSaveDateTime to [{http://www.alfresco.org/model/content/1.0}modified]
00:10:27,617 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from createDateTime to [{http://www.alfresco.org/model/content/1.0}created]
00:10:27,617 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Added mapping from title to [{http://www.alfresco.org/model/content/1.0}title]

00:10:35,387 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Labs): Current version 3.0.0 (b 1164) schema 131 - Installed version 3.0.0 (b 1164) schema 131
00:10:43,348 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework

00:13:04,417 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Starting metadata extraction:
   reader: ContentAccessor[ contentUrl=store://C:\Alfresco\tomcat\temp\Alfresco\alfresco920157673475723152.upload, mimetype=application/msword, size=26112, encoding=UTF-8, locale=en_US]
   extracter: org.alfresco.repo.content.metadata.OpenOfficeMetadataExtracter@7f95a585
00:13:05,219 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Converted extracted raw values to system values:
   Raw Properties:    {author=This is an author, title=This is a title, description=This is a subject}
   System Properties: {{http://www.alfresco.org/model/content/1.0}description=This is a subject, {http://www.alfresco.org/model/content/1.0}title=This is a title, {http://www.alfresco.org/model/content/1.0}author=This is an author}
00:13:05,220 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Completed metadata extraction:
   reader:    ContentAccessor[ contentUrl=store://C:\Alfresco\tomcat\temp\Alfresco\alfresco920157673475723152.upload, mimetype=application/msword, size=26112, encoding=UTF-8, locale=en_US]
   extracter: org.alfresco.repo.content.metadata.OpenOfficeMetadataExtracter@7f95a585
   changed:   {{http://www.alfresco.org/model/content/1.0}description={en_US=This is a subject}, {http://www.alfresco.org/model/content/1.0}title={en_US=This is a title}, {http://www.alfresco.org/model/content/1.0}author=This is an author}
00:13:05,391 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Starting metadata extraction:
   reader: ContentAccessor[ contentUrl=store://2009/3/24/0/13/0fb913aa-fb26-4b2c-9365-5e53a3619de7.bin, mimetype=application/msword, size=26112, encoding=UTF-8, locale=en_US]
   extracter: org.alfresco.repo.content.metadata.OpenOfficeMetadataExtracter@7f95a585
00:13:05,485 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Converted extracted raw values to system values:
   Raw Properties:    {author=This is an author, title=This is a title, description=This is a subject}
   System Properties: {{http://www.alfresco.org/model/content/1.0}description=This is a subject, {http://www.alfresco.org/model/content/1.0}title=This is a title, {http://www.alfresco.org/model/content/1.0}author=This is an author}
00:13:05,485 DEBUG [org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter] Completed metadata extraction:
   reader:    ContentAccessor[ contentUrl=store://2009/3/24/0/13/0fb913aa-fb26-4b2c-9365-5e53a3619de7.bin, mimetype=application/msword, size=26112, encoding=UTF-8, locale=en_US]
   extracter: org.alfresco.repo.content.metadata.OpenOfficeMetadataExtracter@7f95a585
   changed:   {}
00:13:05,759 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Configuring property sheet using ConfigService
00:13:05,781 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Items to render: [name, title, description, author, uniit:type, uniit:docdato, uniit:documentchangeddate]
00:13:05,782 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@57d437c(dialog:dialog-body:content-props:prop_name) for 'name' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,782 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@3697781f(dialog:dialog-body:content-props:prop_title) for 'title' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,782 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@124f5739(dialog:dialog-body:content-props:prop_description) for 'description' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,782 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@16e76893(dialog:dialog-body:content-props:prop_author) for 'author' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,782 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@328296a4(dialog:dialog-body:content-props:prop_uniitx003a_type) for 'uniit:type' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,783 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@1b7002e4(dialog:dialog-body:content-props:prop_uniitx003a_docdato) for 'uniit:docdato' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,783 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Created property sheet item component org.alfresco.web.ui.repo.component.property.UIProperty@56cdd4ce(dialog:dialog-body:content-props:prop_uniitx003a_documentchangeddate) for 'uniit:documentchangeddate' and added it to property sheet org.alfresco.web.ui.repo.component.property.UIPropertySheet@62d984b4
00:13:05,785 DEBUG [org.alfresco.web.ui.repo.component.property.UIPropertySheet] Put node into session with key 'editContentProps': Node Type: {http://www.uniit.dk/model/content/1.0}content
Node Properties: {{http://www.alfresco.org/model/content/1.0}name=This is a title.doc, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/content/1.0}modified=Tue Mar 24 00:13:05 CET 2009, {http://www.alfresco.org/model/content/1.0}author=This is an author, {http://www.alfresco.org/model/content/1.0}mimetype=application/msword, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}created=Tue Mar 24 00:13:05 CET 2009, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/content/1.0}title=This is a title, {http://www.alfresco.org/model/content/1.0}content=contentUrl=store://2009/3/24/0/13/0fb913aa-fb26-4b..., {http://www.alfresco.org/model/system/1.0}node-dbid=1343, {http://www.alfresco.org/model/system/1.0}node-uuid=0716d7ab-0de7-49a2-b7fe-46d4a41e2708, {http://www.alfresco.org/model/content/1.0}encoding=UTF-8, {http://www.alfresco.org/model/content/1.0}modifier=admin, {http://www.alfresco.org/model/content/1.0}description=This is a subject}
Node Aspects: [{http://www.alfresco.org/model/content/1.0}auditable, {http://www.alfresco.org/model/content/1.0}generalclassifiable, {http://www.uniit.dk/model/content/1.0}contentAspect, {http://www.alfresco.org/model/system/1.0}referenceable, {http://www.alfresco.org/model/content/1.0}titled, {http://www.alfresco.org/model/content/1.0}author]
00:13:05,791 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_name:label_name for 'name' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@57d437c
00:13:05,795 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@38aa594b(dialog:dialog-body:content-props:prop_name:name) for '{http://www.alfresco.org/model/content/1.0}name' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@57d437c
00:13:05,795 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_title:label_title for 'title' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@3697781f
00:13:05,797 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@2268109(dialog:dialog-body:content-props:prop_title:title) for '{http://www.alfresco.org/model/content/1.0}title' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@3697781f
00:13:05,798 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_description:label_description for 'description' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@124f5739
00:13:05,800 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@35a93ff1(dialog:dialog-body:content-props:prop_description:description) for '{http://www.alfresco.org/model/content/1.0}description' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@124f5739
00:13:05,801 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_author:label_author for 'author' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@16e76893
00:13:05,801 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@7aa502bc(dialog:dialog-body:content-props:prop_author:author) for '{http://www.alfresco.org/model/content/1.0}author' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@16e76893
00:13:05,802 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_uniitx003a_type:label_uniitx003a_type for 'uniit:type' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@328296a4
00:13:05,802 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@6756c38b(dialog:dialog-body:content-props:prop_uniitx003a_type:uniitx003a_type) for '{http://www.uniit.dk/model/content/1.0}type' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@328296a4
00:13:05,803 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_uniitx003a_docdato:label_uniitx003a_docdato for 'uniit:docdato' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@1b7002e4
00:13:05,803 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@71400fad(dialog:dialog-body:content-props:prop_uniitx003a_docdato:uniitx003a_docdato) for '{http://www.uniit.dk/model/content/1.0}docdato' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@1b7002e4
00:13:05,804 DEBUG [org.alfresco.web.ui.repo.component.property.PropertySheetItem] Created label dialog:dialog-body:content-props:prop_uniitx003a_documentchangeddate:label_uniitx003a_documentchangeddate for 'uniit:documentchangeddate' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@56cdd4ce
00:13:05,804 DEBUG [org.alfresco.web.ui.repo.component.property.UIProperty] Created control javax.faces.component.UIInput@24c560f1(dialog:dialog-body:content-props:prop_uniitx003a_documentchangeddate:uniitx003a_documentchangeddate) for '{http://www.uniit.dk/model/content/1.0}documentchangeddate' and added it to component org.alfresco.web.ui.repo.component.property.UIProperty@56cdd4ce

Any help greatly appreciated

Regards
Ken

kenneth_thorman
Champ in-the-making
Champ in-the-making
Hi

I have been at it since last post still with no luck. I guess next stepp is setting up a full development environment and debugging it to find out what is wrong.

Anyway this is the JIRA issue I was refering to in the previous post (https://issues.alfresco.com/jira/browse/ALFCOM-1757), does anyone know if this has been fixed somewhere?


Here is a little more information about our setup/configuration
This is our setup

Alfresco Version: Labs - v3.0.0 (b 1164)
Installed on tomcat running on mysql (Redhat Enterprise)

Files:

/opt/Alfresco/tomcat/webapps/alfresco/jsp/browse/browse.jsp


<a:column id="categories" style="text-align:left">
<f:facet name="header">
<a:sortLink id="categories-sort" label="Categories" value="cm:categories" styleClass="header" />
</f:facet>
<h:outputText id="categories-txt" value="#{r.properties['cm:categories']}" />
</a:column>


/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
# Property sheet and modelling debugging
# change to error to hide the warnings about missing properties and associations
log4j.logger.alfresco.missingProperties=debug
log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=debug
log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=debug
log4j.logger.org.alfresco.web.ui.repo.component.property=debug

# Dictionary/Model debugging
log4j.logger.org.alfresco.repo.dictionary.DictionaryDAO=debug
#log4j.logger.org.alfresco.repo.dictionary.DictionaryDAO=info



# Metadata
log4j.logger.org.alfresco.repo.content.metadata.AbstractMetadataExtracter=debug
log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=debug

/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/custom-office-extracter-mappings.properties

# Namespaces
namespace.prefix.cm=http://www.alfresco.org/model/content/1.0
namespace.prefix.uniit=http://www.uniit.dk/model/content/1.0

# Mappings
author=cm:author
title=cm:title
subject=cm:description
createDateTime=cm:created
lastSaveDateTime=cm:modified
DokDato=uniit:docdato

/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/uniit-model-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
    <!– Registration of new models –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/uniitModel.xml</value>
            </list>
        </property>
    </bean>
</beans>

/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/uniitModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="uniit:model" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>UNI-IT Content Model</description>
   <author>Appinux</author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="http://www.uniit.dk/model/content/1.0" prefix="uniit" />
   </namespaces>

   <types>
      <!– UNI-IT Content–>
      <type name="uniit:content">
         <title>UNI-IT Content</title>
         <parent>cm:content</parent>
         <mandatory-aspects>
           <aspect>cm:generalclassifiable</aspect>
           <aspect>uniit:contentAspect</aspect>
         </mandatory-aspects>
      </type>
   </types>

   <aspects>
      <aspect name="uniit:contentAspect">
         <title>UNI-IT Content Aspect</title>
         <properties>
            
            <property name="uniit:type">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="uniit:docdato">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="uniit:documentchangeddate">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
      </aspect>
   </aspects>
</model>

/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/custom-metadata-extrators-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   <bean id="extracter.Office" class="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" parent="baseMetadataExtracter">
      <property name="inheritDefaultMapping">
         <value>true</value>
      </property>
      <property name="mappingProperties">
            <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
               <property name="location">
                  <value>classpath:alfresco/extension/custom-office-extracter-mappings.properties</value>
               </property>
            </bean>
      </property>
    </bean>

<bean id="extracter.OpenDocument" class="org.alfresco.repo.content.metadata.OpenDocumentMetadataExtracter" parent="baseMetadataExtracter">
        <property name="inheritDefaultMapping">
            <value>true</value>
        </property>
        <property name="mappingProperties">
            <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
               <property name="location">
                  <value>classpath:alfresco/extension/custom-office-extracter-mappings.properties</value>
               </property>
            </bean>
        </property>
    </bean>
</beans>

/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/web-client-config-custom.xml
<alfresco-config>
   <config>
      <client>
        
         <!– The default location to display when the browse screen is first shown –>
         <!– This value should be one of 'myalfresco', 'userhome', 'companyhome' or 'guesthome' –>
         <initial-location>userhome</initial-location>
        
      </client>
   </config>

   <config evaluator="string-compare" condition="Dashboards">
      <!– Dashboard layouts and available dashlets for the My Alfresco pages –>
      <!– see http://wiki.alfresco.com/wiki/User_Configurable_Dashboards –>
      <dashboards>
        
         <!– configuration of the default dashlets to display when users login for the first time –>
         <!– if this config is removed, then no dashlets will be shown by default –>
         <!– overides of this config should redefine the entire list, not assume additions to it –>
         <default-dashlets>
            <dashlet id="tasks-todo" />
         </default-dashlets>
        
         <!– set true allow the Guest user to configure the dashboard view - false by default –>
         <allow-guest-config>false</allow-guest-config>
      </dashboards>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">

      <subtypes>
         <type name="uniit:content" display-label-id="uniitcontent"/>
      </subtypes>
      <!– The list of aspects to show in the add/remove features action –>
      <!– and the has-aspect condition –>
      <aspects>
         <aspect name="uniit:contentAspect"/>>
      </aspects>
   </config>


   <!–  add paradigmaspect aspect properties to property sheet –>
   <config evaluator="aspect-name" condition="uniit:contentAspect">
      <property-sheet>
         <show-property name="uniit:type" display-label-id="type" read-only="true" />
         <show-property name="uniit:docdato" display-label-id="docdato" read-only="true" />
         <show-property name="uniit:documentchangeddate" display-label-id="documentchangeddate" read-only="true" />
      </property-sheet>
   </config>

   <!–  add UNIIT types to add content list –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="uniit:content" />
      </content-types>
   </config>

    <!– Add new metadata to advanced search –>
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="uniit:content" />
         </content-types>
         <custom-properties>
            <meta-data aspect="uniit:contentAspect" property="uniit:type" display-label-id="type" />
            <meta-data aspect="uniit:contentAspect" property="uniit:docdato" display-label-id="docdato" />
            <meta-data aspect="uniit:contentAspect" property="uniit:documentchangeddate" display-label-id="documentchangeddate" />
         </custom-properties>
      </advanced-search>
   </config>
   
   <config evaluator="string-compare" condition="Views">
      <!– the views available in the client –>
      <views>
         <view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$DetailsViewRenderer</view-impl>
         <view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$IconViewRenderer</view-impl>
         <view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$ListViewRenderer</view-impl>
         <view-impl>org.alfresco.web.bean.forums.ForumsBean$TopicBubbleViewRenderer</view-impl>
        
         <!– default values for the views available in the client –>
         <view-defaults>
            <browse>
               <!– allowable values: list|details|icons –>
               <view>details</view>
               <page-size>
                  <list>10</list>
                  <details>10</details>
                  <icons>9</icons>
               </page-size>
            </browse>
            <forums>
               <!– allowable values: list|details|icons –>
               <view>list</view>
               <page-size>
                  <list>20</list>
                  <details>20</details>
                  <icons>20</icons>
               </page-size>
            </forums>
            <forum>
               <!– allowable values: details –>
               <view>details</view>
               <page-size>
                  <details>20</details>
               </page-size>
            </forum>
            <topic>
               <!– allowable values: details|bubble –>
               <view>bubble</view>
               <sort-column>created</sort-column>
               <!– allowable values: ascending|descending –>
               <sort-direction>descending</sort-direction>
               <page-size>
                  <bubble>5</bubble>
                  <details>20</details>
               </page-size>
            </topic>
         </view-defaults>
      </views>
   </config>
   
</alfresco-config>


Any help is very welcome.

Regards
Kenneth Thorman