How does it work?

From the perspective of how the Share application is built on Spring-Surf, the Records Management Console presents an interesting study. Maybe it's not too surprising, but the console re-uses much of the same framework code that is also used in the Administration Console for managing Users, Groups, and Application parameters.

The Management Console page

Clicking on the link in the Records Management Console dashlet causes the following page URL to be displayed: http://localhost:8080/share/page/console/rm-console/. One thing to note with this URL is that it does not reference the rm site as part of it.

The URL format for a Console page is defined in the tomcatwebappsshareWEB-INFclassesalfrescoshare-config.xml file:

<uri-templates>
<uri-template id="sitedashboardpage">/site/{site}/dashboard</uri- template>
<uri-template id="sitepage">/site/{site}/{pageid}</uri-template>
<uri-template id="userdashboardpage">/user/{userid}/dashboard</uri- template>
<uri-template id="userpage">/user/{userid}/{pageid}</uri-template>
<uri-template id="userprofilepage">/user/{userid}/profile</uri- template>
<uri-template id="consolepage">/console/{pageid}/{toolid}</uri- template>
</uri-templates>

Here we see that the uri-template ID called consolepage is defined and that it matches the signature of the URL page for the Records Management Console.

In this case, the pageid corresponds to rm-console. Armed with that information, we can find the page descriptor file tomcatwebappsshareWEB-INFclassesalfrescosite-datapages m-console.xml:

<page>
<title>Records Management Console</title>
<title-id>page.rmConsole.title</title-id>
<description>Records Management Administration Console</description>
<description-id>page.rmConsole.description</description-id>
<template-instance>console</template-instance>
<authentication>user</authentication>
</page>

Here's where we see some interesting information. The template-instance used by the Records Management Console is console, the same as what is used for the Administration Console. In the case of the URL used for the Administration Console, the pageid is admin-console.

Rendering of Management Console tools

When the Management Console page is rendered, there is a list of eight tools that display in the left navigation area.

The Console JavaScript file tomcatwebappsshareWEB-INFclasses emplatesorgalfrescoconsole.js collects the information about the available tools for the page and saves the information into the set of known page context data.

The Records Management Console family of components can all be found in the directory tomcatwebappsshareWEB-INFclassesalfrescosite-webscriptsorgalfrescocomponentsconsole. Components for the Administration Console are also located in that same directory:

Tool

Tool ID

Descriptor file name

Unique URL identifer

Audit

rm-audit

rm-audit.get.desc.xml

/components/console/rm-audit

Custom Metadata

rm-custom-metadata

rm-custom-metadata.get.desc.xml

/components/console/rm-custom-metadata

Define Roles

rm-define-roles

rm-define-roles.get.desc.xml

/components/console/rm-define-roles

Email Mappings

rm-email-mappings

rm-email-mappings.get.desc.xml

/components/console/rm-email-mappings

Events

rm-events

rm-events.get.desc.xml

/components/console/rm-events

List of Values

rm-list-of-values

rm-list-of-values.get.desc.xml

/components/console/rm-list-of-values

Relationships

rm-references

rm-references.get.desc.xml

/components/console/rm-references

User Rights Report

rm-userrights

rm-userrights.get.desc.xml

/components/console/rm-userrights

Each of the descriptor files identifies the component as belonging to the rm-console family. The unique URL identifier for the component is also listed. The unique URLs are shown in the last column of the table above.

For example, consider the descriptor file for the Custom Metadata component. This file includes the name, description, URL, and family identifier. The descriptor files for the other rm-console components provide similar information:

<webscript>
<shortname>Admin Console User Rights Report</shortname>
<description>Administration Console - User Rights Report Tool</description>
<url>/components/console/rm-userrights</url>
<family>rm-console</family>
</webscript>

The Console page layout

Now let's briefly look at the layout of the Management Console page. Since both the Administration and Records Management share the same template-instances, the layout of the page is the same for both of these.

The FreeMarker template layout file is tomcatwebappsshareWEB-INFclassesalfresco emplatesorgalfrescoconsole.ftl:

<@templateBody>
<div id="alf-hd">
<@region id="header" scope="global" protected="true" />
<@region id="title" scope="page" protected="true" />
</div>
<div id="bd">
<div class="yui-t1" id="divConsoleWrapper">
<div id="yui-main">
<div class="yui-b" id="divConsoleMain">
<@region id="tool" scope="page" protected="true" />
</div>
</div>
<div class="yui-b" id="divConsoleTools">
<@region id="tools" scope="template" protected="true" />
</div>
</div>
</div>
</@>
<@templateFooter>
<div id="alf-ft">
<@region id="footer" scope="global" protected="true" />
</div>
</@>

Here we see the standard header and title regions at the top and footer at the bottom that we've seen for web pages that we've analyzed in earlier chapters. Note that the scope of the tools region is for the template, which means that it will be common across all Records Management Console pages, no matter which tool is being viewed, whereas, the scope of the tool region is just for a single page.

The next screenshot shows the Management Console with the names of the regions superimposed over it. As you can see, the layout is quite simple. The tool region is occupied by a single component that specializes in performing a single administrative task:

The Console page layout
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.10.2