Volet | ||
---|---|---|
| ||
Esup Lecture Portlet - Configuration Guide
|
Sommaire | ||||||
---|---|---|---|---|---|---|
|
Configuration
...
Technical configuration
Adapt to your environment these configuration files:
...
- id,
- name,
- urlCategory : url to get back a xml category file on a remote server
- trustCategory ( yes | no ) : If it is "yes", visibility rights used are those of remote category and sources. If it is "no", visibility rights on category and sources used are those of this category profile, defined in visibility element.
- access ( public | cas ) : access of the category is public or cas because it needs CAS proxy ticket for authentication (for more information about CAS configuration see Configuration en déploiement portlet of the ESUP-Commons documentation and CAS en mode portletof the part Utilisation de CAS (French) of the of ESUP-Lecture documentation)
- ttl (seconds) : time to live of the remote category and its sources
- ttl (seconds) : time to live of the remote category and its sources
- timeout (milliseconds) : time trying to get the category
- visibility : define group visibility for category referenced by this category profile. It is used only if trustCategory is set to "no"
- userCanMarkRead (yes | no) : If "yes", users can mark items of the category as read ot not read. Yes by default*
...
Bloc de code |
---|
<visibility> <allowed/> <autoSubscribed/> <obliged> <group name="local.0"/> <group .../> ... <regular attribute="sn" value="user" /> <regular .../> ... </obliged> </visibility> <regex attribute="isMemberOf" pattern="[ a-zA-Z0-9:]*:Eleves" /> <regex .../> ... </obliged> </visibility> |
In this elementIn this element, you define 3 groups of visibility;
...
- group : user is in the portal group referenced by attribute name, in the example : user in in group "local.0" - see "portlet.xml" section.
- regular : user check regular, in the example : user value of portal attribute "sn" is "user" - see "portlet.xml" section.
<category>.xml
described by dtd category.dtd, provided by remote server, requested by urlCategory of esup-lecture.xml
element category
- regex : user check a java regular expression from a portal user attribute, in the example user value of portal attribute "isMemberOf" is matching the pattern corresponding of all members of a group when the name contains these characters "[ a-zA-Z0-9:]" 0 or n times and when the name finish by ":Eleves" - see "portlet.xml" section.
<category>.xml
described by dtd category.dtd, provided by remote server, requested by urlCategory of esup-lecture.xml
element category
Bloc de code |
---|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE category SYSTEM "category.dtd">
<category name="Différents RSS">
<description>Très belle description !</description>
<sourceProfiles>
<sourceProfile> ... </sourceProfiles>
<sourceProfile> |
Bloc de code |
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE category SYSTEM "category.dtd"> <category name="Différents RSS"> <description>Très belle description !</description> <sourceProfiles> <sourceProfile> ... </sourceProfiles> <sourceProfile> ... </sourceProfiles> ... </sourceProfiles> <visibility> ... </visibility> sourceProfiles> ... </category> sourceProfiles> <visibility> ... </visibility> </category> |
A category A category has a name and a description (displayed on interface), and
...
- access ( public | cas ) : access of the source is public or cas because it needs CAS proxy ticket for authentication (for more information about CAS configuration see Configuration en déploiement portlet of the ESUP-Commons documentation and CAS en mode portletof the part Utilisation de CAS (French) of the of ESUP-Lecture documentation)
- specificUserContent ( yes | no) : if it is "yes", source content is specific to user. If it is "no", source content is the same for every users (If your configure with "yes" then application assumes that content can be deferent for each user (may be because of specific content due to profiling according to authentication). In this case application doesn't use any cache for the source. So be careful before use "yes" for this property.)
- url : url to get xml stream of the source
- timeout (milliseconds) : Time trying to get the source. Parent category timeout is used is it is not defined here
- visibility : define group visibility for source refered by this source profile. It is used only if trustCategory attribute of referencing categoryProfile is set to "yes" else visibility category profile is used - optional -
Remarque Be carefull to manage unique id for every sources profiles defined in categories : application does not yet manage it.
...
A source is composed of a list of items that will be parsed to be all displayed on interface in web page. A mapping is used to define a xsltFile and itemXPath to apply on a sourceitems selected by itemXPath. Sometimes, to define itemXPath, namespaces definition are required.
...
Bloc de code |
---|
<mapping sourceURL="http://info.cri.univ-rennes1.fr/rss/rss.php" xsltFile="http://partages.univ-rennes1.fr/files/partages/Services/CRI/SI/conf_lecture_gwe_ray/stylesheet01.xsl" itemXPath="/rdf:RDF/default:item"> <XPathNameSpace prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> <XPathNameSpace prefix="default" uri="http://purl.org/rss/1.0/" /> </mapping> |
Explanations:*
- xsltFile : url of the xslt file used to parse an item
- mobileXsltFile : url of the xslt file used to parse an item in mobile mode - optionnal. If not present xsltFile is also used in mobile mode.
- itemXPath : xpath expression to locate an item in the xml stream source
- element XPathNameSpace : used by itemXPath definition - optionnal
- In order to define which mapping is applied to a particular source some attributes are used (by priority order):
- sourceURL : url
- sourceURL : url of the source, key entry of this mapping
- dtd : dtd
- of the source, key entry of this mapping
- xmlns : xml namespace of the source, key entry of this mapping
- (example: sourceURL="http://info.cri.univ-rennes1.fr/rss/rss.php")
- dtd : dtd of the source
- xmlType : xmlType of the source
- xmlns : xml namespace of the source
- rootElement : rootElement of the source
Priority to find xslt informations on key entry of a mapping are : sourceURL, DTD, xmlType, xmlns and finally rootElement.
...
Bloc de code |
---|
<bean id="authenticationService" class="org.esupportail.commons.services.authentication.PortalOrCasFilterAuthenticator"> <description>The name of the Portal attribute that holds the uid of users, as set in portlet.xml.</description> <property name="uidPortalAttribute" value="uid" /> </bean> |
Servlet mode
Introduction
You can use esup-lecture in servlet mode. In this mode you don't have the notion of Portlet preference and you can't define more than one context in your esup-lecture.xml file. In servlet mode this context must have an id with value "default" ("context" before 1.1.0 version). Example:
Bloc de code |
---|
<context name="Simple context" id="default">
<description>Simple context</description>
<refCategoryProfile refId="rss" />
</context>
|
To used serlvet mode you just have to adapt buil.properties with deploy.type=servlet before using ant deploy.
Authentication
In servlet mode you can't used your portal for authentication. If you use CAS you don't have to modify the auth.xml file but you have to adapt CAS parameters ti suit your own CAS server. For this, you will find properties :
- tomcat.host, tomcat.port in build.properties file.
- casService.bean (it MUST be valued at servletCasService), ccasService.url, casService.proxyCallbackUrl in properties/config.properties file.
Remarque With these properties ant deploy will automatically make appropriate changes in your web.xml file.
Authorization
Authorizations defined in your esup-lecture.xml file or provided by news portlet are based in attributes or groups issued form uPortal. Of course, in servlet mode you don't have access to these informations naturally. So, you have to install (if not yet present in your uPortal distribution) esup-portal-ws (see http://sourcesup.cru.fr/projects/esup-portal-ws/).
Remarque |
---|
esup-portal-ws is now included in all 2.6-esup-2.0 and newer versions of esup-portail packaging of uPortal |
After, you have to configure esup-lecture to used this Web Service. For this, you have portalService.url, portalService.testUserId, portalService.testGroupId, portalService.testGroupName properties in the config.properties file. Finally, you can test the Web Service with ant test-portal.
Guest mode
If want to have a guest mode for esup-lecture in servlet mode you have to define a new context in your application server. You have to deploy a new esup-lecture in this new context.
Remarque |
---|
In this context you do not use CAS authentication mechanism |