AnsweredAssumed Answered

Filters on custom datalists

Question asked by juanka.crespo on Jul 5, 2016
Latest reply on Apr 26, 2017 by lmaorence
Dear all.

I've been trying to fix a problem with a custom datalist filters.

The datalist filter are working correctly for all the predefined datalists but it doesn't work at all with customs datalists.

Without any extra data in the -context.xml file we encounter that each time you want to filter we get extra buttons that doesn't work since they redirects to a broken page. If we click on the normal Apply filter, it will clear the view without showing the filtered items.

We tried to add the following code, which is found on the example:

<bean id="dataListTypes" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" depends-on="datalistFormFilterNode">
        <property name="targetObject" >
                <ref bean="datalistFormFilterNode"/>
        </property>
        <property name="targetMethod" value="setDatalistTypes" />
        <property name="arguments">
                <set>
                        <value>datos:datosTabla</value>
                        <value>myebd:myebdTabla</value>
                 </set>
        </property>
</bean>

<bean id="dataListTypesType" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" depends-on="datalistFormFilterType">
        <property name="targetObject" >
                <ref bean="datalistFormFilterType"/>
        </property>
        <property name="targetMethod" value="setDatalistTypes" />
        <property name="arguments">
                <set>
                        <value>datos:datosTabla</value>
                        <value>myebd:myebdTabla</value>
                </set>
        </property>
</bean>


This code will give an error telling that the datalistFormFilterType cannot be found. We have managed to make it work by either adding to this file or uncommenting it from the module-context.xml file that is found in: contentreich-alfresco-datalists-master/contentreich-extdl-repo/src/main/resources/alfresco/module/contentreich_extdl

The code uncommented is as follow:


<!–bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
          <list>
              <value>alfresco/extension/fme-extended-datalist-model.xml</value>
          </list>
      </property>
  </bean–>

    <!– Datalist Policy –>
    <!– bean id="DataListItemPolicies" class="de.fme.alfresco.repo.policy.DataListItemPolicies"
      init-method="init">
      <property name="policyComponent" ref="policyComponent"/>
      <property name="nodeService" ref="nodeService" />
      <property name="dictionaryService" ref="dictionaryService" />
      <property name="versionService" ref="versionService" />
      <property name="datalistIDService" ref="datalistIDService" />
    </bean–>

    <!–bean id="datalistBaseFormFilter" abstract="true" parent="baseFormFilter">
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService" />
        </property>

        <property name="behaviourFilter" ref="policyBehaviourFilter" />
          <property name="nodeService" ref="nodeService" />
          <property name="contentService" ref="contentService" />
           <property name="datalistTypes">
           <set>
               <value>dl:simpletask</value>
               <value>dl:contact</value>
               <value>dl:eventAgenda</value>
               <value>dl:todoList</value>
               <value>dl:task</value>
               <value>dl:issue</value>
               <value>dl:event</value>
               <value>dl:location</value>
               <value>dl:meetingAgenda</value>
           </set>
       </property>
    </bean–>

    <!–bean id="datalistFormFilterNode" class="de.fme.alfresco.repo.form.DataListFormFilter" parent="datalistBaseFormFilter" >
        <property name="filterRegistry" ref="nodeFilterRegistry" />
        <property name="properties" ref="global-properties" />
    </bean>
<!–bean id="datalistIDService" class="de.fme.alfresco.repo.datalist.DatalistIDServiceImpl">
                <property name="nodeService" ref="NodeService" />
        </bean>

        <bean id="datalistIDServiceSciptFacade" parent="baseJavaScriptExtension" class="de.fme.alfresco.repo.datalist.DatalistIDServiceScriptFacade">
                <property name="extensionName" value="datalistIDService" />
                <property name="datalistIDService" ref="datalistIDService" />
                <property name="nodeService" ref="NodeService" />
        </bean>
        –>


It is necessary to change all the fme references by contentreich, otherwise the code won't work at all and will make Alfresco crash.

When we do so, the behaviour is even worse. All the fields in all the datalists are double (for instance if you have a title field you will see "Title" "Title" on the field list. And the custom datalist filter doesn't work either that way.

Any help will be appreciated

Attachments

Outcomes