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

Enhance template availability call and usage in pages app

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 5.2.3
    • pages app
    • None

      Currently TemplateSelectorFieldFactory and TemplateTypeRestrictionDropConstraint have to create a tmp child node in order to check the template availability.

         // creates a temporary node underneath the parent to overcome a restriction in template availability,
         // see MGNLSTK-1185
         try {
            Node tempNode = associatedNode.addNode("temp", NodeTypes.Page.NAME);
            templates = templateAssignment.getAvailableTemplates(tempNode);
            associatedNode.getSession().removeItem(tempNode.getPath());
         } catch (RepositoryException e) {
            log.error("Could not create temporary node to get available templates.", e);
         }
      

      This behavior may easily changed by:

      • expose in TemplateDefinitionAssignment a new method isTemplateAssignableFor(Node targetNode, TemplateDefinition template)
      • Add implementation in MetaDataBasedTemplateDefinitionAssignment
      • Review the implementation of TemplateAvailability in order to add utility methods
      • Use this in TemplateTypeRestrictionDropConstraint and TemplateSelectorFieldFactory.

        Acceptance criteria

              Unassigned Unassigned
              ehechinger Eric Hechinger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR