SlideShare une entreprise Scribd logo
1  sur  64
Télécharger pour lire hors ligne
Developing for Plone using
ArchGenXML / ArgoUML
       Plone Magic Camp
          Brooklyn, NY
          July 24, 2006

            Nate Aune
        Jazkarta Consulting
         www.jazkarta.com
Who am I?

• Founder and developer, Jazkarta Consulting
  (www.jazkarta.com)

• Musician - saxophonist and composer
  (www.nateaune.com/music/)

• Founder of Plone4Artists project
  (www.plone4artists.org)
Agenda
• What is Archetypes?
• What is UML?
• What is ArchGenXML?
• Build a model using ArgoUML
• Transform the model into a Plone product
• Questions?
What is Archetypes?

• Framework for developing Plone products
  • Automatically creates view and edit pages
  • Maintains unique object IDs
  • Creates references between objects
Archetypes framework

• Field validation
• Standard security setup
• Alternate storage options
• Data transformation capabilities
Archetypes schemas
 • Schema
   • Field
    • Widget
   • Field
    • Widget
   • ...
Example Archetype:
      Artist
schema= Schema((
	

 StringField('title'),
	

 ImageField('photo'),
	

 LinesField('instrument'),
))

class Artist(BaseContent)
	

 schema = BaseSchema + schema

registerType(Artist,PROJECTNAME)
Widgets
schema= Schema((
	

 StringField('title',
	

     widget=StringWidget(
	

              label=’Artist name’,
                  size=20),
     ),
	

 ImageField('photo',
         widget=ImageWidget(
                  label=’Headshot’),
     ),
	

 LinesField('instrument',
         widget=MultiSelectionWidget(
                  label=’Instruments’),
         multiValue=1,
     ),
))
What is UML?

• UML = Uniform Modeling Language
• Standard widely-adopted graphical language
• Describes the artifacts of software systems
• Focus on conceptual representations
Artist:
Described in UML
Poseidon UML tool
What is ArchGenXML?

• Command line utility
• Auto-generates code from a UML model
• No round-trip support yet
• Custom code is preserved upon
  regeneration
Why use ArchGenXML?
      (part 1)
• You want to save time
• You are a lazy programmer
• You don’t like to reinvent the wheel
• You don’t like copying and pasting code
• You make heavy use of references and
  interfaces
Why use ArchGenXML?
      (part 2)
• You have big projects with many different
  content types

• You want or need a well-documented
  interface to your product

• You like structured model- and pattern-
  driven software development

• You want to maintain your project in the
  future without getting a headache
UML to Archetypes
using ArchGenXML
            schema= Schema((
            	

     StringField('title',
            	

         widget=StringWidget(
            	

                   label=’Artist name’
                              size=20),
                 ),
            	

     ImageField('photo',
                     widget=ImageWidget(
                              label=’Headshot’),
                 ),
            	

     LinesField('instrument',
                     widget=MultiSelectionWidget(
                              label=’Instruments’),
                     multiValue=1,
                 ),
            ))
UML speak to AT speak
• package        • product

• class          • content type

• operation      • method

• attribute      • field

• tagged value   • property

• stereotype     • subclass, view, etc.
In practice

1. Save your model to the Products dir
2. Run the ArchGenXML script
3. Restart Zope
4. Install the newly generated product
ArchGenXML components
 • ArchGenXML
 • Optional:
   • i18ndude
   • stripogram
   • ATBackRef
   • ATVocabularyManager
   • Relations
Install ArchGenXML
•   Get PloneMagicCamp-bundle
$ svn co svn://svn.plone4artists.org/trunk/PloneMagicCamp-bundle
   (* if you don’t have SVN, download the .zip file)

$ cd $INSTANCE/Products

$ ln -s /path/to/PloneMagicCamp-bundle/* .

$ cd i18ndude; sudo /path/to/python setup.py install

$ cd ../; ./getStripogram.sh

$ cd stripogram; sudo /path/to/python setup.py install



    * If you don’t have SVN client, get the ZIP file.
    $ wget http://www.jazkarta.com/PloneMagicCamp-bundle.zip
    $ unzip PloneMagicCamp-bundle.zip
Install ArgoUML
•    Use the pre-configured one that comes with the bundle
•    --OR-- download from http://argouml.tigris.org
$ wget http://argouml-downloads.tigris.org/nonav/argouml-0.20/
ArgoUML-0.20.tar.gz

$ tar xvfz ArgoUML-0.20.tar.gz

$ cd ArgoUML-0.20

$ cp $INSTANCE_HOME/Products/ArchGenXML/argouml/argouml_profile.xmi .

$ cp argouml.sh argouml.sh.orig; vi argouml.sh

    change line 48 to:

    ${JAVACMD} -Dargo.defaultModel=argouml_profile.xmi -jar $
    {ARGO_HOME}/argouml-mdr.jar $*

$ sh argouml.sh   (to launch ArgoUML)
--OR--
$ java -Dargo.defaultModel=argouml_profile.xmi -jar argouml-mdr.jar
AGX options in ArgoUML!
Create Artist class
Add description and icon
Repurpose Title field
Set the photo sizes
Add instrument vocabulary
Running the script
•   Save project to $INSTANCE_HOME/Products/ArtistSite.zargo

$ cd $INSTANCE_HOME/Products

$ ArchGenXML/ArchGenXML.py -o ArtistSite ArtistSite.zargo

ArchGenXML Version 1.5.0 svn/devel
(c) 2003-2006 BlueDynamics, Austria, GNU General Public License 2.0
or later
INFO Parsing...
INFO Directory in which we're generating the files: 'ArtistSite'.
INFO Generating...
INFO Starting new Product: 'ArtistSite'.
INFO      Generating package 'content'.
INFO          Generating class 'Artist'.

$
ArtistSite product dir
$ cd $INSTANCE_HOME/Products/ArtistSite

$ ls
content          __init__.py    i18n          skins
Extensions       config.py      refresh.txt   version.txt

$ cd content

$ ls
__init__.py      Artist.py

$ vi Artist.py
Inspect Artist.py
• Inserts documentation
• Placeholders for custom code
• i18n message ids
• Using ArtistSite/model/generate_source.sh
  • inserts author information (ArtistSite.conf)
  • creates i18n generated.pot file (i18ndude)
  • strips HTML from doc strings (stripogram)
Add new artist
1. Restart Zope
2. Install ArtistSite using QuickInstaller
3. Add new Artist
Edit artist form
View artist
Move model into product
• Close ArgoUML since we are going to move the file
$ cd $INSTANCE/Products

$ mkdir ArtistSite/model

$ mv ArtistSite.zargo ArtistSite/model

$ ArchGenXML/ArchGenXML.py --sample-config  ArtistSite/model/
ArtistSite.conf

$ cp PloneMagicCamp-bundle/generate_source.sh ArtistSite/model/
Edit ArtistSite.conf
• Add your own author, email and copyright
 [DOCUMENTATION]

 strip-html: yes
 author: Nate Aune
 e-mail: natea (at) jazkarta (dot) com
 copyright: Jazkarta

 [GENERAL]
 outfile: ArtistSite
Edit generate_source.sh
   • Change PYTHON_BIN to your Python
#! /usr/bin/env bash

PRODUCT_NAME=quot;ArtistSitequot;
PRODUCTS_HOME=quot;`pwd`quot;
PYTHON_BIN=quot;/sw/bin/python2.4quot;

$PYTHON_BIN $PRODUCTS_HOME/ArchGenXML/ArchGenXML.py -c /
$PRODUCTS_HOME/$PRODUCT_NAME/model/$PRODUCT_NAME.conf /
$PRODUCTS_HOME/$PRODUCT_NAME/model/$PRODUCT_NAME.zargo
Run generate_source.sh
$ cd $INSTANCE_HOME/Products

$ ArtistSite/model/generate_source.sh

ArchGenXML Version 1.5.0 svn/devel
(c) 2003-2006 BlueDynamics, Austria, GNU General Public License 2.0
or later
INFO Parsing...
INFO Directory in which we're generating the files: 'ArtistSite'.
INFO Generating...
INFO Starting new Product: 'ArtistSite'.
INFO      Generating package 'content'.
INFO          Generating class 'Artist'.

$
Dynamic vocabulary
Add ATVM as dependency

• Edit ArtistSite/AppConfig.py
• Add line to:
  • DEPENDENCIES = ['ATVocabularyManager']
• Restart Zope
• Reinstall ArtistSite
Vocabulary Library
• Go to Plone Setup and choose Vocabulary Library
Add a vocabulary term
Hierarchical vocabularies
Tagged values

• cd $INSTANCE/Products/ArchGenXML
• ./TaggedValueSupport.py | more
• ./TaggedValueSupport.py  tagged-values.txt
•
Containment




    Use the solid rhomb to make a strict containment
‘Artist’ instances can only be added to an ‘Artists’ instance
Use large stereotype
Give it a friendly name
Add Artists container
References


           Create a
       direct association

           results in:

        Reference field
       group to artist(s)
Create direct association
Change the multiplicity (0..*)
  • Right-click the end point
  • Select Multiplicity 0..* (many artists in a group)
Group
   edit
  form



 Group is
associated
with artists
Reference Browser Widget
        as default
Configure browser widget

             Select the end point




                 Make multivalued
                Specify relationship
                   Define query
Adding references
Add back reference
Add ATBackRef as
        dependency
• Edit ArtistSite/AppConfig.py
• Change line to:
  •   DEPENDENCIES = ['ATVocabularyManager', ‘ATBackRef’]

• Restart Zope
• Reinstall ArtistSite
Back
references




   Groups that
 artist belongs to
Custom view for group folder
Assign member stereotype




    Add the ‘member’ stereotype to tell
   ArchGenXML to subclass CMFMember
Computed field
Registration form

• SiteMember is installed
• Replaces default member
• Easy way to create new
  member types
PloneMall

• Example of a sophisticated e-commerce
    framework built using UML

• See the UML model here:
•   http://www.plonemall.com/uml/UML-beta2.png/image_view_fullscreen
What I didn’t cover
• Additional Stereotypes
  • actions, portal_tool, abstract, stub,
     ordered

• portlets, configlet, customization policy
• Generalization (Interfaces)
• Workflow
• Unit testing, doctests
Links
•   ArchGenXML presentation - http://www.jazkarta.com/presentations/archgenxml-presentation

•   ArchGenXML product page - http://plone.org/products/archgenxml

•   ArchGenXML getting started tutorial by Jens Klein

     •   http://plone.org/documentation/tutorial/archgenxml-getting-started

     •   PDF formatted: http://www.fraterdeus.com/downloads/ArchGenXML_PDF_0.2.1/view

•   Intro to Archetypes by Sidnei da Silva, published on ZopeMag.com

     •   http://www.zopemag.com/Issue006/Section_Articles/article_IntroToArchteypes.html

•   Archetypes: Customizing Plone in 60 seconds (PDF) by Andy McKay

     •   http://www.enfoldsystems.com/About/Talks/archetypes.pdf

•   Archetypes Quick Reference by Maik Röder

     •   http://plone.org/products/archetypes/documentation/manual/quickref/referencemanual-all-pages

•   Archetypes API

     •   http://api.plone.org/

Contenu connexe

Tendances

Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
Remy Sharp
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)
Ivan Chepurnyi
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
Rebecca Murphey
 

Tendances (20)

Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Android UI Tips & Tricks
Android UI Tips & TricksAndroid UI Tips & Tricks
Android UI Tips & Tricks
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
 
st_launcher: Tonel-based Smalltalk shell Scripts
 st_launcher: Tonel-based Smalltalk shell Scripts st_launcher: Tonel-based Smalltalk shell Scripts
st_launcher: Tonel-based Smalltalk shell Scripts
 
Google App Engine in 40 minutes (the absolute essentials)
Google App Engine in 40 minutes (the absolute essentials)Google App Engine in 40 minutes (the absolute essentials)
Google App Engine in 40 minutes (the absolute essentials)
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Using Objects to Organize your jQuery Code
Using Objects to Organize your jQuery CodeUsing Objects to Organize your jQuery Code
Using Objects to Organize your jQuery Code
 
A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End Devs
 
Plugin for Plugin, или расширяем Android New Build System. Антон Руткевич
 Plugin for Plugin, или расширяем Android New Build System. Антон Руткевич Plugin for Plugin, или расширяем Android New Build System. Антон Руткевич
Plugin for Plugin, или расширяем Android New Build System. Антон Руткевич
 
Intro to Angular.JS Directives
Intro to Angular.JS DirectivesIntro to Angular.JS Directives
Intro to Angular.JS Directives
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)
 
Progressive What Apps?
Progressive What Apps?Progressive What Apps?
Progressive What Apps?
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Overlays, Accordions & Tabs, Oh My
Overlays, Accordions & Tabs, Oh MyOverlays, Accordions & Tabs, Oh My
Overlays, Accordions & Tabs, Oh My
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
 

Similaire à Developing for Plone using ArchGenXML / ArgoUML

symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
Simon Willison
 
George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management
webcontent2007
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based Games
Ray Toal
 

Similaire à Developing for Plone using ArchGenXML / ArgoUML (20)

ArchGenXML / UML and Plone
ArchGenXML / UML and PloneArchGenXML / UML and Plone
ArchGenXML / UML and Plone
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Os Wilhelm
Os WilhelmOs Wilhelm
Os Wilhelm
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Extracting Plugins And Gems From Rails Apps
Extracting Plugins And Gems From Rails AppsExtracting Plugins And Gems From Rails Apps
Extracting Plugins And Gems From Rails Apps
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
 
George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Sprockets
SprocketsSprockets
Sprockets
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based Games
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 

Plus de Jazkarta, Inc.

Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in Plone
Jazkarta, Inc.
 

Plus de Jazkarta, Inc. (20)

Traveling through time and place with Plone
Traveling through time and place with PloneTraveling through time and place with Plone
Traveling through time and place with Plone
 
Questions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS FrontendQuestions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS Frontend
 
The User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and BeyondThe User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and Beyond
 
WTA and Plone After 13 Years
WTA and Plone After 13 YearsWTA and Plone After 13 Years
WTA and Plone After 13 Years
 
Collaborating With Orchid Data
Collaborating With Orchid DataCollaborating With Orchid Data
Collaborating With Orchid Data
 
Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!
 
Plone 5 Upgrades In Real Life
Plone 5 Upgrades In Real LifePlone 5 Upgrades In Real Life
Plone 5 Upgrades In Real Life
 
Accessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the UglyAccessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the Ugly
 
Getting Paid Without GetPaid
Getting Paid Without GetPaidGetting Paid Without GetPaid
Getting Paid Without GetPaid
 
An Open Source Platform for Social Science Research
An Open Source Platform for Social Science ResearchAn Open Source Platform for Social Science Research
An Open Source Platform for Social Science Research
 
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
 
Anatomy of a Large Website Project
Anatomy of a Large Website ProjectAnatomy of a Large Website Project
Anatomy of a Large Website Project
 
Anatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter NotesAnatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter Notes
 
The Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with PloneThe Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with Plone
 
Plone Hosting: A Panel Discussion
Plone Hosting: A Panel DiscussionPlone Hosting: A Panel Discussion
Plone Hosting: A Panel Discussion
 
Plone+Salesforce
Plone+SalesforcePlone+Salesforce
Plone+Salesforce
 
Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in Plone
 
Plone
PlonePlone
Plone
 
Online Exhibits in Plone
Online Exhibits in PloneOnline Exhibits in Plone
Online Exhibits in Plone
 
Online exhibits in Plone
Online exhibits in PloneOnline exhibits in Plone
Online exhibits in Plone
 

Dernier

Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Anamikakaur10
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Sheetaleventcompany
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
dlhescort
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
dlhescort
 

Dernier (20)

Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
 
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Falcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in indiaFalcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in india
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 

Developing for Plone using ArchGenXML / ArgoUML

  • 1. Developing for Plone using ArchGenXML / ArgoUML Plone Magic Camp Brooklyn, NY July 24, 2006 Nate Aune Jazkarta Consulting www.jazkarta.com
  • 2. Who am I? • Founder and developer, Jazkarta Consulting (www.jazkarta.com) • Musician - saxophonist and composer (www.nateaune.com/music/) • Founder of Plone4Artists project (www.plone4artists.org)
  • 3. Agenda • What is Archetypes? • What is UML? • What is ArchGenXML? • Build a model using ArgoUML • Transform the model into a Plone product • Questions?
  • 4. What is Archetypes? • Framework for developing Plone products • Automatically creates view and edit pages • Maintains unique object IDs • Creates references between objects
  • 5. Archetypes framework • Field validation • Standard security setup • Alternate storage options • Data transformation capabilities
  • 6. Archetypes schemas • Schema • Field • Widget • Field • Widget • ...
  • 7. Example Archetype: Artist schema= Schema(( StringField('title'), ImageField('photo'), LinesField('instrument'), )) class Artist(BaseContent) schema = BaseSchema + schema registerType(Artist,PROJECTNAME)
  • 8. Widgets schema= Schema(( StringField('title', widget=StringWidget( label=’Artist name’, size=20), ), ImageField('photo', widget=ImageWidget( label=’Headshot’), ), LinesField('instrument', widget=MultiSelectionWidget( label=’Instruments’), multiValue=1, ), ))
  • 9. What is UML? • UML = Uniform Modeling Language • Standard widely-adopted graphical language • Describes the artifacts of software systems • Focus on conceptual representations
  • 12. What is ArchGenXML? • Command line utility • Auto-generates code from a UML model • No round-trip support yet • Custom code is preserved upon regeneration
  • 13. Why use ArchGenXML? (part 1) • You want to save time • You are a lazy programmer • You don’t like to reinvent the wheel • You don’t like copying and pasting code • You make heavy use of references and interfaces
  • 14. Why use ArchGenXML? (part 2) • You have big projects with many different content types • You want or need a well-documented interface to your product • You like structured model- and pattern- driven software development • You want to maintain your project in the future without getting a headache
  • 15. UML to Archetypes using ArchGenXML schema= Schema(( StringField('title', widget=StringWidget( label=’Artist name’ size=20), ), ImageField('photo', widget=ImageWidget( label=’Headshot’), ), LinesField('instrument', widget=MultiSelectionWidget( label=’Instruments’), multiValue=1, ), ))
  • 16. UML speak to AT speak • package • product • class • content type • operation • method • attribute • field • tagged value • property • stereotype • subclass, view, etc.
  • 17. In practice 1. Save your model to the Products dir 2. Run the ArchGenXML script 3. Restart Zope 4. Install the newly generated product
  • 18. ArchGenXML components • ArchGenXML • Optional: • i18ndude • stripogram • ATBackRef • ATVocabularyManager • Relations
  • 19. Install ArchGenXML • Get PloneMagicCamp-bundle $ svn co svn://svn.plone4artists.org/trunk/PloneMagicCamp-bundle (* if you don’t have SVN, download the .zip file) $ cd $INSTANCE/Products $ ln -s /path/to/PloneMagicCamp-bundle/* . $ cd i18ndude; sudo /path/to/python setup.py install $ cd ../; ./getStripogram.sh $ cd stripogram; sudo /path/to/python setup.py install * If you don’t have SVN client, get the ZIP file. $ wget http://www.jazkarta.com/PloneMagicCamp-bundle.zip $ unzip PloneMagicCamp-bundle.zip
  • 20. Install ArgoUML • Use the pre-configured one that comes with the bundle • --OR-- download from http://argouml.tigris.org $ wget http://argouml-downloads.tigris.org/nonav/argouml-0.20/ ArgoUML-0.20.tar.gz $ tar xvfz ArgoUML-0.20.tar.gz $ cd ArgoUML-0.20 $ cp $INSTANCE_HOME/Products/ArchGenXML/argouml/argouml_profile.xmi . $ cp argouml.sh argouml.sh.orig; vi argouml.sh change line 48 to: ${JAVACMD} -Dargo.defaultModel=argouml_profile.xmi -jar $ {ARGO_HOME}/argouml-mdr.jar $* $ sh argouml.sh (to launch ArgoUML) --OR-- $ java -Dargo.defaultModel=argouml_profile.xmi -jar argouml-mdr.jar
  • 21. AGX options in ArgoUML!
  • 27. Running the script • Save project to $INSTANCE_HOME/Products/ArtistSite.zargo $ cd $INSTANCE_HOME/Products $ ArchGenXML/ArchGenXML.py -o ArtistSite ArtistSite.zargo ArchGenXML Version 1.5.0 svn/devel (c) 2003-2006 BlueDynamics, Austria, GNU General Public License 2.0 or later INFO Parsing... INFO Directory in which we're generating the files: 'ArtistSite'. INFO Generating... INFO Starting new Product: 'ArtistSite'. INFO Generating package 'content'. INFO Generating class 'Artist'. $
  • 28. ArtistSite product dir $ cd $INSTANCE_HOME/Products/ArtistSite $ ls content __init__.py i18n skins Extensions config.py refresh.txt version.txt $ cd content $ ls __init__.py Artist.py $ vi Artist.py
  • 29. Inspect Artist.py • Inserts documentation • Placeholders for custom code • i18n message ids • Using ArtistSite/model/generate_source.sh • inserts author information (ArtistSite.conf) • creates i18n generated.pot file (i18ndude) • strips HTML from doc strings (stripogram)
  • 30. Add new artist 1. Restart Zope 2. Install ArtistSite using QuickInstaller 3. Add new Artist
  • 33. Move model into product • Close ArgoUML since we are going to move the file $ cd $INSTANCE/Products $ mkdir ArtistSite/model $ mv ArtistSite.zargo ArtistSite/model $ ArchGenXML/ArchGenXML.py --sample-config ArtistSite/model/ ArtistSite.conf $ cp PloneMagicCamp-bundle/generate_source.sh ArtistSite/model/
  • 34. Edit ArtistSite.conf • Add your own author, email and copyright [DOCUMENTATION] strip-html: yes author: Nate Aune e-mail: natea (at) jazkarta (dot) com copyright: Jazkarta [GENERAL] outfile: ArtistSite
  • 35. Edit generate_source.sh • Change PYTHON_BIN to your Python #! /usr/bin/env bash PRODUCT_NAME=quot;ArtistSitequot; PRODUCTS_HOME=quot;`pwd`quot; PYTHON_BIN=quot;/sw/bin/python2.4quot; $PYTHON_BIN $PRODUCTS_HOME/ArchGenXML/ArchGenXML.py -c / $PRODUCTS_HOME/$PRODUCT_NAME/model/$PRODUCT_NAME.conf / $PRODUCTS_HOME/$PRODUCT_NAME/model/$PRODUCT_NAME.zargo
  • 36. Run generate_source.sh $ cd $INSTANCE_HOME/Products $ ArtistSite/model/generate_source.sh ArchGenXML Version 1.5.0 svn/devel (c) 2003-2006 BlueDynamics, Austria, GNU General Public License 2.0 or later INFO Parsing... INFO Directory in which we're generating the files: 'ArtistSite'. INFO Generating... INFO Starting new Product: 'ArtistSite'. INFO Generating package 'content'. INFO Generating class 'Artist'. $
  • 38. Add ATVM as dependency • Edit ArtistSite/AppConfig.py • Add line to: • DEPENDENCIES = ['ATVocabularyManager'] • Restart Zope • Reinstall ArtistSite
  • 39. Vocabulary Library • Go to Plone Setup and choose Vocabulary Library
  • 42. Tagged values • cd $INSTANCE/Products/ArchGenXML • ./TaggedValueSupport.py | more • ./TaggedValueSupport.py tagged-values.txt •
  • 43. Containment Use the solid rhomb to make a strict containment ‘Artist’ instances can only be added to an ‘Artists’ instance
  • 45. Give it a friendly name
  • 47. References Create a direct association results in: Reference field group to artist(s)
  • 49. Change the multiplicity (0..*) • Right-click the end point • Select Multiplicity 0..* (many artists in a group)
  • 50. Group edit form Group is associated with artists
  • 52. Configure browser widget Select the end point Make multivalued Specify relationship Define query
  • 55. Add ATBackRef as dependency • Edit ArtistSite/AppConfig.py • Change line to: • DEPENDENCIES = ['ATVocabularyManager', ‘ATBackRef’] • Restart Zope • Reinstall ArtistSite
  • 56. Back references Groups that artist belongs to
  • 57. Custom view for group folder
  • 58. Assign member stereotype Add the ‘member’ stereotype to tell ArchGenXML to subclass CMFMember
  • 60. Registration form • SiteMember is installed • Replaces default member • Easy way to create new member types
  • 61.
  • 62. PloneMall • Example of a sophisticated e-commerce framework built using UML • See the UML model here: • http://www.plonemall.com/uml/UML-beta2.png/image_view_fullscreen
  • 63. What I didn’t cover • Additional Stereotypes • actions, portal_tool, abstract, stub, ordered • portlets, configlet, customization policy • Generalization (Interfaces) • Workflow • Unit testing, doctests
  • 64. Links • ArchGenXML presentation - http://www.jazkarta.com/presentations/archgenxml-presentation • ArchGenXML product page - http://plone.org/products/archgenxml • ArchGenXML getting started tutorial by Jens Klein • http://plone.org/documentation/tutorial/archgenxml-getting-started • PDF formatted: http://www.fraterdeus.com/downloads/ArchGenXML_PDF_0.2.1/view • Intro to Archetypes by Sidnei da Silva, published on ZopeMag.com • http://www.zopemag.com/Issue006/Section_Articles/article_IntroToArchteypes.html • Archetypes: Customizing Plone in 60 seconds (PDF) by Andy McKay • http://www.enfoldsystems.com/About/Talks/archetypes.pdf • Archetypes Quick Reference by Maik Röder • http://plone.org/products/archetypes/documentation/manual/quickref/referencemanual-all-pages • Archetypes API • http://api.plone.org/