cancel
Showing results for 
Search instead for 
Did you mean: 

Filters on custom datalists

juanka_crespo
Champ in-the-making
Champ in-the-making
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
5 REPLIES 5

juanka_crespo
Champ in-the-making
Champ in-the-making
I've been investigating a little bit more. I decided to change the file inside the root of the add-on that seems to have the configuration of the other filters. I added the filter I want in there and it didn't work… and even funnier, I decided to delete one of the filters and it still works…

The fine is inside contentreich-alfresco-datalists-master/contentreich-extdl-share/src/main/resources/alfresco/site-data/extension/ and the name of the file is contentreich-extdl.xml

I recreated the jar file, I even made sure the xml is changed on the .jar file but It doesn't work… I don't understand how the hell does Alfresco work at all lol

Hi Juanka,

Did you solve this issue? I have the same problem Smiley Sad.

Best Regards,

June

Hello, have you fixed this? I have the same problem lol

lmaorence
Confirmed Champ
Confirmed Champ

I am using FME datalist filter and also encountered this problem, I tried removing the <create-form> tag from config model-type in my share because i think its overriding the <create-form> tag in the jar file and resolved the problem, now filter is working and there are no extra buttons showing. However, when you click the 'New Item', the modal pops up but the modal header is empty and there is a transparent field below it. Anyone who have any ideas about this? See images below. 

Cheers,

Law

Filter is now working and the uneccessary buttons are gone

When adding new item, modal header is blank and there is a transparent field below

lmaorence
Confirmed Champ
Confirmed Champ

Also, be sure to add the extension modules here http://localhost:8080/share/page/modules/deploy