SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Alfresco Surf Code Camp
Walkthrough 2: Adding CMIS to Green Energy
Objectives

             Place additional functionality into Green Energy Site
             Get exposed to CMIS by adding a component that lists
             the contents of a folder
             Use E4X to parse XML in JavaScript




07/11/08                                                             2
Green Energy

             We will extend the Green Energy site you started in
             Lab #3
             Sample location:
              • /opt/tomcat/webapps/alfwf
              • http://labs3c:8580/alfwf




07/11/08                                                           3
Directories

             Green Energy Web Application
              • /opt/tomcat/webapps/alfwf


             site-data
              • /WEB-INF/classes/alfresco/site-data
             site-webscripts
              • /WEB-INF/classes/alfresco/site-webscripts
             FreeMarker templates
              • /WEB-INF/classes/alfresco/templates




07/11/08                                                    4
Drop in assets

             Unzip the assets.zip file into the web application
             Manifest:
              • /images/age/folder.png
              • /images/age/page.png
              • /WEB-INF/classes/alfresco/templates/age/tools.ftl
              • /WEB-INF/classes/alfresco/site-webscripts/age/feed-util.js




07/11/08                                                                     5
Add a tools page

             Add a tools page
             Points to a rendering template: tools
             tools.xml
             /WEB-INF/classes/alfresco/site-data/pages
             <?xml version='1.0' encoding='UTF-8'?>
             <page>
                <title>Tools</title>
                <template-instance>tools</template-instance>
                <authentication>user</authentication>
             </page>


             The tools page must know how to render
              • Use template instance: tools




07/11/08                                                       6
Add a tools template instance

             Add a tools template instance
             Points to a FreeMarker file: /age/tools
             tools.xml
              • /WEB-INF/classes/alfresco/site-data/template-instances

                <?xml version='1.0' encoding='UTF-8'?>
                <template-instance>
                   <template-type>/age/tools</template-type>
                </template-instance>




             The template instance needs a renderer
              • The FreeMarker renderer:     /age/tools.ftl

              • You already unzipped this. It was in assets.zip




07/11/08                                                                 7
Tools Template




                                     navigation  template scope




                   left                         content
                page scope                     page scope




                             footer  global scope
07/11/08                                                          8
Bind in the navigation component

             Add a component binding for the navigation
             template.navigation.tools.xml
              • /WEB-INF/classes/alfresco/site-data/components
               <?xml version='1.0' encoding='UTF-8'?>
               <component>
                  <scope>template</scope>
                  <region-id>navigation</region-id>
                  <source-id>tools</source-id>
                  <url>/blocks/navigation</url>
               </component>

             Note: The footer will naturally bind as it is globally
             scoped.




07/11/08                                                              9
Add as a child of the home page

             Adds the ‘tools’ page as a child of the ‘home’ page
              • Page association
             home-tools.xml
              • /WEB-INF/classes/alfresco/site-data/page-associations

                <?xml version='1.0' encoding='UTF-8'?>
                <page-association>
                   <source-id>home</source-id>
                   <dest-id>tools</dest-id>
                   <assoc-type>child</assoc-type>
                </page-association>




07/11/08                                                                10
Try it out

             Start Alfresco
              • http://labs3c:8080/alfresco
             Start Surf Tomcat
              • http://labs3c:8580/alfwf
             Browse to
              • http://labs3c:8580/alfwf/service/index
             Click on ‘Refresh’ to reset the Web Scripts cache
             Test your site
              • http://labs3c:8580/alfwf




07/11/08                                                         11
Try it out




07/11/08                12
Add a FolderList Component

             Navigate to the site-webscripts directory
              • /WEB-INF/classes/alfresco/site-webscripts
             Create a folder called age
             Navigate into the age directory
              • /WEB-INF/classes/alfresco/site-webscripts/age
             Create a Web Script:
              • folderlist




07/11/08                                                        13
FolderList Component

             Create a web script with the following url
              • /age/folderlist
             folderlist.get.desc.xml
             <webscript>
                <shortname>Folder Listing</shortname>
                <description>Provides a list of contents under Company Home</description>
                <url>/age/folderlist</url>
             </webscript>




07/11/08                                                                                14
FolderList Component

             folderlist.get.properties
             folderlist.name = Folder Listing




