Todo List

Alfresco Extended Datalists migrated to 4.0

The Alfresco Datalist Extensions for Share provide extended functionality like versioning of list items, comments, ID generation, support for long text, “frictionless upload & attach”, XLS export and filtering. All very helpful features when you are using it seriously at a certain scale. The original author Jan Pfitzner did not get the chance to migrate the code hosted at google. I took the challenge when he delegated a recent enquiry.

What I did

Even though build and version control where in place provided by ant and subversion, I migrated these to maven and git because I like the latter far better. I made the build generate extension artifacts you install just by dropping them into an appropriate folder. Jan did not fail do so originally. Version 3.4 just did not provide certain extension mechanisms. Overriding a Java backed webscript proved to be trickier than expected, but in general most of the code worked more or less unchanged. The challenge was to find the spots Jan hacked tweaked. During the testing, we found that the richtext control does not quite work as expected when using a recent version of Firefox. I filed a JIRA issue and reverted to a plain text area. I think it should not take long until it gets fixed.

Installation

  • Download the package below or follow the link to github and roll your own
  • Stop tomcat
  • Put fme-alfresco-extdl-share-1.0.jar in tomcat/shared/lib or tomcat/webapps/share/WEB-INF/lib
  • Put fme-alfresco-extdl-repo-1.0.jar in tomcat/webapps/alfresco/WEB-INF/lib
  • Start tomat

Have fun !

PS: Thanks for supporting the effort, Jan !

Update Oktober, 8th: I updated the download package. The made the following changes:

  • Changed filtering to use XPath instead of solr since solr is the default search subsystem and only “eventually consistent”
  • Fixed “Activity Action Buttons missing” bug
  • Do not override XLS export webscript

Update January, 28th 2013:
The Alfresco 4.2. date bug is fixed. The updated 1.2 version of the extension seems to be working ok with Alfresco 4.2. It may still work with 4.0.

PPS: Solr based filtering is only commented out in data.post.js so it is easy to switch back to a lucene based search if you like that better. Besides, implementing XPath based filtering proved to be harder than expected.

Download Datalist Extensions for Alfresco Share 4.2
Download Datalist Extensions for Alfresco Share 4.0

References

Andreas Steffan
Pragmatic ? Scientist and DevOps Mind @ Contentreich. Believes in Open Source, the Open Web and Linux. Freelancing in DevOps-, Cloud-, Kubernetes, JVM- and Contentland and speaks Clojure, Kotlin, Groovy, Go, Python, JavaScript, Java, Alfresco and WordPress. Built infrastructure before it was cool. ❤️ Emacs.

