SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Alfresco Surf Code Camp
Lab 4: Content associations and CMIS
Objectives

             Build an Object Viewer page in Surf
             Add a CMIS Browser Component
             Add a CMIS Display Component
             Work with XML streams and process them in
             FreeMarker
             Experiment with linking to object instances




07/11/08                                                   2
Green Energy

             We will further extend the Green Energy site
              • We started this in Lab #3
              • It was extended in the walkthrough with introductory CMIS

             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
Update the FolderList Component

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

             var path = quot;/Company%20Homequot;;

             // load the feel
             var connector = remote.connect(quot;alfrescoquot;);
             var feed = connector.get(quot;/api/path/workspace/SpacesStorequot; + path + quot;/childrenquot;);

             // parse the feed and set namespace
             var xml = loadFeed(feed);

             // set up the model
             model.title = xml.*::title.toString();
             var items = new Array();
             for each (entry in xml.*::entry)
             {
                var item = { };
                item[quot;titlequot;] = entry.*::title.toString();
                item[quot;iconquot;] = entry.*::icon.toString();
                item[“id”] = null; // TODO
                item[“url”] = null; // TODO
                items.push(item);
             }
             model.items = items;


07/11/08                                                                                  5
Update the FolderList Component

             Fill in the “id” property for each item in the array
              • We can use the “content” property
              • Syntax:   node.*::childElement.toString();

             Fill in the “url” property for each item in the array
              • Use the LinkBuilder API
              • Creates a link to an object
              • context.linkBuilder.object(“workspace://SpacesStore/” +
                item[“id”]);




07/11/08                                                                  6
Update the FolderList Component

             folderlist.get.html.ftl
              • /WEB-INF/classes/alfresco/site-webscripts/age

                <div>
                   <div class=quot;titlequot;>${msg(quot;folderlist.namequot;)}</div>
                   <div class=quot;bodyquot;>
                      <h2>${title}</h2>
                      <ul>
                      <#list items as item>
                        <li>
                          <a href=quot;TODOquot;>
                            <img src=quot;${item.icon}quot;/>&nbsp;${item.title}
                          </a>
                        </li>
                      </#list>
                      </ul>
                   </div>
                </div>




07/11/08                                                                   7
Update the FolderList Component

             TODO
                  Insert value of url from model
              ●

                  Syntax: ${variableName} or ${object.variableName}
              ●




07/11/08                                                              8
Try it out

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




07/11/08                                                         9
Try it out