07/11/08                                        15
FolderList Component

             folderlist.get.js
             <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;>

             // TODO: Load the feed
             var feed = null;

             // TODO: convert feed to JavaScript
             var xml = null;

             // set up the model
             model.title = xml.*::title.toString();
             var items = new Array();
             for each (entry in xml.*::entry)
             {
                  var item = { };

                      // TODO: retrieve title value
                 item[quot;titlequot;] = null;

                      // TODO: retrieve icon value
                 item[quot;iconquot;] = null;

                  items.push(item);
             }
             model.items = items;


07/11/08                                                                                16
Notes
           FolderList Component
             Loading the feed
              • Recommended API (CMIS)
              • /api/path/workspace/SpacesStore/<path>/children
              • Example: /api/path/workspace/SpacesStore/Company%20Home/children

             Convert the feed to JavaScript
              • Helper function defined in import
              • var xmlObject = loadFeed(feed);
              • <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;>

             Set up the model
              • Namespace aware
              • Use namespace independent way of pulling properties
              • var value = node.*::propertyName.toString();

             More info on E4X
              • http://www.ibm.com/developerworks/library/ws-ajax1/




07/11/08                                                                                   17
FolderList Component

             folderlist.get.html.ftl
             <div>
                <div class=quot;titlequot;>TODO#1</div>
                <div class=quot;bodyquot;>
                   <h2>TODO#2</h2>
                   <ul>
                   <#list items as item>
                      <li><img src=“TODO#3quot;/>&nbsp;TODO#4</li>
                   </#list>
                   </ul>
                </div>
             </div>




07/11/08                                                         18
Notes
           FolderList Component
             TODO #1
              • Insert value of folderlist.name from properties file
              • Syntax: ${msg(string)}
             TODO #2
              • Insert value of title from model
              • Syntax: ${variableName} or ${object.variableName}
             TODO #3
              • Insert value of icon from items array
              • Syntax: ${variableName} or ${object.variableName}
             TODO #4
              • Insert value of title from items array
              • Syntax: ${variableName} or ${object.variableName}




07/11/08                                                               19
Bind in the FolderList component

             Add a component binding for the FolderList
             component
             page.content.tools.xml
              • /WEB-INF/classes/alfresco/site-data/components

               <?xml version='1.0' encoding='UTF-8'?>
               <component>
                  <scope>page</scope>
                  <region-id>content</region-id>
                  <source-id>tools</source-id>
                  <url>/age/folderlist</url>
               </component>




07/11/08                                                         20
Try it out

             Start Alfresco
              • http://labs3c:8080/alfresco
             Start Surf Tomcat
              • http://labs3c:8580/alfwf
             Browse to
              • http://labs3c:8580/alfwf/service/index
             Click on ‘Refresh’ to reset the Web Scripts cache
             Test your site
              • http://labs3c:8580/alfwf




07/11/08                                                         21
Try it out




07/11/08                22
Try it out

             Potential problem: Images not showing up
              • http://localhost:8080/alfresco/images/xyz.gif
              • http://labs3c:8580/alfresco/images/xyz.gif
              • Hack: entry.*::icon.toString().replace('localhost', 'labs3c');




07/11/08                                                                         23
Wrap-up

                 In this walkthrough, you...
                     • Added a new page called Tools
                     • Bound a new “folderlist” component to a region on the Tools page
                     • Implemented the folderlist component to use a CMIS call to
                       retrieve the folder contents of a specified path
                     • Used E4X to parse the XML that CMIS returned




07/11/08   Optaros and Client confidential. All rights reserved.                          24

Más contenido relacionado

La actualidad más candente

HTML5 kickstart - Brooklyn Beta workshop 21.10.2010
HTML5 kickstart - Brooklyn Beta workshop 21.10.2010HTML5 kickstart - Brooklyn Beta workshop 21.10.2010
HTML5 kickstart - Brooklyn Beta workshop 21.10.2010Patrick Lauke
 
JSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederJSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederChristoph Pickl
 
HTML5 and friends - Institutional Web Management Workshop 2010
HTML5 and friends - Institutional Web Management Workshop 2010HTML5 and friends - Institutional Web Management Workshop 2010
HTML5 and friends - Institutional Web Management Workshop 2010Patrick Lauke
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
Html servlet example
Html   servlet exampleHtml   servlet example
Html servlet examplervpprash
 
AIR 開發應用程式實務
AIR 開發應用程式實務AIR 開發應用程式實務
AIR 開發應用程式實務angelliya00
 
