Do It The jAPS Way
Copyright © 2010 Tzente s.r.l.
Legal Notice
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the Appendix entitled "GNU Free Documentation License".
2010-02-24
| Revision History | ||
|---|---|---|
| Revision 0.8 | 2010-02-24 | GC |
|
Revision for jAPS 2.0.10 version, and plugin 1.2 version. | ||
| Revision 0.7 | 2009-10-13 | GC |
|
Revision for jAPS 2.0.8 version, and plugin 1.1 version. | ||
| Revision 0.6 | 2009-09-14 | GC |
|
Pre-release revision. | ||
| Revision 0.5 | 2009-07-06 | RB |
|
Change chapters sequences | ||
| Revision 0.4 | 2009-07-01 | RB |
|
inserted table Characteristics summary as request by the standard documentation | ||
| Revision 0.3 | 2009-06-22 | RB |
|
Use of filename tag to describe correct folder name and use of myportal in place of WEBAPPNAME | ||
| Revision 0.2 | 2009-03-27 | RB |
|
First Docbook Version | ||
Abstract
The purpose of this document is to provide a complete description of the Plugin "jpcalendar" structure.
Table of Contents
List of Tables
List of Examples
Table of Contents
The purpose of this document is to provide a complete description of the Plugin "jpcalendar" structure.
This document is intended for those who wish to know the capabilities of the jAPSPlugin "jpcalendar" and is considering the possible integration into a running production environment or in its Development Environment (IDE Eclipse Project).
The document is addressed to both System Administrators and java Developers.
In order to take maximum advantage from the present document, it is necessary to have basic knowledge about: the Java platform, the Eclipse IDE, the Apache Tomcat servlet engine, the PosgreSQL DBMS.
Additional informations may be obtained through the following mailing-lists:
<japs-devs@lists.sourceforge.net>, focused on developers<japs-users@lists.sourceforge.net>, focused on final users
Is it also possible to refer to the documentation found in the:
Table of Contents
The Plugin jpcalendar displays a monthly calendar. The days of the month are displayed with the following criteria:
today's date is displayed in bold format
the days without events are shown in normal format
the days with events are displayed in underlined format
These days are a link to the page, responsible to display the events of the day selected.
Table 2.1. Characteristics summary
| Code | Name | Type | Plugin version | jAPS 2.0 version |
|---|---|---|---|---|
| jpcalendar | Calendar | PurePlugin | 1.2 | 2.0.10, 2.0.8 |
| jpcalendar | Calendar | PurePlugin | 1.1 | 2.0.8 |
Table of Contents
The plugin has the characteristic of PurePlugin, its installation does not change any functionality in the system. The module presents a set of interfaces for the Front-End, payable through Showlet External Framework. These interfaces do not contain any graphical element. In this way it's possible to decorate it in any specific instance of jAPS 2.0.
The package contains:
- Readme
- It is a brief description of the Plugin and its license
- doc
-
The directory
doccontains this document - src/sql
-
The directory
src/sqlcontainsSQLscript to execute in your db - src/java
-
The directory
src/javacontains thejavacode and the jUnit test - src/webapp
-
The directory
src/webappcontains files to import in your existing project or portal
The following activities are to be carried out after the stop of the Web Application.
To install the plugin in a production Web Application based on jAPS 2.0 and declared compatible with the plugin.
Perform the following steps (From this point on, we will assume that your new portal is called myportal):
Copy the contents of the folder
src/webapp/WEB-INF/libof the package as supplied within the foldermyportal/WebContent/WEB-INF/libin production.Copy the contents of the folder
src/webapp/WEB-INF/pluginsof the package as supplied within the foldermyportal/WebContent/WEB-INF/pluginsin production.After configuration of params CONTENT_TYPE_ID, NOME_ATTRIBUTO_DATA_INIZIO e NOME_ATTRIBUTO_DATA_FINE and verified valued for version (it must be equal to configVersion of systemParams, the script is designed assuming the version production), perform tasks detailed in the file portScript.sql (present in the folder
src/sql) in the db port , in a standard configuration the db has namemyportalPort.
To install the plugin in an Eclipse project based on jAPS 2.0 and declared compatible with the plugin,
Perform the following steps (From this point on, we will assume that your new project is called myproject):
Copy the contents of the folder
src/webapp/WEB-INF/pluginsof the package as supplied within the foldermyproject/WebContent/WEB-INF/plugins/.After configuration of params CONTENT_TYPE_ID, NOME_ATTRIBUTO_DATA_INIZIO e NOME_ATTRIBUTO_DATA_FINE and verified valued for version (it must be equal to configVersion of systemParams, the script is designed assuming the version production), perform tasks detailed in the file portScript.sql (present in the folder
src/sql) in the db port , in a standard configuration the db has namemyprojectPort.Perform tasks detailed in the file
portTestScript.sql(present in the foldersrc/sql) in the test db port, in a standard configuration the db has namemyprojecttestPort.Copy the contents of the folder
src/java/main/com/agiletec/plugins/in the foldermyproject/src/com/agiletec/plugins/, create the directorypluginsif not exists.Copy the contents of the folder
src/java/test/test/com/agiletec/plugins/in the foldermyproject/src/test/com/agiletec/plugins/, create the directorypluginsif not exists.
Table of Contents
In the next paragraphs we will see the steps for the plugin configuration.
Configure a contentType (DB portalNamePort, table sysconfig, item 'contentTypes') that contains 2 attributes of type Date, for the start date and the end date.
Modify the following query in relation with the inserted contentType (see previous paragraph) and execute it in the db portalNamePort, is possible to modify the config directly on the database if already loaded on it
INSERT INTO sysconfig (version, item, descr, config)
VALUES ('production', 'jpcalendar_Config', 'Configurazione Calendario',
'<calendarConfig>
<contentType code="<CONTENT_TYPE_ID>" />
<dateAttributes>
<start name="<START_DATE_ATTRIBUTE>" />
<end name="<END_DATE_ATTRIBUTE>" />
</dateAttributes>
</calendarConfig>');
Example 4.1. Configuration example
Suppose that you have inside the portal the following contentType
<contenttype typecode="EVN" typedescr="Evento" viewpage="newsview" listmodel="12" defaultmodel="2"> <attributes> <attribute name="DataInizio" attributetype="Date" indexingtype="text" searcheable="true" required="true" /> <attribute name="DataFine" attributetype="Date" indexingtype="text" searcheable="true" required="true" /> <attribute name="Luogo" attributetype="Longtext" indexingtype="text" searcheable="true"/> <attribute name="Oggetto" attributetype="Hypertext" indexingtype="text" searcheable="true"/> <attribute name="CorpoTesto" attributetype="Hypertext" indexingtype="text" searcheable="true"/> <attribute name="Immagine" attributetype="Image"/> <list name="ListaLinkCorrelati" attributetype="Monolist" nestedtype="Link"/> <list name="ListaAllegati" attributetype="Monolist" aaaa nestedtype="Attach"/> </attributes> </contenttype>
The query will be:
INSERT INTO sysconfig (version, item, descr, config)
VALUES ('production', 'jpcalendar_Config', 'Configurazione Calendario',
'<calendarConfig>
<contentType code="EVN" />
<dateAttributes>
<start name="DataInizio" />
<end name="DataFine" />
</dateAttributes>
</calendarConfig>');
in the table showletcatalog in the db portalNamePort, create the showlet records.
INSERT INTO showletcatalog(
code, titles, parameters, plugincode, parenttypecode, defaultconfig, locked)
VALUES ('jpcalendar_calendar', '<?xml version="1.0" encoding="UTF-8"?>
<properties>
<property key="en">Calendar</property>
<property key="it">Calendario</property>
</properties>', NULL, 'jpcalendar', NULL, NULL, 1);
INSERT INTO showletcatalog(
code, titles, parameters, plugincode, parenttypecode, defaultconfig, locked)
VALUES ('jpcalendar_dailyEvents', '<?xml version="1.0" encoding="UTF-8"?>
<properties>
<property key="en">Events of the Day</property>
<property key="it">Eventi del giorno</property>
</properties>', NULL, 'jpcalendar', NULL, NULL, 1);
To use the jpcalendar plugin you need to create a page containing the showlet jpcalendar_calendar and one other page containing the showlet jpcalendar_dailyEvents. The showlet jpcalendar_calendar need to be suitably modified:
Example 4.2. Example of changing the showlet jpcalendar_calendar.jsp
in the original jpcalendar_calendar.jsp, change
<c:if test="${giorno.hasEvents}">
<a href="<wp:url page="codice_pagina_eventi_del_giorno" >...
With:
<c:if test="${giorno.hasEvents}"><a href="<wp:url page="listaEventi" >
The page listaEventi must contain the showlet Events of the Day (jpcalendar_dailyEvents.jsp).
It's possibly to customize the label used by the tag “wp:i18n”.
In the row
<wp:content contentId="${content}" modelId="XX"/>
of the page Events of the Day configure the proper modelId (XX) for the list view of events.
