AnsweredAssumed Answered

Properties ignored in my module

Question asked by saxophtrion on Jun 10, 2015
Latest reply on Jun 17, 2015 by marco.altieri
Hello everyone, first I apologize for my bad english, I will try to explain my problem.

I recently installed Alfresco 5.0d on my computer, I made a synchronization with a LDAP by configuring the alfresco-global-properties. I can now log in with LDAP users and datas are synchronized it's ok.

Now I'm trying to synchronize user's photos from the LDAP in Alfresco and to do that I choose to develop a little module in java which connect to the LDAP, download the photo and inject it into alfresco using the REST API. My program works perfectly so I packaged it in amp for the integration in Alfresco.

I take example on the trashcan cleaner module available on github here https://github.com/atolcd/alfresco-trashcan-cleaner

The organization of my module is exactly the same as the trashcan cleaner. When I deploy Alfresco the module is well started and I can synchronized photos from the LDAP.

But there is a problem, I try to externalize the configuration of my module by doing the same thing as the trashcan cleaner : I define the properties of my bean like this

  <property name="userId">
      <value>${avatarSender.userId}</value>
    </property>
   <property name="photoAttribute">
      <value>${avatarSender.photoAttribute}</value>
    </property>


These properties are in the Java class and setters are well defined. However, when I write for example avatarSender.userId=XXXX the module ignore it and take the default value I specified in the Java class.

An other strange fact, I wanted my module to be automatic like the trashcan cleaner, so I make a scheduled job and I defined the bean like this :

<bean id="avatarSenderTrigger" class="org.alfresco.util.CronTriggerBean">
    <property name="jobDetail">
      <ref bean="avatarSenderJobDetail" />
    </property>
    <property name="scheduler">
      <ref bean="schedulerFactory" />
    </property>
    <!– trigger at 4am each day –>
    <property name="cronExpression">
      <value>${avatarSender.cron}</value>
    </property>
  </bean>


This time, when I write avatarSender.cron=XXX in my alfresco-global-properties, the job is executed at the  good moment, it does not ignore this parameter.

All beans in the module are defined in the same context, there are no errors when deploying so I don't understand why all my external parameters are ignored except the avatar.cron

Thanks for your help :)

Outcomes