Firefox OS workshop, JSFoo, India
Firefox OS workshop, JSFoo, IndiaFirefox OS workshop, JSFoo, India
Firefox OS workshop, JSFoo, IndiaRobert Nyman
 
Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)Loiane Groner
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialYi-Ting Cheng
 

La actualidad más candente (10)

HTML5 kickstart - Brooklyn Beta workshop 21.10.2010
HTML5 kickstart - Brooklyn Beta workshop 21.10.2010HTML5 kickstart - Brooklyn Beta workshop 21.10.2010
HTML5 kickstart - Brooklyn Beta workshop 21.10.2010
 
JSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederJSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael Greifeneder
 
HTML5 and friends - Institutional Web Management Workshop 2010
HTML5 and friends - Institutional Web Management Workshop 2010HTML5 and friends - Institutional Web Management Workshop 2010
HTML5 and friends - Institutional Web Management Workshop 2010
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Html servlet example
Html   servlet exampleHtml   servlet example
Html servlet example
 
Ant User Guide
Ant User GuideAnt User Guide
Ant User Guide
 
AIR 開發應用程式實務
AIR 開發應用程式實務AIR 開發應用程式實務
AIR 開發應用程式實務
 
Firefox OS workshop, JSFoo, India
Firefox OS workshop, JSFoo, IndiaFirefox OS workshop, JSFoo, India
Firefox OS workshop, JSFoo, India
 
Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 

Similar a Optaros Surf Code Camp Walkthrough 2

Optaros Surf Code Camp Walkthrough 1
Optaros Surf Code Camp Walkthrough 1Optaros Surf Code Camp Walkthrough 1
Optaros Surf Code Camp Walkthrough 1Jeff Potts
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Applicationelliando dias
 
Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Jeff Potts
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java containernetinhoteixeira
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website OptimizationGerard Sychay
 
An introduction to juice
An introduction to juice An introduction to juice
An introduction to juice juiceproject
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP frameworkDinh Pham
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti JugCh'ti JUG
 
Mobile library on drupal cil2011
Mobile library on drupal   cil2011Mobile library on drupal   cil2011
Mobile library on drupal cil2011sc20866
 

Similar a Optaros Surf Code Camp Walkthrough 2 (20)

Optaros Surf Code Camp Walkthrough 1
Optaros Surf Code Camp Walkthrough 1Optaros Surf Code Camp Walkthrough 1
Optaros Surf Code Camp Walkthrough 1
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Application
 
Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Struts Portlet
Struts PortletStruts Portlet
Struts Portlet
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java container
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
 
New Browsers
New BrowsersNew Browsers
New Browsers
 
An introduction to juice
An introduction to juice An introduction to juice
An introduction to juice
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP framework
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti Jug
 
Mobile library on drupal cil2011
Mobile library on drupal   cil2011Mobile library on drupal   cil2011
Mobile library on drupal cil2011
 
EPiServer Web Parts
EPiServer Web PartsEPiServer Web Parts
EPiServer Web Parts
 
Servlet30 20081218
Servlet30 20081218Servlet30 20081218
Servlet30 20081218
 

Más de Jeff Potts

No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleJeff Potts
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesJeff Potts
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesJeff Potts
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryJeff Potts
 
Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Jeff Potts
 
Connecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISConnecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISJeff Potts
 
The Challenges of Keeping Bees
The Challenges of Keeping BeesThe Challenges of Keeping Bees
The Challenges of Keeping BeesJeff Potts
 
Getting Started With CMIS
Getting Started With CMISGetting Started With CMIS
Getting Started With CMISJeff Potts
 
Alfresco: What every developer should know
Alfresco: What every developer should knowAlfresco: What every developer should know
Alfresco: What every developer should knowJeff Potts
 
CMIS: An Open API for Managing Content
CMIS: An Open API for Managing ContentCMIS: An Open API for Managing Content
CMIS: An Open API for Managing ContentJeff Potts
 
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Jeff Potts
 
Alfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketAlfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketJeff Potts
 
Join the Alfresco community
Join the Alfresco communityJoin the Alfresco community
Join the Alfresco communityJeff Potts
 
Intro to the Alfresco Public API
Intro to the Alfresco Public APIIntro to the Alfresco Public API
Intro to the Alfresco Public APIJeff Potts
 
Apache Chemistry in Action
Apache Chemistry in ActionApache Chemistry in Action
Apache Chemistry in ActionJeff Potts
 
Building Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIBuilding Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIJeff Potts
 
Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsJeff Potts
 