27 thoughts on “Alfresco Extended Datalists migrated to 4.0”

  1. After deploying the jar files Alfresco Share seems to lose each custom list. The list names are still listed on the left side but they only produce notification “No Data List Selected”. And creating a new list will not show any custom lists. After removing the jars I can use the custom lists just fine. Is there a workaround available? I’m using Alfresco Community 4.0.0.

  2. Hi Andreas Steffan,
    Thanks A lot for your datalist extension.
    by default you genrate id by 1,2,3….
    i have a requirement with id includes string.
    can you please give me some guidence on this …….

    Thanks In Advance……

  3. It seems the migration script is not compatible with Alfresco 4.x. Is it used to migrate from earlier versions of Alfresco to 4.x or to migrate from standard datalist to extended version?

  4. Also, I found out that the Data List definitions for the repository data models as well as the Share forms are being overwritten by XML files inside the distribution jars. I tried to copy my customizations from the “original” Alfresco XML files to the embedded ones but Alfresco ended up losing the whole site. After going back to original files all was working as before experimenting. Is this the right way to go or am I missing something? As said before, the migration script is not compatible and doesn’t execute (Error 500).

  5. Regarding the migration script: I just know about its existence and have not had a closer look.

    And yes, the extension overrides various datalist related stuff and is meant to do so. If you already have custom tweaks, I am not surprised to see a conflict.

    I’m sorry guys, but cannot look into this any further at this time due to Alfresco Devcon tomorrow and Devoxx next week.

  6. Hi,
    Thank you so much for sharing your adpatation of this extension for alfresco 4.
    it works very well. Only one problem.
    If I create list that contains date fields (event list, tasks list, advanced tasks list…), when i try to add a new item with a date field filled the new item can not be added to the list. I got an error like : “Failed to add the new item to the datalist” (It didn’t really trigger any messages in Alfresco logs). If I let date field empty the item is added without any problem.
    My version of alfresco : Community – v4.2.0 (Installed in french).
    Do you have the same issue with a version of alfreco installed in english? Is there a conflict with the French date format? Do I need to edit a file in the jar extensions?
    For information I can add items (with date) to my lists when the extension is not enabled.
    Many thanks for your help and advice.

  7. More information about my date field issue,

    I analyzed my issue with firebug.
    When the fme datalist extension is not activacted and that I add an item to a datalist, the post var from the date fields are sent with this format : 2012-12-04T00:00:00.000+01:00. When the fme extension is enabled, the date var are sent with this format : 2012-12-04. The timezone is missing.
    Here is the error return by firebug :
    “message” : “org.alfresco.service.cmr.repository.datatype.TypeConversionException: The property value is not compatible with the type defined for the property: \n property: Name: {http:\/\/www.alfresco.org\/model\/datalist\/1.0}ganttStartDate\nTitle: Date de D\u00e9but\nDescription: null\nDefault Value: null\nDataType Name: {http:\/\/www.alfresco.org\/model\/dictionary\/1.0}date\nContainerClass Name: {http:\/\/www.alfresco.org\/model\/datalist\/1.0}gantt\nisMultiValued: false\nisMandatory: false\nisMandatoryEnforced: false\nisProtected: false\nisIndexed: true\nisStoredInIndex: false\nisIndexedAtomically: true\nindexTokenisationMode: TRUE\n\n value: 2012-12-04\n value type: class java.lang.String”,
    “exception” : “”,
    I suppose I have to add the time zone in some js file of the jar extension. I’ve tried to edit some of them with no success. Any idea about the file to edit?
    Many thanks.

  8. Hi Fabien,

    I’m sorry, but right now I don’t have a system running the fme datalists extension so I can analyze the issue.

    All I can say right now is that I did not touch date handling at all and that I have not tried the extension with a 4.2 release.

    regards
    Andreas

  9. Hi,

    Great work bringing this extension to 4.0! I can confirm the same error that Fabien is seeing: when filling in a Date field on a data list item, the item cannot be added or existing ones cannot be saved. I am also using Alfresco Community 4.2.

    Best regards,
    -Jose

  10. @Jose de Leon

    I managed to solve the date field issue by updating the function “new Alfresco.DatePicker(“${controlId}”, “${fieldHtmlId}”).setOptions(” in the file fme-alfresco-extdl-1.1\fme-alfresco-extdl-1.1\fme-alfresco-extdl-share-1.1\alfresco\web-extension\site-webscripts\org\alfresco\components\form\controls\date.ftl
    I added a parameter to the function (submitTime : true) so there is the function now :
    //<![CDATA[
    (function()
    {
    new Alfresco.DatePicker("${controlId}", "${fieldHtmlId}").setOptions(
    {
    disabled: true,
    currentValue: “${field.value?js_string}”,
    showTime: ${showTime?string},
    mandatory: ${field.mandatory?string},
    submitTime : true
    }).setMessages(
    ${messages}
    );
    })();
    //]]>

    Now I can add items with date fields in my datalist.

    But now there are filters that I can not make it work with custom fields !
    When I try to display a custom field in the filter area and that I clic on Apply filter I’ve get this error :

    11170001 Wrapped Exception (with status template): 11170076 Failed to execute script ‘classpath*:alfresco/extension/templates/webscripts/org/alfresco/slingshot/datalists/data.post.json.js’: 11170075 Error executing xpath: xpath: * [(@dl:taskPriority=”High” or @dl:taskPriority=”Low” or @dl:taskPriority=”Normal”) and (like(@dl:3cieSpecified,”*Oui,Non*”)) and (like(@dl:ganttPercentComplete,”*0*”))]

    Here I just tried to add the custom field dl:3cieSpecified in the filter arrea, this field is just a list containing 2 values Oui,Non.

    And Filters do not work with persons fields for example when i try to filter tasks on the task assignee, when I clic on apply filter, I’ve got no errors but no entry is returned while several tasks are assigned to the person entered in the assignee field.

    Does someone have same issues with filters?

  11. @Fabien Can you post the jar that you just updated? I really could use them as I need the date field more than filters right now

  12. You guys using the extension should probably know that I am not actively maintaining the code.

    The basic reason is that neither we nor our customers are using it. Hence, I am sorry to say that I currently have no motivation and also need to make a living.

    I would be happy if somebody else volunteers to take over.

  13. Today, I am happy to announce that MicroHealth, LLC bit the bullet and volunteered to sponsor the date issue fix. There is a new download link in the references section.

  14. In general, it should be compatible with custom datalists, but there may be gotchas here and there.

    The add-on overrides the datalist types shipped with alfresco. I guess Jan did this because it was the only reasonable technical solution at that time. That may still be so. Anyways, in practice this means that there is no super easy way to switch between implementations once you have created instances, so you might want to create a data migration script.

  15. Thanks for releasing customization of datalists (filter facility) for Alfresco 4.2c. I am new to Alfresco and am trying to deploy for my organization. Thanks again

  16. Sorry guys to ask this but unfortunately I was not able to find out from the comments if the migration script linked works for default 4.2 datalists?

    Will I loose all datalist content if I load the jar without upgrading datalist descriptions by scipt first?

  17. I have never used the migration script myself, but I assume Jan was sane enough not to nuke existing data.

    The extended lists introduce additional properties. I would expect content migration to work by first introducing the extended model, adding the repo extension jar and then running the migration script to initialize the new properties.

    Reverting is a different story.

  18. Hi guys,
    i ran the script and have the extension not running on my staging system. However I encountered several issues:

    1. The script replaces the original commenters name with the users name who ran the migration script. Same happens with the comments date.
    2. There used to be a TopicID or IssueID field in the default datalists. This field can not longer be used cause there are no means to edit or enter it. Despite that it is still displayed in the datagrid as always empty.
    3. After the migration script an XLS export ignores the migrated comments completely
    4. Filtering on person fields does not work. And SOLR is complaining about non-incrementeal model TYPE update refusing the model upgrade.
    5. Deleting all filter field content and hitting the FILTER button deos not reset the filter.
    6. Fieldnames between datagrid and XLS export are inconsistens. e.g. Comments exported to the Forum column

    As Andreas already stated. Reverting the migratation seems to be dificult. I tried just “reversing” the migration script by removing the additional Aspects an so on. After deleting the jars and rebooting all jars disappeared. This could be a major issue if you try to upgrade to a newer version of alfresco without the extension.

    I am thinking about sponsoring FME a proper upgrade to 4.2c. (for default datalist types only). With the addition of some minor features like a function to move datalist entries between datalists.

  19. Hi, I’m new to Alfresco, installed the extension (version 1.2) to Window installed Alfresco 4.2.C. I couldn’t get the ‘Upload & Attach’ to work. Somehow I don’t get the file browser at all after selecting the upload destination, ther is no error in the logs. Something I missed? Thanks in advance.

  20. Hello,

    I installed version 1.2 of the extension in Alfresco Community version 4.2.e, but the versioning of list items and the comments does not work. The ID works fine, and also the xls export.
    Can you imagine what could be the problem?

    Thanks

  21. I am facing similar issue (comments not showing up), versioning is not working. I get the below error. Please advise me on this.

    From Log
    =======
    2014-05-05 04:09:38,089 ERROR [extensions.webscripts.AbstractRuntime] [http-8080-8] Exception from executeScript – redirecting to status template error: 04050004 Wrapped Exception (with status template): 04050044 Failed to execute script ‘classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js’: null
    org.springframework.extensions.webscripts.WebScriptException: 04050004 Wrapped Exception (with status template): 04050044 Failed to execute script ‘classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js’: null
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
    at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:429)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:744)
    Caused by: org.alfresco.scripts.ScriptException: 04050044 Failed to execute script ‘classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js’: null
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:204)
    at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
    at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
    at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
    at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1305)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
    … 25 more
    Caused by: java.lang.NullPointerException
    at org.alfresco.repo.site.SiteServiceImpl.findContainer(SiteServiceImpl.java:2636)
    at org.alfresco.repo.site.SiteServiceImpl.getContainer(SiteServiceImpl.java:2545)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:161)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.transaction.CheckTransactionAdvice.invoke(CheckTransactionAdvice.java:47)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.transaction.RetryingTransactionAdvice$1.execute(RetryingTransactionAdvice.java:64)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
    at org.alfresco.repo.transaction.RetryingTransactionAdvice.invoke(RetryingTransactionAdvice.java:67)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy99.getContainer(Unknown Source)
    at org.alfresco.repo.site.script.Site.getContainer(Site.java:460)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
    at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
    at org.mozilla.javascript.gen.c18._c1(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js:17)
    at org.mozilla.javascript.gen.c18.call(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
    at org.mozilla.javascript.gen.c18._c0(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js:28)
    at org.mozilla.javascript.gen.c18.call(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
    at org.mozilla.javascript.gen.c18.call(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js)
    at org.mozilla.javascript.gen.c18.exec(file:/home/alfresco/apache-tomcat-6.0.37/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/containers.get.js)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:502)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:200)
    … 30 more

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert