learning to drive with a channel archive mark boyd software engineer/architect [email protected]
Post on 19-Dec-2015
220 views
TRANSCRIPT
![Page 2: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/2.jpg)
2
What We Will Cover
What is a CAR and how is it installed?
What is the Development Impact?
How do you build them?
What new models are coming?
Questions?
![Page 3: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/3.jpg)
3
What is a CAR? CAR = Channel Archive
Jar file format
Extension of “.car”. Is case sensitive.
Contains all channel artifacts used by the channel.
Contained files should be in package relative sub-directories.
• Class files
• Images
• Stylesheets
• Stylesheet Lists
• XML files
• Properties files
• Other resources
![Page 4: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/4.jpg)
4
A Look Inside
jar tf carlot.car
<META-INF/…>
<Directories….>
com/sct/pipeline/uportal/channels/carlot/car.jpg
com/sct/pipeline/uportal/channels/carlot/Channel.java
com/sct/pipeline/uportal/channels/carlot/channel.jpg
com/sct/pipeline/uportal/channels/carlot/channel.ssl
com/sct/pipeline/uportal/channels/carlot/stylesheets/channel.xsl
com/sct/pipeline/uportal/channels/carlot/Channel.class
![Page 5: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/5.jpg)
5
Non-CAR Channel Installation
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheets and Stylesheet lists
Classes
Configuration files
classes
Note: package relative sub-directories not shown
Images
![Page 6: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/6.jpg)
6
Non-CAR Channel Installation
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheets and Stylesheet lists
Classes
Configuration files
classes
Note: package relative sub-directories not shown
Images
![Page 7: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/7.jpg)
7
Non-CAR Channel Installation
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheets and Stylesheet lists
Classes
Configuration files
classes
Note: package relative sub-directories not shown
Images
![Page 8: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/8.jpg)
8
Non-CAR Channel Installation
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheets and Stylesheet lists
Classes
Configuration files
classes
Note: package relative sub-directories not shown
Images
![Page 9: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/9.jpg)
9
Channel Installation with CARs(non-warfile deployment)
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheets and Stylesheet lists
Classes
classescars
Images
MyChannel.car Configuration files
![Page 10: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/10.jpg)
10
Channel Installation with CARs(deployed as warfile or custom car location required)
SomeDirPath
Stylesheets and Stylesheet lists
Classes
Configuration files
cars
Images
MyChannel.car
protal.properties
org.jasig.portal.car.CarResources.directory=SomeDirPath/cars
![Page 11: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/11.jpg)
11
Channel Installation with CARs
1) CARs can be located in any sub-directory of the “cars” directory.
2) The name of a car has no impact on its internal classes and artifacts nor on the publishing or subscribing processes.
![Page 12: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/12.jpg)
12
What We Will Cover
What is a CAR and how is it installed?
What is the Development Impact?
How do you build them?
What new models are coming?
Questions?
![Page 13: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/13.jpg)
13
<xsl:variable name="mediaPath">media/org/jasig/portal/channels/Cbookmarks</xsl:variable>
Non-CAR Images Approach
uPortal Root Directory
WEB-INF
media
stylesheets
Stylesheet
classes
Tight Coupling
Installation Dependant
…/...gif
<img src="{$mediaPath}/folder_delete.gif“……
![Page 14: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/14.jpg)
14
CAR Images Approach(New functions)
ChannelRuntimeData.java:
getBaseMediaURL( Object aChannelObject )
getBaseMediaURL( Class aChannelClass )
getBaseMediaURL( String resourcePath )
Returns: “media/” if not deployed as a CAR
Base URL for extracting resource from CAR. Resource path internal to jar should be appended.
Path of resource internal to CAR
Channel object or class loaded from CAR
Note: only supports gif, jpeg, jpg, jpe in 2.1.x.
![Page 15: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/15.jpg)
15
CAR Images Approach(Channel Java Source)
if ( mediaBase == null ) {
mediaBase = runtimeData.getBaseMediaURL( this );
String cls = getClass().getName();
String pkg = cls.substring( 0, cls.lastIndexOf( '.' ) );
mediaBase = mediaBase + pkg.replace( '.', '/' ) + '/';
} // ie: mediaBase = base + com/sct/pipeline/uportal/channels/carlot/
…
XSLT xslt = new XSLT (this);
xslt.setStylesheetParameter( "mediaPath", mediaBase );
![Page 16: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/16.jpg)
16
CAR Images Approach(Channel Stylesheet)
Stylesheet
<xsl:stylesheet version="1.0“ …>
<img src="{$mediaPath}/car.jpg“……
<xsl:param name="mediaPath"></xsl:param>
![Page 17: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/17.jpg)
17
Car Images Approach(Carlot Channel)
Media Base URL = “tag.idempotent.worker.carRsrc.target.n43.uP?carRsrc=“
![Page 18: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/18.jpg)
18
CAR Images Approach
Stylesheet
<xsl:stylesheet version="1.0“ …>
<img src="{$mediaPath}/car.jpg“……
<xsl:param name="mediaPath"></xsl:param>
Java
Source
Code
Lighter Coupling
Internal To CAR
Installation Independant
![Page 19: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/19.jpg)
19
Stylesheet List Aspects
<?xml version="1.0"?>
<?xml-stylesheet title="CarListStyleSheet" href="stylesheets/channel.xsl“ …>
<?xml-stylesheet title="CarListStyleSheet" href="com/sct/pipeline/uportal/channels/carlot/stylesheets/channel.xsl" …>
Carlot’s channel.ssl stylesheet list file.
Note: Use fully qualified jar file resource paths or be certain that the path used is relative to calling document.
![Page 20: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/20.jpg)
20
Stylesheet Aspects
<xsl:variable name="palette" select="document('v2colors.xml')/*/color"/>
<xsl:import href="bookmark_tree_html.xsl" />
<xsl:include href=“com/sct/uportal/channels/accnt/edits.xsl" />
Include, Import, and document follow similar guideline.
![Page 21: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/21.jpg)
21
What We Will Cover
What is a CAR and how is it installed?
What is the Development Impact?
How do you build them?
What new models are coming?
Questions?
![Page 22: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/22.jpg)
22
How Do You Build Them?
Short Answer: jar cf fileName.car…
Long Answer: Dependant on internal development policy.
![Page 23: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/23.jpg)
23
1) Uses top level directory for each channel.
2) Includes appropriate elements in directory structures mimicking uPortal deployment directory structures.
3) Uses package relative directory structures beneath mimicked deployment directories.
4) Provides build and deployment tool with channel.
JA-SIG’s portal-channels
![Page 24: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/24.jpg)
24
Bookmarks
source
mediastylesheets
UBC_Webmail
webpages
properties
build.xml
build.properties
portal-channels
Package relative sub-directories
ANT
bookmarks.car
Intermediate
jasigorg
portalchannels
bookmarks*.java, *.ssl,*.gif, *.xsl, etc.
Portal-channels CAR Building
![Page 25: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/25.jpg)
25
SCT’s Development Policy
1) Use package-relative development directory structure.
2) Use directory naming scheme to differentiate channel base directories.
3) Provide build/deployment tool separate from channels.
![Page 26: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/26.jpg)
26
SCT’s Directory Structure
channels project
sctcom
pipelineuportal
channels
Institution
Division
Build tool used portion
carlotbanneremailmyaccount
Channel Base Directories
edu
![Page 27: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/27.jpg)
27
SCT’s Ant Based CDK Tool
ant list
[listFiles] --- Channels in development:
[listFiles] com/campuspipeline/uportal/channels/cpAttributes[listFiles] com/sct/pipeline/uportal/channels/carlot[listFiles] edu/wasatch/college/uportal/channels/example1[listFiles] com/sct/uportal/channels/banner
Also shows channels deployed as CARs, channels with web-visible or class resources (traditional deployment), and configuration information
![Page 28: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/28.jpg)
28
SCT’s Directory Structure
channels project
sctcom
pipelineuportal
channels
carlotbanneremailmyaccount
edu
ANT
carlot.car
Intermediate
sctcom
pipeline
channelscarlot*.java, *.ssl,*.gif, *.xsl, etc.
uportal
![Page 29: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/29.jpg)
29
SCT’s Ant Based CDK Toolant car
car:[selectFile] Select the channel directory to be archived:[selectFile] (0 com/campuspipeline/uportal/channels/cpAttributes,[selectFile] 1 com/sct/pipeline/uportal/channels/carlot,[selectFile] 2 edu/wasatch/college/uportal/channels/example1,[selectFile] 3 com/sct/uportal/channels/banner)1[mkdir] Created dir: /cdk/tmp/com/sct/pipeline/uportal/channels/carlot [javac] Compiling 1 source file to /opt/cp/sdk/ui-sdk/cdk/build[jar] Building jar: /cdk/tmp/carlot.car[move] Moving 1 files to /opt/pipeline/webapps/luminis/WEB-INF/cars[delete] Deleting directory /cdk/tmp
![Page 30: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/30.jpg)
30
Laws to Follow
•Always use globally unique, package relative directories as specified in Java Language Specification, section 7.7.
Com.sct…., org.jasig…., edu….
•Develop an internal policy on channel development practices and provide tools to make life easier for developers thereby encouraging adherence to the policy.
![Page 31: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/31.jpg)
31
What We Will Cover
What is a CAR and how is it installed?
What is the Development Impact?
How do you build them?
What new models are coming?
Questions?
![Page 32: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/32.jpg)
32
New Models (Features)
1) * Documentation.
2) * Services & Channel Types deployable from CAR.
3) * Support of more browser accessible file types.
4) Automatic Recognition of new* or updated CARs.
5) Replacement of CarResourceWorker?
6) Semi-automatic & Automatic publication.
7) Third party library support.
* Available in 2.2.
![Page 34: Learning to Drive with a Channel Archive Mark Boyd Software Engineer/Architect mboyd@sct.com](https://reader030.vdocuments.net/reader030/viewer/2022032800/56649d405503460f94a1997f/html5/thumbnails/34.jpg)
Car-Lot Demo
If you wish to deploy the Car-Lot demo download from http://luminis.sales.teamp.com/cars/carlot.car
and drop it into the cars directory as outlined in this presentation. Once it is there bounce the web-server and
then publish as a custom java channel, class name of
com.sct.pipeline.uportal.channels.carlot.Channel
with no channel controls and suitable values for all other parameters.