Getting Started with CMIS
Getting Started with CMISGetting Started with CMIS
Getting Started with CMISJeff Potts
 
Relational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsRelational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsJeff Potts
 
Alfresco SAUG: State of ECM
Alfresco SAUG: State of ECMAlfresco SAUG: State of ECM
Alfresco SAUG: State of ECMJeff Potts
 

Más de Jeff Potts (20)

No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to Microservices
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL Templates
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?
 
Connecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISConnecting Content Management Apps with CMIS
Connecting Content Management Apps with CMIS
 
The Challenges of Keeping Bees
The Challenges of Keeping BeesThe Challenges of Keeping Bees
The Challenges of Keeping Bees
 
Getting Started With CMIS
Getting Started With CMISGetting Started With CMIS
Getting Started With CMIS
 
Alfresco: What every developer should know
Alfresco: What every developer should knowAlfresco: What every developer should know
Alfresco: What every developer should know
 
CMIS: An Open API for Managing Content
CMIS: An Open API for Managing ContentCMIS: An Open API for Managing Content
CMIS: An Open API for Managing Content
 
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
 
Alfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketAlfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM Market
 
Join the Alfresco community
Join the Alfresco communityJoin the Alfresco community
Join the Alfresco community
 
Intro to the Alfresco Public API
Intro to the Alfresco Public APIIntro to the Alfresco Public API
Intro to the Alfresco Public API
 
Apache Chemistry in Action
Apache Chemistry in ActionApache Chemistry in Action
Apache Chemistry in Action
 
Building Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIBuilding Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco API
 
Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
 
Getting Started with CMIS
Getting Started with CMISGetting Started with CMIS
Getting Started with CMIS
 
Relational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsRelational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric Apps
 
Alfresco SAUG: State of ECM
Alfresco SAUG: State of ECMAlfresco SAUG: State of ECM
Alfresco SAUG: State of ECM
 

Último

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 

Último (20)

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 

