AnsweredAssumed Answered

Custom user (cm:person) properties and LDAP import

Question asked by shmoula on Aug 19, 2009
Latest reply on Jan 21, 2010 by prateekgoyal
Hi,
  I would like to add custom properties to user model and then do import from LDAP, is this possible?

I have following model:

<type name="usrVcf:user">
    <parent>cm:person</parent>
    <properties>
        <property name="usrVcf:user_uid">
            <type>d:int</type>            
        </property>
    </properties>
</type>

which is registered ok:

12:13:42,117 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Loading model from alfresco/extension/usrVcfModel.xml
12:13:42,119 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Registered model usrVcf:usermodel
12:13:42,119 INFO  [org.alfresco.repo.dictionary.DictionaryDAO] Registered namespace 'http://www.shmoula.cz/model/user/1.0' (prefix 'usrVcf')

and I have (example) attribute mapped in ldap-synchronization-context.xml like this:

<entry key="usrVcf:user_uid">
    <value>10</value>
</entry>

after all this an "Cannot find in Repository dictionary" exception occurs :-(

12:36:00,440 ERROR [org.quartz.core.ErrorLogger] Job (DEFAULT.ldapPeopleJobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.repo.importer.ExportSourceImporterException: Failed to import]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: org.alfresco.repo.importer.ExportSourceImporterException: Failed to import
        at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:211)
        at org.alfresco.repo.importer.ImporterJob.execute(ImporterJob.java:44)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        … 1 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 11; column 24 due to error: Definition {http://www.shmoula.cz/model/user/1.0}user_uid is not valid; cannot find in Repository dictionary
        at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:190)
        at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:359)
        at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:223)
        at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:186)
        … 3 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Definition {http://www.shmoula.cz/model/user/1.0}user_uid is not valid; cannot find in Repository dictionary
        at org.alfresco.repo.importer.view.ViewParser.processStartElement(ViewParser.java:280)
        at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:176)
        … 6 more

Why is this happening? Is there a way to do this? TIA!

Outcomes