Your SlideShare is downloading. ×
Rapid Application Development in Plone - Paul Roe
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Rapid Application Development in Plone - Paul Roe

1,350
views

Published on

A case study regarding how a fairly complex learning system was developed in Plone by way of a tool that takes a UML diagram and converts it into working code.

A case study regarding how a fairly complex learning system was developed in Plone by way of a tool that takes a UML diagram and converts it into working code.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,350
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Hi I'm Paul from TheVirtual
  • I'm going to give brief introduction to using UML modelling and the ArchGenXML code generator. Quickly describe a more complicated real world web application . And then talk about some of the advantages that come with being able to use visual modelling in conjunction with ArchGenXML My hope is that you'll see the potential of these tools and give them a go.
  • We use ArgoUML. There are some relevant tutorials on the Plone site in the ArchGenXML howtos.
  • Initial ArgoUML screen. There's a UML Profile available for Archetypes which includes most of the stuff you need for getting things working.
  • As an example we'll subclass a Document and add a couple of fields.
  • Changing properties of fields, content types and relationships is easy. Select the field, Click tags and add tags to change the label, description and field level permissions etc You can add tags on the content type as well allowing permissions and many other properties to be controlled. We've set the modify permission on the field when we generate code later we'll see the label and write permissions have been set on the schema
  • Now we'll add a simple workflow. If you're happy with the default plone workflow you don't need to do anything as ArchGenXML takes care of that. But if you need something special adding a workflow to a content type is simple. Select the content type and add a statechart from the context menu You can also assign an existing workflow via a tag on the content type
  • Add workflow states and transitions, and events. Set permissions on the object and control access to the transitions
  • There are pros and cons of using code generation and gui tools for building applications. I've used a few systems in the past and I'm well aware of problems that can arise. Using version control on the models and generated code ensures that you understand whats going on when things are regenerated. Some of the many advantages are the reduction in boilerplate and ease of making major changes to the code base. Upgrades in Plone have also been much easier. The change to Generic Setup being one as new versions of ArchgenXML support the changes
  • Now we're going to generate the code, the first line invokes archgenxml. The rest is just a small part of the generated code for the schema in the content type. You can see the label and write permission on the field is set as per our model.
  • Throughout all the generated files there are plenty of places to put custom code which is kept across rebuilds. ArchGenXML builds the entire file structure and sets up the profiles for install and configuration
  • This all took about as long to explain as to actually do it! The real value of the UML diagramming and ArchGenXML comes when building something more complicated.
  • Its all very well being able to demo easy stuff, but how practical is it in the real world working with customers. These are a couple of the UML models from a real project.
  • Steve was well prepared and at our first meeting I suggested that the best way forward was to use use a GUI tool to analyse and explore the project. By collaboratively building a visual model of the application we would both better understand the project, and be able to work through any complex relationships and workflows more easily. We had regular meetings for an hour or two. With builds, extra custom code and testing done between. The previous image shows parts of that project.
  • There's not a lot of time to go into detail, but in this and the next few slides I'll show a few small parts that correspond to the simple demo at the start This is one of the simple workflows from the project Its reused over a few content types
  • This shows the permissions on a state in a training workflow. It shows who can access and change the object. The worklist tag means that when the object is in this state it appears in a review list similar to what a Reviewer would see with pending items.
  • This shows the properties on a transition in a workflow. Events can be fired on transitions. We setup a subscriber in the Effect Field. The subscriber in this case is fired when someone passes part of a course. This does a few checks and can change the state of their course to Passed if they've completed everything. It generates all the boiler plate for the Subscriber, just leaving the actual checks to be coded. There's a lot more to show, but that all we have time for.
  • Steve best sums up the advantages of UML, ArchGenXML and Plone. It really works well and the more input from the customer the better it works! Thanks – Questions? Steve is happy to talk to people he's at nzihf.co.nz
  • Thanks
  • Transcript

    • 1.  
    • 2. Rapid Application Development in Plone Presenter: Paul Roe Company: The Virtual Limited Building Plone sites since 2002 www. the virtual .co.nz
    • 3. People get pictures “When you talk code, logic or in abstract it hurts the head of the client and misses that rare opportunity to use the client's eyes and ears at the same time”. Steven Gourley
    • 4. Pictures
        UML (Unified Modelling Language)
        • General purpose visual modelling language.
        • 5. We're interested in data models (entities and relationships), workflows and events.
        Gui Tools
        • ArgoUML http://argouml.tigris.org/
        • 6. Poseidon http://www.gentleware.com/
        • 7. ObjectDomain http://www.objectdomain.com/
    • 8. ArgoUML
    • 9. Simple Content
    • 10. Field Properties (tags)
    • 11. Add Workflow (Statechart)
    • 12. States and transitions
    • 13. ArchGenXML
      • http://plone.org/products/archgenxml
      • 14. code generator
      • 15. Generates Python code from UML-Models (XMI-Format)
      • Take advantage of version control
      • 16. Plone and Archetypes changes
    • 17. Generate $ archgenxml -c generate.conf PhotoDoc.zargo schema = Schema(( ImageField( name='photo', widget=ImageField._properties['widget']( label='Photo', label_msgid='PhotoDoc_label_photo', i18n_domain='PhotoDoc', ), storage=AnnotationStorage(), write_permission="PhotoDoc: Modify Images", label="An Image", ), StringField( name='code', widget=StringField._properties['widget']( label='Code',
    • 18. Manual Code class photodoc(BaseContent, BrowserDefaultMixin): """ """ security = ClassSecurityInfo() implements(interfaces.Iphotodoc) meta_type = 'photodoc' _at_rename_after_creation = True schema = photodoc_schema ##code-section class-header #fill in your manual code here ##/code-section class-header # Methods registerType(photodoc, PROJECTNAME) # end of class photodoc ##code-section module-footer #fill in your manual code here ##/code-section module-footer
    • 19. Install Copy across product, restart plone and you can install in a plone site.
    • 20. Something More Complicated
    • 21. A real project Steve Gourley approached us with the plan to build a web application for his Heath and Fitness Training and Recruitment company (NZIHF).
    • 22. Simple Workflow
    • 23. Permissions
    • 24. Events
    • 25. Steve Gourley - NZIHF “ A significant feature in attaining a good result for us was the opportunity to see the object and its relationships to other objects” “ We had no idea the thing was then generating code, but we did know what was being talked about and therefore had a richer exploration of what we wanted in a more economic (time, which is money in development too!) way”.
    • 26. Rapid Application Development in Plone Presenter: Paul Roe Company: The Virtual Limited Building Plone sites since 2002 www. the virtual .co.nz