Optaros Surf Code Camp Walkthrough 2

  • 1. Alfresco Surf Code Camp Walkthrough 2: Adding CMIS to Green Energy
  • 2. Objectives Place additional functionality into Green Energy Site Get exposed to CMIS by adding a component that lists the contents of a folder Use E4X to parse XML in JavaScript 07/11/08 2
  • 3. Green Energy We will extend the Green Energy site you started in Lab #3 Sample location: • /opt/tomcat/webapps/alfwf • http://labs3c:8580/alfwf 07/11/08 3
  • 4. Directories Green Energy Web Application • /opt/tomcat/webapps/alfwf site-data • /WEB-INF/classes/alfresco/site-data site-webscripts • /WEB-INF/classes/alfresco/site-webscripts FreeMarker templates • /WEB-INF/classes/alfresco/templates 07/11/08 4
  • 5. Drop in assets Unzip the assets.zip file into the web application Manifest: • /images/age/folder.png • /images/age/page.png • /WEB-INF/classes/alfresco/templates/age/tools.ftl • /WEB-INF/classes/alfresco/site-webscripts/age/feed-util.js 07/11/08 5
  • 6. Add a tools page Add a tools page Points to a rendering template: tools tools.xml /WEB-INF/classes/alfresco/site-data/pages <?xml version='1.0' encoding='UTF-8'?> <page> <title>Tools</title> <template-instance>tools</template-instance> <authentication>user</authentication> </page> The tools page must know how to render • Use template instance: tools 07/11/08 6
  • 7. Add a tools template instance Add a tools template instance Points to a FreeMarker file: /age/tools tools.xml • /WEB-INF/classes/alfresco/site-data/template-instances <?xml version='1.0' encoding='UTF-8'?> <template-instance> <template-type>/age/tools</template-type> </template-instance> The template instance needs a renderer • The FreeMarker renderer: /age/tools.ftl • You already unzipped this. It was in assets.zip 07/11/08 7
  • 8. Tools Template navigation  template scope left content page scope page scope footer  global scope 07/11/08 8
  • 9. Bind in the navigation component Add a component binding for the navigation template.navigation.tools.xml • /WEB-INF/classes/alfresco/site-data/components <?xml version='1.0' encoding='UTF-8'?> <component> <scope>template</scope> <region-id>navigation</region-id> <source-id>tools</source-id> <url>/blocks/navigation</url> </component> Note: The footer will naturally bind as it is globally scoped. 07/11/08 9
  • 10. Add as a child of the home page Adds the ‘tools’ page as a child of the ‘home’ page • Page association home-tools.xml • /WEB-INF/classes/alfresco/site-data/page-associations <?xml version='1.0' encoding='UTF-8'?> <page-association> <source-id>home</source-id> <dest-id>tools</dest-id> <assoc-type>child</assoc-type> </page-association> 07/11/08 10
  • 11. Try it out Start Alfresco • http://labs3c:8080/alfresco Start Surf Tomcat • http://labs3c:8580/alfwf Browse to • http://labs3c:8580/alfwf/service/index Click on ‘Refresh’ to reset the Web Scripts cache Test your site • http://labs3c:8580/alfwf 07/11/08 11
  • 13. Add a FolderList Component Navigate to the site-webscripts directory • /WEB-INF/classes/alfresco/site-webscripts Create a folder called age Navigate into the age directory • /WEB-INF/classes/alfresco/site-webscripts/age Create a Web Script: • folderlist 07/11/08 13
  • 14. FolderList Component Create a web script with the following url • /age/folderlist folderlist.get.desc.xml <webscript> <shortname>Folder Listing</shortname> <description>Provides a list of contents under Company Home</description> <url>/age/folderlist</url> </webscript> 07/11/08 14
  • 15. FolderList Component folderlist.get.properties folderlist.name = Folder Listing 07/11/08 15
  • 16. FolderList Component folderlist.get.js <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;> // TODO: Load the feed var feed = null; // TODO: convert feed to JavaScript var xml = null; // set up the model model.title = xml.*::title.toString(); var items = new Array(); for each (entry in xml.*::entry) { var item = { }; // TODO: retrieve title value item[quot;titlequot;] = null; // TODO: retrieve icon value item[quot;iconquot;] = null; items.push(item); } model.items = items; 07/11/08 16
  • 17. Notes FolderList Component Loading the feed • Recommended API (CMIS) • /api/path/workspace/SpacesStore/<path>/children • Example: /api/path/workspace/SpacesStore/Company%20Home/children Convert the feed to JavaScript • Helper function defined in import • var xmlObject = loadFeed(feed); • <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;> Set up the model • Namespace aware • Use namespace independent way of pulling properties • var value = node.*::propertyName.toString(); More info on E4X • http://www.ibm.com/developerworks/library/ws-ajax1/ 07/11/08 17
  • 18. FolderList Component folderlist.get.html.ftl <div> <div class=quot;titlequot;>TODO#1</div> <div class=quot;bodyquot;> <h2>TODO#2</h2> <ul> <#list items as item> <li><img src=“TODO#3quot;/>&nbsp;TODO#4</li> </#list> </ul> </div> </div> 07/11/08 18
  • 19. Notes FolderList Component TODO #1 • Insert value of folderlist.name from properties file • Syntax: ${msg(string)} TODO #2 • Insert value of title from model • Syntax: ${variableName} or ${object.variableName} TODO #3 • Insert value of icon from items array • Syntax: ${variableName} or ${object.variableName} TODO #4 • Insert value of title from items array • Syntax: ${variableName} or ${object.variableName} 07/11/08 19
  • 20. Bind in the FolderList component Add a component binding for the FolderList component page.content.tools.xml • /WEB-INF/classes/alfresco/site-data/components <?xml version='1.0' encoding='UTF-8'?> <component> <scope>page</scope> <region-id>content</region-id> <source-id>tools</source-id> <url>/age/folderlist</url> </component> 07/11/08 20
  • 21. Try it out Start Alfresco • http://labs3c:8080/alfresco Start Surf Tomcat • http://labs3c:8580/alfwf Browse to • http://labs3c:8580/alfwf/service/index Click on ‘Refresh’ to reset the Web Scripts cache Test your site • http://labs3c:8580/alfwf 07/11/08 21
  • 23. Try it out Potential problem: Images not showing up • http://localhost:8080/alfresco/images/xyz.gif • http://labs3c:8580/alfresco/images/xyz.gif • Hack: entry.*::icon.toString().replace('localhost', 'labs3c'); 07/11/08 23
  • 24. Wrap-up In this walkthrough, you... • Added a new page called Tools • Bound a new “folderlist” component to a region on the Tools page • Implemented the folderlist component to use a CMIS call to retrieve the folder contents of a specified path • Used E4X to parse the XML that CMIS returned 07/11/08 Optaros and Client confidential. All rights reserved. 24