07/11/08                10
Content Association: cm:content

             Add a Content Association for cm:content
             Points to a page: content-details
             cm_content.details.xml
              • /WEB-INF/classes/alfresco/site-data/content-associations
              <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>

              <content-association>
                <source-id>{http://www.alfresco.org/model/content/1.0}content</source-id>
                <dest-id>content-details</dest-id>
                <assoc-type>page</assoc-type>
              </content-association>


             This tells the framework to use the page ‘content-
             details’ whenever it is told to display content of type
              • {http://www.alfresco.org/model/content/1.0}content




07/11/08                                                                                11
Content Association: cm:folder

             Add a Content Association for cm:folder
             Points to a page: content-details
             cm_folder.details.xml
              • /WEB-INF/classes/alfresco/site-data/content-associations

              <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>

              <content-association>
                <source-id>{http://www.alfresco.org/model/content/1.0}folder</source-id>
                <dest-id>content-details</dest-id>
                <assoc-type>page</assoc-type>
              </content-association>


             This tells the framework to use the page ‘content-
             details’ whenever it is told to display content of type
              • {http://www.alfresco.org/model/content/1.0}folder




07/11/08                                                                                   12
Add Content Details Page

             Add the ‘content-details’ page
             Re-uses the ‘tools’ template
             content-details.xml
              • /WEB-INF/classes/alfresco/site-data/pages

               <?xml version='1.0' encoding='UTF-8'?>
               <page>
                  <title>Content Details</title>
                  <template-instance>tools</template-instance>
                  <authentication>user</authentication>
               </page>




07/11/08                                                         13
Tools Template




                                     navigation  template scope




                   left                         content
                page scope                     page scope




                             footer  global scope
07/11/08                                                          14
Two Components Side by Side

             We would like to add two components to this page
              • Content Browser
              • Content Details
             Using the content browser on the left, users select
             documents and folders
             By selecting folders, they drill down in the browser
             Clicking on a document tells the content details
             component to show the content details




07/11/08                                                            15
Add a CMIS Browser Component

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




07/11/08                                                                16
Add a CMIS Browser Component

             browser.get.desc.xml
             <webscript>
                <shortname>Content Browser</shortname>
                <description>Content Browser</description>
                <url>/age/content/browser</url>
             </webscript>




07/11/08                                                     17
Add a CMIS Browser Component

             browser.get.properties
             contentbrowser.name = Content Browser




07/11/08                                             18
Add a CMIS Browser Component

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

           // determine the path
           var path = content.properties[quot;displayPathquot;] + quot;/quot; + content.properties[quot;namequot;];
           path = path.replace( new RegExp(quot; quot;,quot;gquot;), quot;%20quot; );

           // retrieve the feed
           var connector = remote.connect(quot;alfrescoquot;);
           var feed = connector.get(quot;/api/path/workspace/SpacesStorequot; + path + quot;/childrenquot;);
           var xml = loadFeed(feed);

           // set up model
           model.title = xml.*::title.toString();
           var items = new Array();
           for each (entry in xml.*::entry)
           {
                var item = { };
                item[quot;titlequot;] = entry.*::title.toString();
                item[quot;iconquot;] = entry.*::icon.toString();
                item[quot;idquot;] = entry.*::id.toString().substring(9);
                     item[quot;nodeRefquot;] = quot;workspace://SpacesStore/quot; + item[quot;idquot;];
                     item[quot;urlquot;] = context.linkBuilder.object(item[quot;nodeRefquot;]);
                items.push(item);
           }
           model.items = items;

07/11/08                                                                                       19
Add a CMIS Browser Component

             browser.get.html.ftl
            <div>
               <div class=quot;titlequot;>${msg(quot;contentbrowser.namequot;)}</div>
               <div class=quot;bodyquot;>
                  <h2>${title}</h2>
                  <ul>

                 <#list items as item>
                   <li>
                     <a href=quot;${item.url}quot;>
                       <img src=quot;${item.icon}quot;/>&nbsp;${item.title}
                     </a>
                   </li>
                 </#list>

                  </ul>
               </div>
            </div>




07/11/08                                                                20
Add a CMIS Details Component

             Navigate to the site-webscripts directory
              • /WEB-INF/classes/alfresco/site-webscripts
             Create a path called age/content
             Navigate into the age/content path
              • /WEB-INF/classes/alfresco/site-webscripts/age/content

             Create a Web Script:
              • details




07/11/08                                                                21
Add a CMIS Details Component

             details.get.desc.xml

             <webscript>
                <shortname>Content Details</shortname>
                <description>Content Details</description>
                <url>/age/content/details</url>
             </webscript>




07/11/08                                                     22
Add a CMIS Details Component

             details.get.js

             if(context.content != null)
             {
                model.properties = context.content.properties;

                 // TODO
                 model.title = null;
                 model.description = null;
                 model.mimetype = null;
                 model.id = null;
                 model.downloadUrl = null;
             }




07/11/08                                                         23
Add a CMIS Details Component

             Set up model variables
             Name
              • {http://www.alfresco.org/model/content/1.0}name
             Description
              • {http://www.alfresco.org/model/content/1.0}description
             Id
              • {http://www.alfresco.org/model/system/1.0}node-uuid
             Download URL
              • url.context +
                quot;/proxy/alfresco/api/node/content/workspace/SpacesStore/quot; +
                model.id;




07/11/08                                                                      24
Add a CMIS Details Component

             Use the object data that was automatically loaded by
             the framework
             Variable: context.content
             Useful JSON Tool - http://www.jsonlint.com/
              • Copy-and-paste JSON into a form and JSON lint makes it pretty

             JSON Example – Company Home
              • http://labs3c:8080/alfresco/service/webframework/content/meta
                data

             JSON Example – Guest Space
              • http://labs3c:8080/alfresco/service/webframework/content/meta
                data?id=workspace://SpacesStore/ba5a95a3-3931-4ba3-8db7-
                c5eb95a156a3

             JSON Example – Guest Tutorial PDF
              • http://labs3c:8080/alfresco/service/webframework/content/meta
                data?id=workspace://SpacesStore/a7824f47-e929-4c64-
                b789-19b7f22e5b07
07/11/08                                                                        25
Add a CMIS Details Component

             details.get.head.ftl

             <style type=quot;text/cssquot;>

             .doc-header
             {
                  font-size: 14px;
                  font-family: Verdana;
                  font-weight: bold;
                  color: gray;
                  padding: 4px;
             }

             A.doc
             {
                  text-decoration: none;
             }
             </style>




07/11/08                                   26
Add a CMIS Details Component

             details.get.html.ftl
             <#if content?exists>
               <h2 class=quot;doc-headerquot;>${title} <i>(${mimetype})</i></h2>
               ${description}
               <br/><br/>
               <#if downloadUrl?exists>
                 <a href=quot;${downloadUrl}quot;>Download</a>
               </#if>
               <br/><br/>
               <h2>Properties</h2>
               <br/>
               <table>
               <#list properties?keys as propertyKey>
                  <#assign propertyValue = properties[propertyKey]>
                  <tr>
                     <td>
                        ${propertyKey}<br/>
                        ${propertyValue?string}
                     </td>
                  </tr>
               </#list>
               </table>
             <#else>
                  No Content Selected
             </#if>



07/11/08                                                                   27
Bind in Content Browser component

             Add a left-side content browser component
             page.left.content-details.xml
              • /WEB-INF/classes/alfresco/site-data/components

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




07/11/08                                                         28
Bind in Content Details Component

             Add a centered content details component
             page.content.content-details.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>content-details</source-id>
                 <url>/age/content/details</url>
              </component>




07/11/08                                                         29
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                                                         30
Try it out




07/11/08                31
Try it out




07/11/08                32
Wrap-up

                 In this lab, you...
                     • Associated cm:folder with a specific page
                     • Associated cm:content with a specific page
                     • Created a “browse” and a “details” component and bound them to
                       regions on the Tools page




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

Weitere ähnliche Inhalte

Was ist angesagt?

Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui frameworkHongSeong Jeon
 
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)Carles Farré
 
<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into WordpressMatt Harris
 
Hacking Movable Type Training - Day 1
Hacking Movable Type Training - Day 1Hacking Movable Type Training - Day 1
Hacking Movable Type Training - Day 1Byrne Reese
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESSjsmith92
 
Extreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooExtreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooStefan Schmidt
 
Hacking Movable Type Training - Day 2
Hacking Movable Type Training - Day 2Hacking Movable Type Training - Day 2
Hacking Movable Type Training - Day 2Byrne Reese
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosMatteo Papadopoulos
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
浜松Rails3道場 其の弐 Model編
浜松Rails3道場 其の弐 Model編 浜松Rails3道場 其の弐 Model編
浜松Rails3道場 其の弐 Model編 Masakuni Kato
 
JSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklJSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklChristoph Pickl
 

Was ist angesagt? (18)

Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui framework
 
Open Social Summit Korea
Open Social Summit KoreaOpen Social Summit Korea
Open Social Summit Korea
 
Advanced Fluid
Advanced FluidAdvanced Fluid
Advanced Fluid
 
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
 
<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress
 
Hacking Movable Type Training - Day 1
Hacking Movable Type Training - Day 1Hacking Movable Type Training - Day 1
Hacking Movable Type Training - Day 1
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
Extreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooExtreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring Roo
 
Hacking Movable Type Training - Day 2
Hacking Movable Type Training - Day 2Hacking Movable Type Training - Day 2
Hacking Movable Type Training - Day 2
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
BPMS1
BPMS1BPMS1
BPMS1
 
Java presentation
Java presentationJava presentation
Java presentation
 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
浜松Rails3道場 其の弐 Model編
浜松Rails3道場 其の弐 Model編 浜松Rails3道場 其の弐 Model編
浜松Rails3道場 其の弐 Model編
 
JSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklJSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph Pickl
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
 

Andere mochten auch

The standard resistor colour code chart
The standard resistor colour code chartThe standard resistor colour code chart
The standard resistor colour code chartSaint Columban College
 
03 resistors and color code
03 resistors and color code03 resistors and color code
03 resistors and color codeMegan Dilworth
 
ofdm applications
ofdm applicationsofdm applications
ofdm applicationsbelal park
 
Resistor Color Coding
Resistor Color CodingResistor Color Coding
Resistor Color CodingRey Arthur
 
Resistor Color Code
Resistor Color CodeResistor Color Code
Resistor Color Coderahman84
 

Andere mochten auch (6)

The standard resistor colour code chart
The standard resistor colour code chartThe standard resistor colour code chart
The standard resistor colour code chart
 
03 resistors and color code
03 resistors and color code03 resistors and color code
03 resistors and color code
 
ofdm applications
ofdm applicationsofdm applications
ofdm applications
 
Resistor Color Coding
Resistor Color CodingResistor Color Coding
Resistor Color Coding
 
Resistor Color Code
Resistor Color CodeResistor Color Code
Resistor Color Code
 
Resistor color coding
Resistor color codingResistor color coding
Resistor color coding
 

Ähnlich wie Optaros Surf Code Camp Lab 4

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
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website OptimizationGerard Sychay
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
 
Mobile library on drupal cil2011
Mobile library on drupal   cil2011Mobile library on drupal   cil2011
Mobile library on drupal cil2011sc20866
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Jeff Potts
 
Flex_rest_optimization
Flex_rest_optimizationFlex_rest_optimization
Flex_rest_optimizationKhou Suylong
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog SampleSkills Matter
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java containernetinhoteixeira
 

Ähnlich wie Optaros Surf Code Camp Lab 4 (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
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
New Browsers
New BrowsersNew Browsers
New Browsers
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
Mobile library on drupal cil2011
Mobile library on drupal   cil2011Mobile library on drupal   cil2011
Mobile library on drupal cil2011
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1Optaros Surf Code Camp Lab 1
Optaros Surf Code Camp Lab 1
 
EPiServer Web Parts
EPiServer Web PartsEPiServer Web Parts
EPiServer Web Parts
 
Html5
Html5Html5
Html5
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Struts Portlet
Struts PortletStruts Portlet
Struts Portlet
 
Flex_rest_optimization
Flex_rest_optimizationFlex_rest_optimization
Flex_rest_optimization
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Running PHP on a Java container
Running PHP on a Java containerRunning PHP on a Java container
Running PHP on a Java container
 
HTML5
HTML5HTML5
HTML5
 
Spring and DWR
Spring and DWRSpring and DWR
Spring and DWR
 
Servlet30 20081218
Servlet30 20081218Servlet30 20081218
Servlet30 20081218
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Optaros Surf Code Camp Lab 4

  • 1. Alfresco Surf Code Camp Lab 4: Content associations and CMIS
  • 2. Objectives Build an Object Viewer page in Surf Add a CMIS Browser Component Add a CMIS Display Component Work with XML streams and process them in FreeMarker Experiment with linking to object instances 07/11/08 2
  • 3. Green Energy We will further extend the Green Energy site • We started this in Lab #3 • It was extended in the walkthrough with introductory CMIS 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. Update the FolderList Component folderlist.get.js <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;> var path = quot;/Company%20Homequot;; // load the feel var connector = remote.connect(quot;alfrescoquot;); var feed = connector.get(quot;/api/path/workspace/SpacesStorequot; + path + quot;/childrenquot;); // parse the feed and set namespace var xml = loadFeed(feed); // set up the model model.title = xml.*::title.toString(); var items = new Array(); for each (entry in xml.*::entry) { var item = { }; item[quot;titlequot;] = entry.*::title.toString(); item[quot;iconquot;] = entry.*::icon.toString(); item[“id”] = null; // TODO item[“url”] = null; // TODO items.push(item); } model.items = items; 07/11/08 5
  • 6. Update the FolderList Component Fill in the “id” property for each item in the array • We can use the “content” property • Syntax: node.*::childElement.toString(); Fill in the “url” property for each item in the array • Use the LinkBuilder API • Creates a link to an object • context.linkBuilder.object(“workspace://SpacesStore/” + item[“id”]); 07/11/08 6
  • 7. Update the FolderList Component folderlist.get.html.ftl • /WEB-INF/classes/alfresco/site-webscripts/age <div> <div class=quot;titlequot;>${msg(quot;folderlist.namequot;)}</div> <div class=quot;bodyquot;> <h2>${title}</h2> <ul> <#list items as item> <li> <a href=quot;TODOquot;> <img src=quot;${item.icon}quot;/>&nbsp;${item.title} </a> </li> </#list> </ul> </div> </div> 07/11/08 7
  • 8. Update the FolderList Component TODO Insert value of url from model ● Syntax: ${variableName} or ${object.variableName} ● 07/11/08 8
  • 9. Try it out Start Alfresco • http://labs3c:8080/alfresco Start Surf Tomcat • http://labs3c:8580/sample Browse to • http://labs3c:8580/alfwf/service/index Click on ‘Refresh’ to reset the Web Scripts cache Test your site • http://labs3c:8580/sample 07/11/08 9
  • 11. Content Association: cm:content Add a Content Association for cm:content Points to a page: content-details cm_content.details.xml • /WEB-INF/classes/alfresco/site-data/content-associations <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <content-association> <source-id>{http://www.alfresco.org/model/content/1.0}content</source-id> <dest-id>content-details</dest-id> <assoc-type>page</assoc-type> </content-association> This tells the framework to use the page ‘content- details’ whenever it is told to display content of type • {http://www.alfresco.org/model/content/1.0}content 07/11/08 11
  • 12. Content Association: cm:folder Add a Content Association for cm:folder Points to a page: content-details cm_folder.details.xml • /WEB-INF/classes/alfresco/site-data/content-associations <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <content-association> <source-id>{http://www.alfresco.org/model/content/1.0}folder</source-id> <dest-id>content-details</dest-id> <assoc-type>page</assoc-type> </content-association> This tells the framework to use the page ‘content- details’ whenever it is told to display content of type • {http://www.alfresco.org/model/content/1.0}folder 07/11/08 12
  • 13. Add Content Details Page Add the ‘content-details’ page Re-uses the ‘tools’ template content-details.xml • /WEB-INF/classes/alfresco/site-data/pages <?xml version='1.0' encoding='UTF-8'?> <page> <title>Content Details</title> <template-instance>tools</template-instance> <authentication>user</authentication> </page> 07/11/08 13
  • 14. Tools Template navigation  template scope left content page scope page scope footer  global scope 07/11/08 14
  • 15. Two Components Side by Side We would like to add two components to this page • Content Browser • Content Details Using the content browser on the left, users select documents and folders By selecting folders, they drill down in the browser Clicking on a document tells the content details component to show the content details 07/11/08 15
  • 16. Add a CMIS Browser Component Navigate to the site-webscripts directory • /WEB-INF/classes/alfresco/site-webscripts Create a path called age/content Navigate into the age/content path • /WEB-INF/classes/alfresco/site-webscripts/age/content Create a Web Script: • browser 07/11/08 16
  • 17. Add a CMIS Browser Component browser.get.desc.xml <webscript> <shortname>Content Browser</shortname> <description>Content Browser</description> <url>/age/content/browser</url> </webscript> 07/11/08 17
  • 18. Add a CMIS Browser Component browser.get.properties contentbrowser.name = Content Browser 07/11/08 18
  • 19. Add a CMIS Browser Component browser.get.js <import resource=quot;classpath:alfresco/site-webscripts/age/feed.utils.jsquot;> // determine the path var path = content.properties[quot;displayPathquot;] + quot;/quot; + content.properties[quot;namequot;]; path = path.replace( new RegExp(quot; quot;,quot;gquot;), quot;%20quot; ); // retrieve the feed var connector = remote.connect(quot;alfrescoquot;); var feed = connector.get(quot;/api/path/workspace/SpacesStorequot; + path + quot;/childrenquot;); var xml = loadFeed(feed); // set up model model.title = xml.*::title.toString(); var items = new Array(); for each (entry in xml.*::entry) { var item = { }; item[quot;titlequot;] = entry.*::title.toString(); item[quot;iconquot;] = entry.*::icon.toString(); item[quot;idquot;] = entry.*::id.toString().substring(9); item[quot;nodeRefquot;] = quot;workspace://SpacesStore/quot; + item[quot;idquot;]; item[quot;urlquot;] = context.linkBuilder.object(item[quot;nodeRefquot;]); items.push(item); } model.items = items; 07/11/08 19
  • 20. Add a CMIS Browser Component browser.get.html.ftl <div> <div class=quot;titlequot;>${msg(quot;contentbrowser.namequot;)}</div> <div class=quot;bodyquot;> <h2>${title}</h2> <ul> <#list items as item> <li> <a href=quot;${item.url}quot;> <img src=quot;${item.icon}quot;/>&nbsp;${item.title} </a> </li> </#list> </ul> </div> </div> 07/11/08 20
  • 21. Add a CMIS Details Component Navigate to the site-webscripts directory • /WEB-INF/classes/alfresco/site-webscripts Create a path called age/content Navigate into the age/content path • /WEB-INF/classes/alfresco/site-webscripts/age/content Create a Web Script: • details 07/11/08 21
  • 22. Add a CMIS Details Component details.get.desc.xml <webscript> <shortname>Content Details</shortname> <description>Content Details</description> <url>/age/content/details</url> </webscript> 07/11/08 22
  • 23. Add a CMIS Details Component details.get.js if(context.content != null) { model.properties = context.content.properties; // TODO model.title = null; model.description = null; model.mimetype = null; model.id = null; model.downloadUrl = null; } 07/11/08 23
  • 24. Add a CMIS Details Component Set up model variables Name • {http://www.alfresco.org/model/content/1.0}name Description • {http://www.alfresco.org/model/content/1.0}description Id • {http://www.alfresco.org/model/system/1.0}node-uuid Download URL • url.context + quot;/proxy/alfresco/api/node/content/workspace/SpacesStore/quot; + model.id; 07/11/08 24
  • 25. Add a CMIS Details Component Use the object data that was automatically loaded by the framework Variable: context.content Useful JSON Tool - http://www.jsonlint.com/ • Copy-and-paste JSON into a form and JSON lint makes it pretty JSON Example – Company Home • http://labs3c:8080/alfresco/service/webframework/content/meta data JSON Example – Guest Space • http://labs3c:8080/alfresco/service/webframework/content/meta data?id=workspace://SpacesStore/ba5a95a3-3931-4ba3-8db7- c5eb95a156a3 JSON Example – Guest Tutorial PDF • http://labs3c:8080/alfresco/service/webframework/content/meta data?id=workspace://SpacesStore/a7824f47-e929-4c64- b789-19b7f22e5b07 07/11/08 25
  • 26. Add a CMIS Details Component details.get.head.ftl <style type=quot;text/cssquot;> .doc-header { font-size: 14px; font-family: Verdana; font-weight: bold; color: gray; padding: 4px; } A.doc { text-decoration: none; } </style> 07/11/08 26
  • 27. Add a CMIS Details Component details.get.html.ftl <#if content?exists> <h2 class=quot;doc-headerquot;>${title} <i>(${mimetype})</i></h2> ${description} <br/><br/> <#if downloadUrl?exists> <a href=quot;${downloadUrl}quot;>Download</a> </#if> <br/><br/> <h2>Properties</h2> <br/> <table> <#list properties?keys as propertyKey> <#assign propertyValue = properties[propertyKey]> <tr> <td> ${propertyKey}<br/> ${propertyValue?string} </td> </tr> </#list> </table> <#else> No Content Selected </#if> 07/11/08 27
  • 28. Bind in Content Browser component Add a left-side content browser component page.left.content-details.xml • /WEB-INF/classes/alfresco/site-data/components <?xml version='1.0' encoding='UTF-8'?> <component> <scope>page</scope> <region-id>left</region-id> <source-id>content-details</source-id> <url>/age/content/browser</url> </component> 07/11/08 28
  • 29. Bind in Content Details Component Add a centered content details component page.content.content-details.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>content-details</source-id> <url>/age/content/details</url> </component> 07/11/08 29
  • 30. 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 30
  • 33. Wrap-up In this lab, you... • Associated cm:folder with a specific page • Associated cm:content with a specific page • Created a “browse” and a “details” component and bound them to regions on the Tools page 07/11/08 Optaros and Client confidential. All rights reserved. 33