Modules
All available module documentations:
Module Documentation Layout
Each module documentation has following layout:
- Introduction: Basic definitions of the modules (what is a mainEntry, what is an Entry). Many modules have mainEntries (nodes) and Entries - (eg. forum/entries, folder/document,..)
- Parameter prefix: The parameter prefix of the module. This prefix is necessary for the request parameters. A prefix of for example "Guestbook" means that the parameter "id" must have the name "Guestbook_id" in the request parameters.
- Functions
- Description of the function
- Authorities checked
- Parameter (including their java subclass - see Below)
- Important elements: Important elements of the xml-tree - describing all elements which are not easy to understand
- JSP: An example jsp
- XSL: An example xsl
- Display functions (get): Each module normally has several get-functions (getEntry, getMainEntry, getEntries,...).
Most get-functions don't need parameters. Some take "id" / "mainId" (the id of the entry/mainentry to show) or "parent" (the id of the parent - all childs should be shown). The return-tree is not standardized and differs completely from module to module and from get-function to get-function. Four get-functions are standardized in name:
- getMainEntry / getMainEntries: get one / more MainEntries
- getEntry / getEntries get one / more Entries
- Other functions
Standard Return Trees
All not display functions (like modifyEntry, deleteEntry, createEntry,..) have standardized return-trees
returntree - error
<MODULNAME> <functionName error="ERRORNUMBER" success="false"> <FIELD>fieldname</FIELD> </functionName> </MODULNAME>
Example: Forum
<FORUM> <createEntry error="27" success="false"> <FIELD>create</FIELD> </createEntry> </FORUM>
return tree success
<MODULNAME> <funktionName success="true" id="ID"/> </MODULNAME>
Example: Forum
<FORUM> <createEntry success="true" id="45234509435"/> </FORUM>
execution of module function
TagLib
Using taglib you can call a function by using
Login: <corinis:module name="Login" xsl="inline" function="createEntry"/>
get document content: <corinis:module app="corinis" name="CmsLifeFileManager" xsl="show.xsl" function="getEntry"> <cms> <id>0</id> </cms> </corinis:module>
Here is a code snippet for login/logout:
<corinis:module name="Login" xsl="inline" function="deleteEntry" /> <corinis:module name="Login" xsl="inline" function="createEntry" /> <corinis:function name="if" field="online" value="false"> <a href="login.jsp">Login</a> </corinis:function> <corinis:function name="if" field="online" value="true"> <a title="logout" href="/?Login_deleteEntry=true"><corinis:core name="name"/></a> </corinis:function>
Java
function parameter
Almost every function has some required/optional parameters. They are described in the parameter section of each function.
Example (forum): Required
| forumEntriesView.id | The id of the entry to be modified |
| forumEntriesView.modifyEntry | Required to perform the function |
Optional
| forumEntriesView.title | The title of the entry |
| forumEntriesView.message | posting / description |
| forumEntriesView.locked | locked (T) or unlocked (F) |
| forumEntriesView.sticky | a sticky value |
From this information you can create the form parameters and the real variable names, when trying to access them through java directly.
| viewname.variablename | description |
| forumEntriesView.id | The id of the entry to be modified |
if you want to set it using a form (since this example if from the forum, we know the parmameter prefix is Forum):
<form method="post"> <input name="Forum_id"> ... </form>
You can also use java to set the variable directly
Forum f = (Forum)core.getModule(Forum.class); f.forumEntriesView.id = 123412341234; ...
