Jummp provides a mechanism for model display that has elements common to all model formats, along with a mechanism for format plugins to provide format specific content.
The model display has the name of the model at the top, along with buttons to download the model, update the model and publish it. The buttons are shown based on the access rights available (e.g. the update button is only shown to users with write access to the model). Below this is a tab panel, with three tabs common to the model formats: Overview, Files and History. To facilitate sharing of information, the tabs are bookmarkable, with the URL in the browser updated as each tab is selected. The URL can then be used to navigate to the model with the tab in the URL selected. Figure 1 shows the model display with the Overview tab selected. The overview shows the model description, along with information about the model such as the format and format version, the publication supplied (with a summary and a link to the publication), and a list of users who have submitted revisions of the model.
The files tab shows the model in a tree structure, with the main and additional files shown in separate nodes. Information related to each file can be seen when it is selected. Files with a zip mime type, such as Combine archives, are exploded to allow the user to see detail of files within it. It is also possible to download a particular file from the model, with the icon next to the file name. A preview is fetched for each file. For larger files, only part of the file is fetched in the preview, with the user given the option to retrieve the whole file. The size of the preview is configurable in the properties file, with the parameter
jummp.web.file.preview taking the size in bytes.
The third common tab is to show the model's update history. This contains information about when the model was first added, its current owner, as well as commit messages and dates of each revision of the model, as shown below. The current version is highlighted. It is possible to download a particular revision of the model by clicking on the icon next to the version.
Earlier versions of a model can be requested by specifying the full model+revision identifier (taking the form model.versionNumber. If the user has access to this version of the model, it is displayed in a limited view (the three generic tabs) with a prominent message indicating that this is an older version of the model.
The model display is accessed through the show action of the model controller. This however is only responsible for selecting the controller registered by the plugin for the model format, and forwarding the request to the controller's show action. This controller can then retrieve the appropriate data structures and render the display view. To obtain the functionality common to all models as described above, the display view should use the modelDisplay.gsp layout. The exception to this mechanism is if the user requests an older version of the model, in which case the default view derived from modelDisplay.gsp is rendered, with a disclaimer message (instead of forwarding to any particular plugin).
Most of the structure of the model display pages comes from the modelDisplay.gsp layout. This contains both the common code, as well as hooks for format-specific content to be placed. The controller should ensure that the view is called with the following variables in place: revision - a RevisionTransportCommand representing the latest revision for the model authors - a list of strings stored in the model's authors field * allRevs - a list of RevisionTransportCommand with all the revisions the user has access to.
The modelDisplay.gsp layout imports content from two tags expected from the pages using it. The first tag, "modelspecifictabs" contains the tabs associated with the model format (in addition to the first three). The second tag, "modelspecifictabscontent", contains the content associated with these tabs. The code below shows an example gsp page using the model display layout.
<%-- Use the modelDisplay layout --%> <meta name="layout" content="modelDisplay"/> > <%-- Specify the model specific tabs --%> <content tag="modelspecifictabs"> <li><a href="#tabs-4">Fictional Combine Attribute 1</a></li> <li><a href="#tabs-5">Fictional Combine Attribute 2</a></li> <li><a href="#tabs-6">Fictional Combine Attribute 3</a></li> </content> > <%-- Provide content for each tab, making sure to use the same IDs --%> <content tag="modelspecifictabscontent"> <div id="tabs-4"> <p>tab 4</p> </div> <div id="tabs-5"> <p>tab 5</p> </div> <div id="tabs-6"> <p>tab 6</p> </div> </content>