Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-649

Mechanism for inserting custom content in pre-existing code

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 4.2-milestone-3
    • 4.2-milestone-2
    • UI Extension
    • None

    Description

      I've been trying to figure out a mechanism for allowing XWiki Applications to alter the content of existing interface elements, like adding a new tab in the admin mode, or a new page in the global preferences, or new menu items, and I think that the best solution is to use an Overlay class. Here's how it would work (inspired by the awesome XUL model):

      • an overlay object registers a piece of content that should be added inside a container, identified by an id.
      • the added content can be inserter either at the start or at the end of the container, with an optional neighbor component (e.g.: inside #globalmenu, at the end, if possible before #watchmenuentry). If possible means that if that component exists, respect the required ordering, but if doesn't exist, don't fail.
      • we provide two functions, onStartId and onEndId, which automatically detect what are the components that must be also added
      • each application provides such overlay objects in a document inside the .xar archive

      This makes it easy to extend some content, without actually modifying it, but requires massive changes in the existing template to replace <div id=..."> elements with onStartId() calls.

      Attachments

        Issue Links

          Activity

            People

              jvdrean Jean-Vincent Drean
              sdumitriu Sergiu Dumitriu
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: