Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-19004

Overriding date format in web-extension doesn’t change the date format in Alfresco Share

    Details

    • Bug Priority:
      Category 3
    • ACT Numbers:

      00946935

      Description

      Changing date format in Alfresco Share works when original files are modified. Overriding changes in web-extension folder doesn’t work completely.

      Steps to reproduce:
      1- Change date format from European style (Day/Month) to American style (Month/Day) in the following files:

      • tomcat/webapps/share/WEB-INF/classes/alfresco/messages/common_en.properties
        Example:
      date-format.default=mmm ddd d yyyy HH:MM:ss
      date-format.defaultDateOnly=mmm ddd d yyyy
      date-format.shortDate=m/d/yy
      date-format.mediumDate=mmm d, yyyy
      date-format.mediumDateNoYear=mmm d
      date-format.longDate=mmmm dd, yyyy
      date-format.longDateNoYear=mmmm dd
      date-format.fullDate=mmmm, dddd d, yyyy
      date-format.fullDateTime=mmmm, dddd d, yyyy 'at' h:MM TT
      date-format.dayDateMonth=mmmm , dddd d 
      date-format.rfc822=EEE, MMM dd yyyy HH:mm:ss Z
      • tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/form/form.get_en.properties
        Example:
      form.control.date-picker.entry.date.format=M/d/yyyy
      form.control.date-picker.display.date.format=MM/DD/YYYY
      form.control.date-picker.view.date.format=EEE MMM dd yyyy
      form.control.date-picker.view.time.format=EEE MMM dd yyyy HH:mm:ss z
      form.control.date-picker.entry.datetime.format.nojs=YYYY-DD-MMThh:mm:ss.sTZD

      2- Restart Alfresco and check date format of a document:
      Created Date: Nov Wed 15 2017 13:21:40
      Modified Date: Nov Wed 15 2017 13:21:40

      As expected it changed the date format.

      Original date format was:
      Created Date: Wed 15 Nov 2017 13:21:40
      Modified Date: Wed 15 Nov 2017 13:21:40

      3- Revert those changes and implement these changes in web-extension:

      Copy original file form.get_en.properties (and form.get.properties) to:
      tomcat/shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/form

      and common_en.properties (and common.properties) to tomcat/shared/classes/alfresco/messages

      and modify date format as mentioned in step 1.

      4- Create tomcat/shared/classes/alfresco/web-extension/messages-extension-context.xml to override the original message bundle bean to point to customized message bundle's name:

      <?xml version='1.0' encoding='UTF-8'?>
       <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 
          'http://www.springframework.org/dtd/spring-beans.dtd'>
       <beans>
           <bean id="webscripts.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
             <property name="resourceBundles">
                <list>
                   <value>webscripts.messages.webscripts</value>
                   <value>alfresco.messages.common</value>
                   <value>alfresco.messages.cmm</value>
                   <value>alfresco.messages.slingshot</value>
                   <value>alfresco.messages.smartfolder</value>
                </list>
             </property>
          </bean>
       </beans>

      The original bean is defined in the <configRootShare>/classes/alfresco/slingshot-application-context.xml

      5- Restart Alfresco and check date format of document.

      Observed behaviour:
      Current date format:
      Created Date: Wed 15 Nov 2017 13:21:40
      Modified Date: Wed 15 Nov 2017 13:21:40

      Expected behaviour:  
      Date format displays the same date format when files in original location(share/WEB-INF) are modified:
      Created Date: Nov Wed 15 2017 13:21:40
      Modified Date: Nov Wed 15 2017 13:21:40

      Analysis to date:

      • Adding control-wrapper.post_en.properties and control-wrapper.post.properties files to tomcat/shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/form and modifying them doesn’t change the behaviour.
      • Date entry format on starting page of a workflow is properly displayed(mm/dd/yyyy).
      • Modified files and screenshots attached.

        Attachments

        1. customized.zip
          16 kB
        2. modifyOriginalFile.jpg
          modifyOriginalFile.jpg
          83 kB
        3. OverrideWebExtension.jpg
          OverrideWebExtension.jpg
          28 kB

          Structure

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rabbaspour Rosa Abbaspour [X] (Inactive)
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel