SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Quickly Customizing Alfresco Share 2 AingaranPillai Founder, Zazi twitter: @apillaiz
Use case: Adding Simple Extensions 3 ,[object Object]
Simple Extensions
Practical Examples – Tag Cloud, Twitter Feed, Red Theme,[object Object]
Tag Cloud Dashlet 5 Site Dashlet Displays dynamic data Tags associated with the current site, as a tag cloud Loads data from repository via existingRESTful API GET /alfresco/service/api/tagscopes/site/{site}/tags GET /alfresco/service/api/tagscopes/site/{site}/{container}/tags Business logic could be implemented entirely in the web tier But better using client-side JavaScript Allows ‘refreshing’ of data Deploy as a JAR
6
Typical Dashlet Pattern 7 (function() {    ... Alfresco.dashlet.SiteTags = functionSiteTags_constructor(htmlId)    { returnAlfresco.dashlet.SiteTags.superclass.constructor.call(this, "Alfresco.dashlet.SiteTags", htmlId); }; YAHOO.extend(Alfresco.dashlet.SiteTags, Alfresco.component.Base, {      options:      {         ...      }, onReady: function SiteTags_onReady() {         ...      },      ...    } }
Code Walk Though 8 Client-side JS source/web/components/dashlets/site-tags.js Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get
Twitter Feed Dashlet 9 Generic Dashlet (User or Site dashboards) Displays last ten tweets of a specific user Loads data from Twitter JSON API GET /alfresco/service/api/tagscopes/site/{site}/tags GET /alfresco/service/api/tagscopes/site/{site}/{container}/tags Data loading performed by a second ‘list’ web script Dashlet web script just acts as a container Allows simple refreshing of data Configuration dialogue UI to set Twitter username Yet another web script! Glue it all together using client-side JavaScript Deploy as a JAR
10
Code Walk Though 11 Client-side JS source/web/components/dashlets/twitter-user-timeline.js Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline.get Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline-list.get Web script config/alfresco/site-webscripts/org/alfresco/modules/dashlets/config-twitter-user-timeline.get
Dashlet Development Considerations 12 How should I load my data? Web tier only for simple dashlets Complement with client-side JavaScript where needed More client-side JS allows richer user experience and shifts processing burden onto the clients What format? JSON, XML or direct HTML? What configuration parameters can be applied? e.g. Number of tags, default Twitter user Configuration dialogue allows users to change it Store default values in .config.xmlfile Are any user preferences required?
Custom Red Theme 13 Custom Theme for Alfresco Share Provides custom CSS plus (optional) images Allow selection of theme in Admin Console Deploy as an AMP (not a JAR)
Custom Theme Walk-Through 14 Changing the title bar colour/background Changing the site navigation bar Changing the hyperlink colour Changing the default logos YUI Controls YUI Tree controls YUI Buttons YUI Menus
15
Code Walk Though 16
Packaging Extensions 17 Always package simple extensions in JAR format where possible Share Extras uses a standard source structure and Ant built script to acheivethis Some extensions (e.g. Custom themes) cannot be packaged as JARs - use AMP files instead Use a build process to do the hard work Create directory structures Create JAR/AMP files JavaScript compression See example in Share Extras projects
Tools 18 Use whatever tools you like, BUT Separate your source from your deployment Do not develop inside the webapp! Use a source code management tool Use a standard project structure Build tools (e.g. Ant) can help you JavaScript/FreeMarker code completion/syntax checking will save you a LOT of time Eclipse can do all of this Test across different browsers Firefox/Firebug and Google Chrome are best for debugging
General Points 19 Share is a powerful platform But modularity leads to a lot of files You may want to copy/paste from similar areas of functionality Don’t forget to document!

Weitere ähnliche Inhalte

Was ist angesagt?

APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
webhostingguy
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Lucidworks
 
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nycJohn Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
SharePoint Saturday NY
 
( 12 ) Office 2007 Features Custom List
( 12 ) Office 2007   Features   Custom List( 12 ) Office 2007   Features   Custom List
( 12 ) Office 2007 Features Custom List
LiquidHub
 
Rails
RailsRails
Rails
SHC
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 

Was ist angesagt? (20)

Apache Ppt
Apache PptApache Ppt
Apache Ppt
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
 
Apache
ApacheApache
Apache
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nycJohn Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
 
RESTful application with Drupal 8
RESTful application with Drupal 8RESTful application with Drupal 8
RESTful application with Drupal 8
 
( 12 ) Office 2007 Features Custom List
( 12 ) Office 2007   Features   Custom List( 12 ) Office 2007   Features   Custom List
( 12 ) Office 2007 Features Custom List
 
Deploying Code In SharePoint
Deploying Code In SharePointDeploying Code In SharePoint
Deploying Code In SharePoint
 
Rails
RailsRails
Rails
 
Apache web server tutorial for linux
Apache web server tutorial for linuxApache web server tutorial for linux
Apache web server tutorial for linux
 
Html 5
Html 5Html 5
Html 5
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectors
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Eclipse orion
Eclipse orionEclipse orion
Eclipse orion
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
The Flexibility of Drupal 8 | DCNLights 2017
The Flexibility of Drupal 8 | DCNLights 2017The Flexibility of Drupal 8 | DCNLights 2017
The Flexibility of Drupal 8 | DCNLights 2017
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache Tutorial
 
SUG Bangalore - Kick Off Session
SUG Bangalore - Kick Off SessionSUG Bangalore - Kick Off Session
SUG Bangalore - Kick Off Session
 
.Net course-in-mumbai-ppt
.Net course-in-mumbai-ppt.Net course-in-mumbai-ppt
.Net course-in-mumbai-ppt
 

Ähnlich wie Quickly Customizing Alfresco

CustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputsCustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputs
Suite Solutions
 
Sakai App Structure
Sakai App StructureSakai App Structure
Sakai App Structure
jiali zhang
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
elliando dias
 
More Best Practices With Share Point Solutions
More Best Practices With Share Point SolutionsMore Best Practices With Share Point Solutions
More Best Practices With Share Point Solutions
Alexander Meijers
 
Developing and Deploying Custom Branding Solutions in SharePoint 2010
Developing and Deploying Custom Branding Solutions in SharePoint 2010Developing and Deploying Custom Branding Solutions in SharePoint 2010
Developing and Deploying Custom Branding Solutions in SharePoint 2010
jhendrix88
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13
Shahzad S
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
Ashok Modi
 

Ähnlich wie Quickly Customizing Alfresco (20)

Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
 
CustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputsCustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputs
 
FED presentation
FED presentationFED presentation
FED presentation
 
Sakai App Structure
Sakai App StructureSakai App Structure
Sakai App Structure
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
 
More Best Practices With Share Point Solutions
More Best Practices With Share Point SolutionsMore Best Practices With Share Point Solutions
More Best Practices With Share Point Solutions
 
Ext Js
Ext JsExt Js
Ext Js
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011
 
SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011
 
Developing and Deploying Custom Branding Solutions in SharePoint 2010
Developing and Deploying Custom Branding Solutions in SharePoint 2010Developing and Deploying Custom Branding Solutions in SharePoint 2010
Developing and Deploying Custom Branding Solutions in SharePoint 2010
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
 
Wordpress as a CMS
Wordpress as a CMSWordpress as a CMS
Wordpress as a CMS
 
Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
SharePoint 2010 For Developers
SharePoint 2010 For DevelopersSharePoint 2010 For Developers
SharePoint 2010 For Developers
 
Alfresco As SharePoint Alternative - Architecture Overview
Alfresco As SharePoint Alternative - Architecture OverviewAlfresco As SharePoint Alternative - Architecture Overview
Alfresco As SharePoint Alternative - Architecture Overview
 

Mehr von Alfresco Software

Mehr von Alfresco Software (20)

Alfresco Day Benelux Inholland studentendossier
Alfresco Day Benelux Inholland studentendossierAlfresco Day Benelux Inholland studentendossier
Alfresco Day Benelux Inholland studentendossier
 
Alfresco Day Benelux Hogeschool Inholland Records Management application
Alfresco Day Benelux Hogeschool Inholland Records Management applicationAlfresco Day Benelux Hogeschool Inholland Records Management application
Alfresco Day Benelux Hogeschool Inholland Records Management application
 
Alfresco Day BeNelux: Customer Success Showcase - Saxion Hogescholen
Alfresco Day BeNelux: Customer Success Showcase - Saxion HogescholenAlfresco Day BeNelux: Customer Success Showcase - Saxion Hogescholen
Alfresco Day BeNelux: Customer Success Showcase - Saxion Hogescholen
 
Alfresco Day BeNelux: Customer Success Showcase - Gemeente Amsterdam
Alfresco Day BeNelux: Customer Success Showcase - Gemeente AmsterdamAlfresco Day BeNelux: Customer Success Showcase - Gemeente Amsterdam
Alfresco Day BeNelux: Customer Success Showcase - Gemeente Amsterdam
 
Alfresco Day BeNelux: The success of Alfresco
Alfresco Day BeNelux: The success of AlfrescoAlfresco Day BeNelux: The success of Alfresco
Alfresco Day BeNelux: The success of Alfresco
 
Alfresco Day BeNelux: Customer Success Showcase - Credendo Group
Alfresco Day BeNelux: Customer Success Showcase - Credendo GroupAlfresco Day BeNelux: Customer Success Showcase - Credendo Group
Alfresco Day BeNelux: Customer Success Showcase - Credendo Group
 
Alfresco Day BeNelux: Digital Transformation - It's All About Flow
Alfresco Day BeNelux: Digital Transformation - It's All About FlowAlfresco Day BeNelux: Digital Transformation - It's All About Flow
Alfresco Day BeNelux: Digital Transformation - It's All About Flow
 
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
 
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
 
Alfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest APIAlfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest API
 
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-KonsoleAlfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
 
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
Alfresco Day Vienna 2016: Entwickeln mit AlfrescoAlfresco Day Vienna 2016: Entwickeln mit Alfresco
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
 
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
 
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
Alfresco Day Vienna 2016: Partner Lightning Talk: WesternacherAlfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
 
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
 
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novum
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novumAlfresco Day Vienna 2016: Partner Lightning Talk - it-novum
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novum
 
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
 
Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
 
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - SafranAlfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
 
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
Alfresco Day Warsaw 2016: Advancing the Flow of Digital BusinessAlfresco Day Warsaw 2016: Advancing the Flow of Digital Business
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Quickly Customizing Alfresco

  • 1. Quickly Customizing Alfresco Share 2 AingaranPillai Founder, Zazi twitter: @apillaiz
  • 2.
  • 4.
  • 5. Tag Cloud Dashlet 5 Site Dashlet Displays dynamic data Tags associated with the current site, as a tag cloud Loads data from repository via existingRESTful API GET /alfresco/service/api/tagscopes/site/{site}/tags GET /alfresco/service/api/tagscopes/site/{site}/{container}/tags Business logic could be implemented entirely in the web tier But better using client-side JavaScript Allows ‘refreshing’ of data Deploy as a JAR
  • 6. 6
  • 7. Typical Dashlet Pattern 7 (function() { ... Alfresco.dashlet.SiteTags = functionSiteTags_constructor(htmlId) { returnAlfresco.dashlet.SiteTags.superclass.constructor.call(this, "Alfresco.dashlet.SiteTags", htmlId); }; YAHOO.extend(Alfresco.dashlet.SiteTags, Alfresco.component.Base, { options: { ... }, onReady: function SiteTags_onReady() { ... }, ... } }
  • 8. Code Walk Though 8 Client-side JS source/web/components/dashlets/site-tags.js Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get
  • 9. Twitter Feed Dashlet 9 Generic Dashlet (User or Site dashboards) Displays last ten tweets of a specific user Loads data from Twitter JSON API GET /alfresco/service/api/tagscopes/site/{site}/tags GET /alfresco/service/api/tagscopes/site/{site}/{container}/tags Data loading performed by a second ‘list’ web script Dashlet web script just acts as a container Allows simple refreshing of data Configuration dialogue UI to set Twitter username Yet another web script! Glue it all together using client-side JavaScript Deploy as a JAR
  • 10. 10
  • 11. Code Walk Though 11 Client-side JS source/web/components/dashlets/twitter-user-timeline.js Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline.get Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline-list.get Web script config/alfresco/site-webscripts/org/alfresco/modules/dashlets/config-twitter-user-timeline.get
  • 12. Dashlet Development Considerations 12 How should I load my data? Web tier only for simple dashlets Complement with client-side JavaScript where needed More client-side JS allows richer user experience and shifts processing burden onto the clients What format? JSON, XML or direct HTML? What configuration parameters can be applied? e.g. Number of tags, default Twitter user Configuration dialogue allows users to change it Store default values in .config.xmlfile Are any user preferences required?
  • 13. Custom Red Theme 13 Custom Theme for Alfresco Share Provides custom CSS plus (optional) images Allow selection of theme in Admin Console Deploy as an AMP (not a JAR)
  • 14. Custom Theme Walk-Through 14 Changing the title bar colour/background Changing the site navigation bar Changing the hyperlink colour Changing the default logos YUI Controls YUI Tree controls YUI Buttons YUI Menus
  • 15. 15
  • 17. Packaging Extensions 17 Always package simple extensions in JAR format where possible Share Extras uses a standard source structure and Ant built script to acheivethis Some extensions (e.g. Custom themes) cannot be packaged as JARs - use AMP files instead Use a build process to do the hard work Create directory structures Create JAR/AMP files JavaScript compression See example in Share Extras projects
  • 18. Tools 18 Use whatever tools you like, BUT Separate your source from your deployment Do not develop inside the webapp! Use a source code management tool Use a standard project structure Build tools (e.g. Ant) can help you JavaScript/FreeMarker code completion/syntax checking will save you a LOT of time Eclipse can do all of this Test across different browsers Firefox/Firebug and Google Chrome are best for debugging
  • 19. General Points 19 Share is a powerful platform But modularity leads to a lot of files You may want to copy/paste from similar areas of functionality Don’t forget to document!
  • 20. More Information 20 Share Extras project - http://code.google.com/p/share-extras/ Advanced Share Customisation Using Forms in Share

Hinweis der Redaktion

  1. Applicable for any Share JS module, not just dashletsObjects created are namespaced within Alfresco.dashlet scopeVariables and functions are scoped by enclosing within functions (variable scope in JavaScript is function-wide)Aliases declared at start of module – keeps code shorterConstructor sets up the object – unique object ID is passed inoptions property used to set parameters for a particular instance of the object (as we could have more than one on a page)onReady() function called by YUI when the parent element is available for scripting, usually used to add further listeners to particular Dom elements and set up YUI widgetsOther functions may define additional behaviour and be called by onReady()Other functions will define event handlers that are attached to objects
  2. Client-side JS source/web/components/dashlets/site-tags.jsAlias Dom and Event YUI classes which are used heavily within the moduleAlias html() and combine() Alfresco util functionsDeclare preference key values used as constantsConstructor is standardOptions holds max number of tags to show, plus parameters for sizing each tag displayed (use fixed font-sizes for the least-occurring and most-occurring tags, with a linear algorithm for tags in-between)Container <div> Dom element that is frequently used is cached as tagsContaineronReady() initialisestagsContainer, Adds event listeners to form controls, initialises YUI widgets and fires off loading of tags via XHRonRefresh() provides event handler when a user clicks the refresh buttonrefreshTags() does the work of refreshing the tags, loading data via Alfresco.util.Ajax.jsonGet() onTagsSuccess() and onTagsFailed() provide the async call-backs for the JSON callgetUriTemplate() is a convenience method to return the URL that a tag should be hyperlinked to in the UIupdateFilterUI() sets the active filter highlight in the UIsetActiveFilter() persists the new active filter (using prefs as well as local option val), calls updateFilterUI() and refreshes the list of tagsonAllCheckedChanged(), onFilterClicked() and onFilterChanged() provides event handlers for when users change the tag filters in the UIWeb script config/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.getThe Tag Cloud dashlet. Renders a container for the tag cloud and instantiates the JS object to start doing the real work.
  3. Client-side JS source/web/components/dashlets/twitter-user-timeline.jsAlias Dom and Event YUI classes which are used heavily within the moduleAlias html() and combine() Alfresco util functionsConstructor is standardOptions holds the currently-configured Twitter username, plus a default username if the user clears the current configurationContainer <div> Dom element that contains the Twitter stream, plus the dashlet title Dom element are cached as timeline and title.onReady() initialisestimeline and title, calls refreshTimeline() and adds event listener to the ‘Configure’ link in the UIonRefresh() provides event handler when a user clicks the refresh buttonrefreshTimeline() does the work of refreshing the twitter stream, making an AJAX request to the second ‘data’ web script via Alfresco.util.Ajax.request() onTimelineLoaded() and onTimelineLoadFailed () provide the async call-backs for the JSON callonConfigClick() does the work of attaching the config dialogue to the ‘Configure’ link. All behaviour of the dialogue is programmed in here declaratively, including loading the config dialogue web script and persisting the configuration when the ‘OK’ button is clicked.Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline.getThe Twitter User dashlet. Really just acts as a container for the Twitter stream and instantiates the JS object.Web script config/alfresco/site-webscripts/org/alfresco/components/dashlets/twitter-user-timeline-list.getReturns the actual user timeline of a specific Twitter user in HTML formatWeb script config/alfresco/site-webscripts/org/alfresco/modules/dashlets/config-twitter-user-timeline.getRenders the config dialogue UI for configuring the Twitter User dashlet
  4. Directory source/web/themes/redThemeAll your theme assets live here – CSS and imagesThese can be copied over from existing themes (But if copying from the default theme several files and directories will be missing from the ‘yui’ directory. Other themes have these already.)Style sheet source/web/themes/redTheme/presentation.cssMost styles defined by the theme are in here. Note many style classes are defined within a container .yui-skin-redTheme. If you create your own theme based on another, you will need to do a find-and-replace to change this class name throughout the file, e.g. to .yui-skin-myCustomTheme.Line 881 – set background of main title bar.theme-bg-color-1,div.theme-bg-color-1{ background-color: #ef1216;}Line 456 – background of buttons displayed on main title bar.yui-skin-redTheme .title-button .yui-button{ background: transparent url(images/title-button-bg.png) repeat-x 0 0;}Line 311 – set colour/background of site navigation barPick a lighter colour than the main navigation bar - Around 50% opacity of main colour works well.site-navigation{ background-color: #f7898b; /*background-image: url(../../components/images/navigation-bg.png);*/ border-bottom: 1px solid #f34d50; border-top: 1px solid #b50e11;color: white;}Colour of navigation links set following thisLine 109 – Dashlet title bars background.dashlet .title{ background-color: #d7e0e7; background-image: url(images/dashlet-title-bg.png); background-repeat: repeat-x; border-bottom: 1px dashed #bababa;color: #262d35;}Stylesheet source/web/themes/redTheme/yui/skin.cssOther YUI-specific style definitions. Again, developers must perform a find-and-replace based on the theme name in this file, if copied from elsewhere.Images in source/web/themes/redTheme/imagestitle-bg.png – Background for the title bar (not used in red theme)title-button-bg.png – buttons appearing on the title bar – 1x48 gradient imagedashlet-title-bg.png – Dashlet title bar background (not customised)app-logo.png – Application logo used in the main application (not customised)logo.png – Logo used on login page (not customised)loginbg.png – Background of login page (not customised)