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-04-02
| Revision History | ||
|---|---|---|
| Revision 0.2 | 2010-02-22 | AD |
|
Update for jAPS 2.0.10 | ||
| Revision 0.1 | 2009-06-19 | AD |
|
First draft | ||
Abstract
Documentation Plugin Share With
Table of Contents
List of Tables
List of Examples
- 4.1. Array of services
Table of Contents
The purpose of this document is to provide a complete description of the Plugin "Share With" (jpsharewith) structure.
This document is intended for those who wish to know the capabilities of the jAPSPlugin "Share With" (jpsharewith) 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:
- jAPS 2.0 and its architecture
Page ModelsandShowletsin jAPS 2.0- SQL language and PostgreSQL
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 target of the Share With Plugin is to create shortcuts, useful to users, that allow sharing jAPS pages with social network.
The module in for of Showlet. Through CMS will be possible to publish Share With - Condividi Con Showlet in the pages Frames.
The Showlet will show in the page a list of links to the social network configurated sites. Each link will be preconfigured with the current URL and title of the page acting as a shortcut for bookmarking and posting in the external sites.
The list of the social networks, so the list of links, is customizable. See chapter Configuration for further informations.
Table 2.1. Summary of characteristics
| Code | Name | Type | Plugin Version | jAPS 2.0 Version |
|---|---|---|---|---|
| jpsharewith | Share With | PurePlugin | 1.1 | 2.0.10, 2.0.8 |
Table of Contents
This Plugin is a PurePlugin, its installation doesn't modify any existing system function already present.
It works through a Showlet.
The package contains:
- Readme
- It is a brief description of the Plugin and its license
- doc
-
The directory
doccontains this document - src/java
-
The directory
src/javacontains the java source files - src/sql
-
The directory
src/sqlcontains theSQLscript to execute in your db - src/webapp
-
The directory
src/webappcontains files to import in your existing project or portal
To perform the installation in a development environment follow this procedure:
Execute the script
src/sql/portScript.sqlin thePortdatabase of your applicationCopy content from
src/webapp/of the package in the directoryWebContentof your project.Copy content from
src/java/main/of the package in the directorysrcof your project.
Js in Page Models
Ensure to have two outputHeadInfo tags in the Page Models (inside tag head) like following code
<wp:outputHeadInfo type="JS">
<script type="text/javascript" src="<wp:resourceURL />static/js/<wp:printHeadInfo />"></script>
</wp:outputHeadInfo>
<wp:outputHeadInfo type="JS_RAW">
<script type="text/javascript">
<wp:printHeadInfo />
</script>
</wp:outputHeadInfo>
Procedure for integration in a Production Environment is similar to Installation in a Development Environment procedure.
The only difference is to copy src/webapp/ from the package in the root of deployied portal.
From now we will use the name myportal when referring to your deployed jAPS.
Execute
src/sql/portScript.sqlSQL script in yourPortdatabase (example myportalPort)Copy content of
src/webapp/of the provided package intomyportal/directory (example/usr/local/tomcat/webapps/myportal/)If necessary reload jAPS configuration from CMS or restart the webapp
Js in Page Models
Ensure to have two outputHeadInfo tags in the Page Models (inside tag head) like following code
<wp:outputHeadInfo type="JS">
<script type="text/javascript" src="<wp:resourceURL />static/js/<wp:printHeadInfo />"></script>
</wp:outputHeadInfo>
<wp:outputHeadInfo type="JS_RAW">
<script type="text/javascript">
<wp:printHeadInfo />
</script>
</wp:outputHeadInfo>
It is possible to customize the list of social network.
Edit file WebContent/resources/plugins/jpsharewith/static/js/jpsharewith_buttons.js from your Eclipse project (or myportal/resources/plugins/jpsharewith/static/js/jpsharewith_buttons.js if working in already deployed webapp.
The plugin requires a JavaScript array of objects and every object with three properties: title, link e image.
- title
- It's the name or the title of the external service. Example "Google Bookmarks" or "Facebook".
- link
-
It's the URL for needed for sharing the current page. You must parametrize the URL using two special characters:
$TITLE$and$URL$. $TITLE$ will return the title of page user is visiting and $URL$ will return the full url of the page. - image
It's the name of the image file placed in the title left side.
You have to put image files in
WebContent/resources/plugins/jpsharewith/static/imgdirectory of your Eclipse project (ormyportal/resources/plugins/jpsharewith/static/imgif working with a deployed webapp)
It's possible to add items to the list simply adding record to the JavaScript array. Every record is surrounded by curly brackets. Please see the following example.
Example 4.1. Array of services
var jpsharewith_buttons = [
{service1},
{service2},
{service3}
];
Replace every service with a structure like this:
'title' : 'TITLE OF THE SERVICE',
'link' : 'http://www.example.com/share?urlToShare=§URL§&titleToShare=§TITLE§',
'image' : 'example.png'
The resulting code is:
var jpsharewith_buttons = [
{
'title' : 'Service 1',
'link' : 'http://www.site1.com/share?urlToShare=§URL§&titleToShare=§TITLE§',
'image' : 'serv1.png'
},
{
'title' : 'Service 2',
'link' : 'http://www.site2.net/share?urlToShare=§URL§&titleToShare=§TITLE§',
'image' : 'serv2.png'
},
{
'title' : 'Service 3',
'link' : 'http://www.site3.net/share?urlToShare=§URL§&titleToShare=§TITLE§',
'image' : 'serv3.png'
}
];
