Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3936

Newly created messages are not be stored in proper date folder

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Neutral
    • None
    • 6.2.11
    • messages app

    Description

      Currently messages are organized in the messages workspace by username. So each username has an entry in the workspace. Under the username node there can be several message nodes all organized at the same level (see messages.png attached). This creates a performance problem when a user accumulates too many messages under a single username node.

      This issue is similar to one we had with tasks (see TASKMGMT-22).

      Workaround
      Use a script

      import info.magnolia.context.MgnlContext;
      import javax.jcr.Session;
      import javax.jcr.Node;
      import javax.jcr.NodeIterator;
       
      def removeMessages(username) {
          try {
              Session session = MgnlContext.getJCRSession("messages");
              path = "/" + username;
              Node usertree = session.getNode(path);
              NodeIterator childrenIterator = usertree.getNodes();
       
              while (childrenIterator.hasNext()) {
                  Node node = childrenIterator.nextNode();
                  path = node.getPath();
                  println "about to remove ${path} item";
                  session.removeItem(path);             
              }
              session.save();
              println "messages of ${username} removed";
       
          } catch (Exception e) {
              println e;
          }
      }
       
      //example of usage
      removeMessages("superuser");
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                rgange Richard Gange
                Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Task DoD