Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-8995

Reduce the number of server calls when clicking on a page/content

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 4.2.0
    • 4.1.0
    • None
    • None
    • 4.2 M3

      Each SmartContentController calls a getStatus() on the server to enable/disable the button.

      Most of the time, the server-side calcul uses data already available in the bus, so this call can be avoided.

      Many other buttons do server calls when they are not really needed

          [CMS-8995] Reduce the number of server calls when clicking on a page/content

          Moving getStatus is not complete... you did not move all associated protected methods such as _isLocked that is delegating to an helper that maybe should be moved too...

          (I already wrote this above )

          Raphaël Franchet added a comment - Moving getStatus is not complete... you did not move all associated protected methods such as _isLocked that is delegating to an helper that maybe should be moved too... (I already wrote this above )

          Important drawback:

          The ContentTool and the OldContentTool save the current content as a member to easily resend bus message.
          This was not an issue before because most buttons were asking server... but now they believe in the message that can be wrong since the content continue to live.
          Keeping a content is a dangerous idea... for the OldContentTool this is not useful and should be simply removed...
          For the ContentTool, this is usefull when navigating in the edition form... so we should listen for events to replace this class member each time we hear about a content and/or clear the attribute when after bluring the tool

          Raphaël Franchet added a comment - Important drawback: The ContentTool and the OldContentTool save the current content as a member to easily resend bus message. This was not an issue before because most buttons were asking server... but now they believe in the message that can be wrong since the content continue to live. Keeping a content is a dangerous idea... for the OldContentTool this is not useful and should be simply removed... For the ContentTool, this is usefull when navigating in the edition form... so we should listen for events to replace this class member each time we hear about a content and/or clear the attribute when after bluring the tool

          I think that the _getStatus method of SmartClientSideElement is not used directly anymore except by inheritance by DeleteContentClientSideElement (cms & web)... we should move java code to theses classes (and the associated helper?)

          Raphaël Franchet added a comment - I think that the _getStatus method of SmartClientSideElement is not used directly anymore except by inheritance by DeleteContentClientSideElement (cms & web)... we should move java code to theses classes (and the associated helper?)

          A migration guide is necessary for migration

          Raphaël Franchet added a comment - A migration guide is necessary for migration

          Raphaël Franchet added a comment - - edited

          Once this will be push, the following plugins have to be marked as incompatible : Blog, Content IO, ODF, Thesaurus and User directory.

          We have to consider deliver a new versions of these plugins if necessary BEFORE commiting this

          Raphaël Franchet added a comment - - edited Once this will be push, the following plugins have to be marked as incompatible : Blog, Content IO, ODF, Thesaurus and User directory. We have to consider deliver a new versions of these plugins if necessary BEFORE commiting this

          There is a patch only for the Intranet template, while we have 4 other templates

          Raphaël Franchet added a comment - There is a patch only for the Intranet template, while we have 4 other templates

          Here is the list of buttons to tests since they are impacted in a way or another 

          CMS
          org.ametys.cms.referencetable.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.cms.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.cms.hierarchical.referencetable.contents.DeleteCandidate (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.cms.content.PasteContentValues (Ametys.plugins.cms.content.controller.PasteContentValuesController)
          org.ametys.cms.content.Edit
          org.ametys.cms.referencetable.Edit
          org.ametys.cms.Unlock

          WEB
          org.ametys.web.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.web.contentprivacy (Ametys.plugins.web.content.controller.ContentPrivacyController)
          org.ametys.web.userinterface.Tag
          org.ametys.web.page.Visibility
          org.ametys.web.linkpage
          org.ametys.web.blankpage
          org.ametys.web.preview
          org.ametys.web.livepreview
          org.ametys.web.page.notify
          org.ametys.web.publication.schedule

          BLOG
          org.ametys.plugins.blog.workflow.Edit
          org.ametys.plugins.blog.Tag

          NEWSLETTER
          org.ametys.newsletter.workflow.Edit

          ODF
          org.ametys.odf.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.odf.content.person.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)
          org.ametys.odf.content.EditCatalog (Ametys.plugins.odf.content.controller.EditCatalogContentController)
          org.ametys.odf.content.PasteContent (Ametys.plugins.odf.content.controller.PasteODFContentController)
          org.ametys.odf.content.program.Edit
          org.ametys.odf.content.container.Edit
          org.ametys.odf.content.courseList.Edit
          org.ametys.odf.content.course.Edit
          org.ametys.odf.content.person.Edit
          org.ametys.odf.content.orgunit.Edit

          ODF Pilotage
          org.ametys.odf.content.Delete (Ametys.plugins.odf.pilotage.controller.DeleteODFPilotageContentController)
          org.ametys.plugins.odfpilotage.mention.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController)
          org.ametys.plugins.odfpilotage.orgunit.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController)
          org.ametys.plugins.odfpilotage.cfvu.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController)
          org.ametys.plugins.odfpilotage.cfvu.mcc.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController)
          org.ametys.odf.content.EditCatalog (Ametys.plugins.odf.pilotage.controller.EditODFPilotageCatalogContentController)
          org.ametys.odf.content.PasteContent (Ametys.plugins.odf.pilotage.controller.PasteODFPilotageContentController)

          ODF Sync
          org.ametys.plugins.odfsync.apogee.SynchronizeProgram
          org.ametys.plugins.odfsync.apogee.SynchronizeSubProgram
          org.ametys.plugins.odfsync.apogee.SynchronizeContainer
          org.ametys.plugins.odfsync.apogee.SynchronizeCourseList
          org.ametys.plugins.odfsync.apogee.SynchronizeCourse
          org.ametys.plugins.odfsync.apogee.SynchronizeOrgUnit
          org.ametys.plugins.odfsync.SynchronizePerson

          Thesaurus
          org.ametys.plugins.thesaurus.EditTerm
          org.ametys.plugins.thesaurus.DeleteTerm

          User Directory
          org.ametys.plugins.userdirectory.orgunit.Delete (Ametys.plugins.cms.content.controller.DeleteContentController)

          Template
          org.ametys.web.workflow.Unpublish
          org.ametys.web.workflow.Archive
          org.ametys.web.workflow.ArchiveMenu (Ametys.plugins.cms.content.controller.ArchiveMenu)
          org.ametys.cms.default.AddContentType (Ametys.plugins.cms.content.controller.ContentTypeGalleryController)
          org.ametys.cms.default.AddMixin (Ametys.plugins.cms.content.controller.MixinGalleryController)
          org.ametys.web.workflow.Restore (Ametys.plugins.cms.content.controller.OldContentController)
          org.ametys.odf.program.workflow.ArchiveMenu (Ametys.plugins.cms.content.controller.ArchiveMenu)

          Raphaël Franchet added a comment - Here is the list of buttons to tests since they are impacted in a way or another  CMS org.ametys.cms.referencetable.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.cms.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.cms.hierarchical.referencetable.contents.DeleteCandidate (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.cms.content.PasteContentValues (Ametys.plugins.cms.content.controller.PasteContentValuesController) org.ametys.cms.content.Edit org.ametys.cms.referencetable.Edit org.ametys.cms.Unlock WEB org.ametys.web.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.web.contentprivacy (Ametys.plugins.web.content.controller.ContentPrivacyController) org.ametys.web.userinterface.Tag org.ametys.web.page.Visibility org.ametys.web.linkpage org.ametys.web.blankpage org.ametys.web.preview org.ametys.web.livepreview org.ametys.web.page.notify org.ametys.web.publication.schedule BLOG org.ametys.plugins.blog.workflow.Edit org.ametys.plugins.blog.Tag NEWSLETTER org.ametys.newsletter.workflow.Edit ODF org.ametys.odf.content.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.odf.content.person.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) org.ametys.odf.content.EditCatalog (Ametys.plugins.odf.content.controller.EditCatalogContentController) org.ametys.odf.content.PasteContent (Ametys.plugins.odf.content.controller.PasteODFContentController) org.ametys.odf.content.program.Edit org.ametys.odf.content.container.Edit org.ametys.odf.content.courseList.Edit org.ametys.odf.content.course.Edit org.ametys.odf.content.person.Edit org.ametys.odf.content.orgunit.Edit ODF Pilotage org.ametys.odf.content.Delete (Ametys.plugins.odf.pilotage.controller.DeleteODFPilotageContentController) org.ametys.plugins.odfpilotage.mention.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController) org.ametys.plugins.odfpilotage.orgunit.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController) org.ametys.plugins.odfpilotage.cfvu.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController) org.ametys.plugins.odfpilotage.cfvu.mcc.Validate (Ametys.plugins.odf.pilotage.controller.PilotageStatusButtonController) org.ametys.odf.content.EditCatalog (Ametys.plugins.odf.pilotage.controller.EditODFPilotageCatalogContentController) org.ametys.odf.content.PasteContent (Ametys.plugins.odf.pilotage.controller.PasteODFPilotageContentController) ODF Sync org.ametys.plugins.odfsync.apogee.SynchronizeProgram org.ametys.plugins.odfsync.apogee.SynchronizeSubProgram org.ametys.plugins.odfsync.apogee.SynchronizeContainer org.ametys.plugins.odfsync.apogee.SynchronizeCourseList org.ametys.plugins.odfsync.apogee.SynchronizeCourse org.ametys.plugins.odfsync.apogee.SynchronizeOrgUnit org.ametys.plugins.odfsync.SynchronizePerson Thesaurus org.ametys.plugins.thesaurus.EditTerm org.ametys.plugins.thesaurus.DeleteTerm User Directory org.ametys.plugins.userdirectory.orgunit.Delete (Ametys.plugins.cms.content.controller.DeleteContentController) Template org.ametys.web.workflow.Unpublish org.ametys.web.workflow.Archive org.ametys.web.workflow.ArchiveMenu (Ametys.plugins.cms.content.controller.ArchiveMenu) org.ametys.cms.default.AddContentType (Ametys.plugins.cms.content.controller.ContentTypeGalleryController) org.ametys.cms.default.AddMixin (Ametys.plugins.cms.content.controller.MixinGalleryController) org.ametys.web.workflow.Restore (Ametys.plugins.cms.content.controller.OldContentController) org.ametys.odf.program.workflow.ArchiveMenu (Ametys.plugins.cms.content.controller.ArchiveMenu)

          List of changes in plugin.xml :

          org.ametys.web.clientsideelement.DeleteContentClientSideElement -> org.ametys.cms.clientsideelement.SmartContentClientSideElement
          org.ametys.web.clientsideelement.TagClientSideElement -> org.ametys.core.ui.StaticClientSideElement
          org.ametys.cms.clientsideelement.ArchiveMenuClientSideElement -> org.ametys.cms.clientsideelement.SmartContentMenu
          org.ametys.web.clientsideelement.PageVisibilityClientSideElement -> org.ametys.core.ui.StaticClientSideElement
          org.ametys.web.clientsideelement.PreviewPageClientSideElement -> org.ametys.core.ui.StaticClientSideElement
          org.ametys.web.clientsideelement.LivePageClientSideElement -> org.ametys.core.ui.StaticClientSideElement
          org.ametys.web.clientsideelement.BlankPageClientSideElement -> org.ametys.core.ui.StaticClientSideElement
          org.ametys.web.clientsideelement.LinkPageClientSideElement -> org.ametys.core.ui.SimpleMenu
          org.ametys.cms.clientsideelement.SmartContentTypesGallery -> org.ametys.cms.clientsideelement.ContentTypesGallery

           

          Special cases :

          org.ametys.cms.clientsideelement.DeleteContentClientSideElement -> org.ametys.cms.clientsideelement.SmartContentClientSideElement (in ODF it becomes Ametys.plugins.odf.content.controller.DeleteCatalogContentController for content)

           

          Ametys.plugins.cms.content.controller.DeleteContentController ->
             Ametys.plugins.web.content.controller.DeleteContentController
          or Ametys.plugins.cms.content.controller.SmartContentController
          or Ametys.plugins.odf.content.controller.DeleteCatalogContentController

          (check the java code to find if it is a org.ametys.cms.clientsideelement.SmartContentClientSideElement or another implementation which still require server code)

           

          Ametys.plugins.web.page.controller.LivePageController -> Ametys.plugins.web.page.controller.PreviewPageController (only if it is a preview and not a live preview. If it is about a live preview, there is no change)

          Pierre Gros (Inactive) added a comment - List of changes in plugin.xml : org.ametys.web.clientsideelement.DeleteContentClientSideElement -> org.ametys.cms.clientsideelement.SmartContentClientSideElement org.ametys.web.clientsideelement.TagClientSideElement -> org.ametys.core.ui.StaticClientSideElement org.ametys.cms.clientsideelement.ArchiveMenuClientSideElement -> org.ametys.cms.clientsideelement.SmartContentMenu org.ametys.web.clientsideelement.PageVisibilityClientSideElement -> org.ametys.core.ui.StaticClientSideElement org.ametys.web.clientsideelement.PreviewPageClientSideElement -> org.ametys.core.ui.StaticClientSideElement org.ametys.web.clientsideelement.LivePageClientSideElement -> org.ametys.core.ui.StaticClientSideElement org.ametys.web.clientsideelement.BlankPageClientSideElement -> org.ametys.core.ui.StaticClientSideElement org.ametys.web.clientsideelement.LinkPageClientSideElement -> org.ametys.core.ui.SimpleMenu org.ametys.cms.clientsideelement.SmartContentTypesGallery -> org.ametys.cms.clientsideelement.ContentTypesGallery   Special cases : org.ametys.cms.clientsideelement.DeleteContentClientSideElement -> org.ametys.cms.clientsideelement.SmartContentClientSideElement (in ODF it becomes Ametys.plugins.odf.content.controller.DeleteCatalogContentController for content)   Ametys.plugins.cms.content.controller.DeleteContentController ->    Ametys.plugins.web.content.controller.DeleteContentController or Ametys.plugins.cms.content.controller.SmartContentController or Ametys.plugins.odf.content.controller.DeleteCatalogContentController (check the java code to find if it is a org.ametys.cms.clientsideelement.SmartContentClientSideElement or another implementation which still require server code)   Ametys.plugins.web.page.controller.LivePageController -> Ametys.plugins.web.page.controller.PreviewPageController (only if it is a preview and not a live preview. If it is about a live preview, there is no change)

            Unassigned Unassigned
            pgros Pierre Gros (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: