SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
What‘s
new
in
Apache
Lenya
1.4?

           
Andreas
Hartmann
            BeCompany
GmbH




                               1
Agenda

Modularization
UUIDs
for
internal
links
Repository
API
changes
Configurable
Meta
Data
Publication
Templating
Usecase
Framework
Notification
and
Inboxes



                           2
Modularization




                 3
Goals
of
Modularization

• Improve
Separation
of
Concerns
• Reuse
functionality
• Loose
coupling
of
functional
areas
• Better
maintainability
• Reduce
learning
curve
• Easier
extensibility




                                       4
Modularization
Module




                            Module
             Editor X                                  ...
                                     Resource Type A
         Integration Code



         Foo Service API
Module




                            Module
                                        Alternative    ...
                                         Foo Impl
         Default Foo Impl


                                     API
Core




                                     Impl



                                                             5
Module
Deployment

cocoon.xconf
modules.root.dirs=src/modules: 
                  src/webapp/lenya/pubs/default/modules: 
                  /home/john/lenya/modules

modules.copy=false




                                                             6
Directory
Structure
mymodule/
  config/                  configuration files
    module.xml             module descriptor
    cocoon-xconf/          patches for cocoon.xconf
      services.xconf
    sitemap/               patches for main Lenya sitemap
      transformers.xconf
  usecases/
    myusecase.jx           usecase view
  resources/
    images/                image files
    css/                   CSS files
    schemas/               XML schemas (RNG, XSD, ...)
    samples/               Samples (in case of resource type modules)
  java/
    src/                   Java   source files
    test/                  Java   test classes
    lib/                   Java   libraries
  xslt/                    XSLT   stylesheets
  sitemap.xmap             main   module sitemap




                                                                        7
Modularization
Descriptor
of
the
access
control
module
<module xmlns=quot;http://apache.org/lenya/module/1.0quot;>
  <id>org.apache.lenya.modules.ac</id>
  <export package=quot;org.apache.lenya.ac.filequot;/>
  <depends module=quot;org.apache.lenya.modules.cachequot;/>
  <package>org.apache.lenya.modules</package>
  <version>0.1-dev</version>
  <name>Access control</name>
  <lenya-version>@lenya.version@</lenya-version>
  <description>Access control</description>
</module>




                                                       8
Module
API
 Stable

                                   org.project.foo.*
              Foo Service API
     Module




                                   org.project.foo.impl.*
              Default Foo Impl
                                   org.project.foo.util.*
                                   org.otherproject.*
Subject
to

 Change
                 <module>
                   ...
                   <export package=quot;org.project.fooquot;/>
                   ...
                 </module>




                                                            9
Module
Dependencies
Foo   <module>
        <id>org.project.modules.foo</id>
        <export package=quot;org.project.fooquot;/>
      </module>

Bar   <module>
        <id>com.company.modules.bar</id>
        <depends module=quot;org.project.modules.fooquot;/>
      </module>
                   package com.company.bar;

                   import org.project.foo.*;
                   import org.project.foo.impl.*;

                   class SomeService { ...




                                                      10
Requests
to
Module
Sitemaps


• cocoon://modules/foo/...

• http://.../index.html?lenya.module=foo

• http://.../modules/foo/...

• http://.../mypub/modules/foo/...




                                           11
Next
Steps

• Requirements
  • Easy
installation
  • Hot-deploying
modules
  • Versioning
of
modules
• Approaches
  • Maven
  • OSGi




                            12
UUIDs
for
internal
links




                           13
What
is
a
UUID?

• Universally
Unique
Identifier
• Standardized
by
the
Open
Software
Foundation
• Canonical
form:
32
hexadecimal
digits
  550e8400-e29b-41d4-a716-446655440000
• Neglectable
risk
of
duplicates:
UUID-based

  collections
can
be
combined
without
problems




                                                 14
Advantages
of
UUIDs


• Separation
of
Concerns:
No
duplication
of
URL

  information
(sitetree
and
document
path)
• No
need
to
copy/move
files
when
URLs
change
• No
need
for
link
rewriting
when
URLs
change
• Multiple
views
(URL
spaces)
for
document
space
• Document
collections
can
be
combined
(import)




                                                   15


           <<interface>> LinkResolver                            Link
MODE_DEFAULT_LANGUAGE                                  getUri() : String
MODE_FAIL                                              getPubId() : String
                                                       getArea() : String
resolve(sourceDocument, uri) : LinkTarget
                                                       getUuid() : String
getFallbackMode() : int
                                                       getLanguage() : String
setFallbackMode(int)


           <<interface>> LinkManager                         LinkTarget
getLinksFrom(sourceDocument) : Link[]             exists() : boolean
getReferencingDocuments(targetDoc) : Document[]   getDocument() : document
                                                  isRevisionSpecified() : boolean
                                                  getRevisionNumber() : int

ContentLinkManager

                                                      UuidToUrlRewriter

              <<interface>>                         OutgoingLinkRewriter
              LinkRewriter
                                                    IncomingLinkRewriter
          matches(url) : boolean
          rewrite(url) : String
                                                      UrlToUuidRewriter


                                                                                    16
Link
Transformers


• UuidToUrlTransformer
  • urls
=
absolute
|
relative
• ProxyTransformer
• IncomingProxyTransformer
• UrlToUuidTransformer




                                 17
Next
Steps



• More
efficient
LinkManager
implementations
  • Based
on
meta
data?




                                               18
Repository
API
Changes




                         19
Content
Handling
Layers
Modules
              CollectionWrapper            AddNewsMessage



Lenya Core
                             Publication


                                  Area                      SiteStructure


                             Document          Link          SiteNode



Repository
             Session              Node          History


                             MetaData



                                                                            20


   <<interface>>                          <<interface>> MetaDataOwner
      Session
commit()
rollback()
                                          <<interface>> ContentHolder
                               exists() : boolean
           *
                               getContentLength() : long
   <<interface>>               getInputStream() : InputStream
  RepositoryItem               getlastModified() : long
                               getMimeType() : String
                               getSourceURI() : String




                      <<interface>> Node
             checkin(), checkout()                                      SourceNode
             lock(), unlock()
             exists() : boolean
             delete()
             getChildren() : Collection                             JCRSourceNode
             getHistory() : History



                                                                                     21
<<interface>> SiteStructure
               <<interface>>
                                          getNodes() : SiteNode[]
                Publication
                                          getNode(path) : SiteNode
         getAreaNames() : String[]        getByUuid(uuid, language) : Link
         getArea(String) : Area           contains(path) : boolean
                                          contains(path, language) : boolean
                                          containsByUuid(uuid, language) : booelan
                       *                  add(path) : SiteNode
                                          add(path, Document) : Link
            <<interface>> Area
getDocuments() : Document[]
                                                                  *
getDocument(uuid, language) : Document              <<interface>> SiteNode
contains(uuid, language) : boolean
                                                getUuid() : String
getSite() : SiteStructure
                                                getChildren() : SiteNode[]
                                                hasLink(language) : boolean
                                                getLink(language) : Link
                       *                        isVisible() : boolean
               <<interface>>                    setVisible(boolean)
                 Document
                                                                  *
    getUUID() : String
                                                      <<interface>> Link
    getLanguages() : String[]
    getTranslation(String) : Document           getLanguage() : String
    getRepositoryNode() : Node                  getLabel() : String
                                         0..1
    getInputStream() : InputStream              setLabel(String)
    getOutputStream() : OutputStream            getDocument() : Document


                                                                                     22


                              <<interface>> Collection
                    getDocuments() : Document[]
                    add(Document)
                    remove(Document)
                    clear()
                    contains(Document) : boolean




                                  CollectionWrapper
   <<interface>>        checkin(), checkout()
     Document           lock(), unlock()
                        exists() : boolean
getInputStream()
                        delete()
                                                          <<interface>> Usecase
getOutputStream()
                        getChildren() : Collection
                        getHistory() : History           execute()



                                     NewsWrapper            AddNewsMessage
                        addNewsMessage(NewsMessage)      execute()




                                                                                  23
Next
Steps



• Queryable
meta
data
    String xPath = “*[@media:width &gt; 100]“;
    Query query = new XPathQuery(xPath);
    Document[] docs = area.getDocuments(query);




                                                  24
Code
Example
public void addNewsDocument(String newsPath, String uuid, String language) {

    Session session = RepositoryUtil.getSession(this.manager, this.request);
    DocumentFactory factory
        = DocumentUtil.getDocumentFactory(this.manager, this.request);

    String webappUrl = ServletHelper.getWebappUrl(this.request);
    URLInformation info = new URLInformation(webappUrl);
    Publication pub = factory.getPublication(info.getPublicationId());

    Area authoring = pub.getArea(„authoring“);
    Document[] docs = authoring.getDocuments();
    Document messageDoc = authoring.getDocument(uuid, language);

    SiteStructure site = authoring.getSite();
    SiteNode node = site.getNode(newsPath);
    String[] languages = node.getLanguages();
    Link link = node.getLink(language);
    Document newsDoc = link.getDocument();

    NewsWrapper newsWrapper = new NewsWrapper(newsDoc, getLogger());
    wrapper.add(0, messageDoc);
}


                                                                               25
Configurable
Meta
Data




                         26


              <<interface>>                      <<interface>> MetaDataRegistry
             MetaDataOwner
                                            getElementSet(namespaceUri) : ElementSet
getMetaData(namespaceUri) : MetaData        getNamespaceUris() : String[]
getMetaDataNamespaceUris() : String[]       register(namespaceUri, elementSet)
                                            isRegistered(namespaceUri) : boolean

                       *
                                                                   *
              <<interface>>
                                                    <<interface>> ElementSet
                MetaData
                                                getNamespaceUri() : String
getAvailableKeys()
                                                getElements() : Element[]
addValue(key, value)
                                                getElement(name) : element
setValue(key, value)
                                                containsElement(name) : boolean
getValues(key)

                                                                   *
                                                      <<interface>> Element
                                                     ONCOPY_COPY
                                                     ONCOPY_DELETE
                                                     ONCOPY_IGNORE
                                                     getName() : String
                                                     isEditable() : String
                                                     isMultiple() : String
                                                     getActionOnCopy() : int



                                                                                       27
Meta-Data
Code
Example
<meta-data>
  ...
  <component-instance
      name=quot;http://apache.org/lenya/metadata/media/1.0quot;
      class=quot;org.apache.lenya.cms.metadata.ConfigurableElementSetquot;>
    <element name=quot;filenamequot; multiple=quot;falsequot;/>
    <element name=quot;widthquot; multiple=quot;falsequot;/>
    <element name=quot;heightquot; multiple=quot;falsequot;/>
  </component-instance>
  ...
</meta-data>


String mediaNamespace = quot;http://apache.org/lenya/metadata/media/1.0quot;;
MetaData metaData = document.getMetaData(mediaNamespace);
String width = metaData.getFirstValue(quot;widthquot;);




                                                                        28
Publication
Templating




                         29
Chemistry

       Math

                 Science
      Physics


      Biology
                                          


                             University




      English


      French

     Spanish
                 Languages




      Italian
30
Overriding
Resources
                                                  @import ...

University
                XSLT A          XSLT B     main.css     head.css



 Science
                XSLT A          XSLT B'    main.css     head.css



   Physics
                XSLT A          XSLT B''   main.css     head.css



                 <xsl:import>



                                                                   31
Templating
API

          <<interface>>                                    <<interface>>
           Instantiator                             PublicationTemplateManager
instantiate(templatePub, id, name)       visit(publication, publicationVisitor)
                                         visit(publication, path, sourceVisitor)


        <<interface>>                      <<interface>>                    <<interface>>
        SourceVisitor                 VisitingSourceResolver              PublicationVisitor
visit(resolver, sourceUri)           getSource() : Source                visit(publication)


                                                                ExistingSourceResolver
AllExistingSourceResolver
getUris() : String[]                                        ExistingAncestorSourceResolver




                                                                                               32
Publication
and
Source
Visitors
• Bottom-up
traversal
of
publication
tree
• PublicationVisitor
  General
purpose
• ExistingSourceResolver
-
fallback://
  Find
first
existing
source
• ExistingAncestorSourceResolver
-
template-fallback://
  Find
second
existing
source
(works
only
for
leaf
source!)
• AllExistingSourceResolver
-
aggregate-fallback://
  Find
all
existing
sources



                                                              33
Usecase
Framework




                    34
Usecases

• User
interaction
  • Typically
form-based
  • Edit
and
manage
content
  • Interact
with
other
applications
(newsletter)
  • Functionality
for
website
visitors
(contact
form)
  • ...
• Triggered
using
a
request
parameter
(lenya.usecase)
• Full
screen
or
document-based




                                                        35

                           continuation

                               Form                   Form



                                      !                       !
                           Template                Template
     View


             Sitemap + Flowscript
Controller
                               !
             Usecase Handler

                                           vali-
                                          dation
                  Documents, ...                         Documents, ...
   Model




                                                                                 36
Declaring
a
Usecase
<component-instance name=quot;site.createquot;
    class=quot;o.a.lenya.cms.site.usecases.CreateDocumentquot;>

  <view template=quot;modules/.../usecases/site/create.jxquot;>
    <parameter name=“...“ value=“...“/>
  </view>

  <parameter name=“...“ value=“...“/>
  <parameter name=“...“ value=“...“/>

  <transaction policy=“pessimistic“/>
  <exit usecase=“...“>
    <parameter name=“...“ value=“...“/>
  </exit>

</component-instance>


                                                          37
Example
Usecase:
        <<interface>>
           Usecase

                                          Contact
Form
initParameters()
checkPreconditions()
advance()
checkExecutionConditions()
execute()
                                                <<interface>>
checkPostconditions()
                                                UserManager
                                      getUser(userId) : User
      AbstractUsecase
                                                <<interface>>
                                                   Notifier
                                      notify(recipients, sender, message)
        ContactForm




                             MailNotifier        SmsNotifier          InboxNotifier



                                                                                      38
Notification
and

    Inboxes




                    39


         <<interface>>                    <<interface>>                       RepositoryEvent
            Notifier                    RepositoryListener
                                                                         getDescriptor() : Object
       notify(message)              eventFired(RepositoryEvent)


                                                                                   Object

        AbstractNotifier               NotificationListener
notify(message)
                                                                       NotificationEventDescriptor
notify(user, translatedMessage)
translateMessage(locale, message)
                                                                       getMessage() : Message



                                                                                Message
                                                                  getSender() : Identifiable
   EmailNotifier
                                                                  getSubject() : String
                                                                  getSubjectParameters() : String[]
                   InboxNotifier
                                                                  getBody() : String
                                                                  getBodyParameters() : String[]
                                                                  getTime() : Date




                                                                                                      40
Creating
a
Message
User recipient = userManager.getUser(userId);
Identifiable[] recipients = { recipient };

String subject = quot;publish-notificationquot;;
String[] subjectParams = {};

String body = quot;document-was-publishedquot;
String[] bodyParams = {
    DublinCoreHelper.getTitle(document) };

Message message = new Message(subject,
                              subjectParams,
                              body,
                              bodyParams,
                              sender,
                              recipients);


                                                41
Sending
Notification
Messages
a)
Directly
   • Immediate
notification
    NotificationUtil.notify(this.manager, message);



b)
Via
repository
observation
  • Notification
when
(if)
session
is
committed
    NotificationEventDescriptor descriptor
        = new NotificationEventDescriptor(message);
    RepositoryEvent event = RepositoryEventFactory
        .createEvent(this.manager, authoringDocument,
                     getLogger(), descriptor);
    getSession().enqueueEvent(event);



                                                        42
Inbox
API
        <<interface>>
        InboxManager
getInbox(User) : Inbox


        <<interface>>
            Inbox
getMessages() : InboxMessage[]
getMessage(id) : InboxMessage
add(message)
remove(message)


                 *
                                               Message
        <<interface>>
        InboxMessage             getSender() : Identifiable
                                 getSubject() : String
getId() : String
                                 getSubjectParameters() : String[]
getMessage() : Message
                                 getBody() : String
isMarkedAsRead() : boolean
                                 getBodyParameters() : String[]
markAsRead(boolean)
                                 getTime() : Date


                                                                     43
Configuring
Notification

cocoon.xconf

Lenya
Inbox:
<component logger=quot;lenya.notificationquot;
    role=quot;org.apache.lenya.notification.Notifierquot;
    class=quot;org.apache.lenya.inbox.InboxNotifierquot;/>


E-Mail:
<component logger=quot;lenya.notificationquot;
    role=quot;org.apache.lenya.notification.Notifierquot;
    class=quot;org.apache.lenya.notification.EmailNotifierquot;>
  <smtp host=quot;localhostquot; username=quot;johnquot; password=quot;...quot;/>
</component>




                                                            44
Questions
and

 Discussion




                 45

Mais conteúdo relacionado

Mais procurados

Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the frameworkGOG.com dev team
 
CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011Alexander Klimetschek
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work TogetherSubbu Allamaraju
 
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010Jagadish Prasath
 
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
Java EE 6 = Less Code + More Power (Tutorial)  [5th IndicThreads Conference O...Java EE 6 = Less Code + More Power (Tutorial)  [5th IndicThreads Conference O...
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...IndicThreads
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shintutorialsruby
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guideducquoc_vn
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communicationsWO Community
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourCarl Brown
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Leonardo Soto
 
Rapid prototyping search applications with solr
Rapid prototyping search applications with solrRapid prototyping search applications with solr
Rapid prototyping search applications with solrLucidworks (Archived)
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Leonardo Soto
 

Mais procurados (20)

Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the framework
 
CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work Together
 
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
 
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
Java EE 6 = Less Code + More Power (Tutorial)  [5th IndicThreads Conference O...Java EE 6 = Less Code + More Power (Tutorial)  [5th IndicThreads Conference O...
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
 
Jsf
JsfJsf
Jsf
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
RicoLiveGrid
RicoLiveGridRicoLiveGrid
RicoLiveGrid
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shin
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guide
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communications
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A Tour
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM Optimization
 
Jsp Notes
Jsp NotesJsp Notes
Jsp Notes
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)
 
Rapid prototyping search applications with solr
Rapid prototyping search applications with solrRapid prototyping search applications with solr
Rapid prototyping search applications with solr
 
Aimaf
AimafAimaf
Aimaf
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)
 

Destaque

Mercedes Benz
Mercedes BenzMercedes Benz
Mercedes Benzpluszowyy
 
Ww2 tanks
Ww2 tanksWw2 tanks
Ww2 tankssgtjoe
 
Dansedu Handen
Dansedu HandenDansedu Handen
Dansedu Handenfilipb
 
Zend Framework Push Notifications
Zend Framework Push NotificationsZend Framework Push Notifications
Zend Framework Push NotificationsMike Willbanks
 
Augmented Reality with Open Source Software
Augmented Reality with Open Source SoftwareAugmented Reality with Open Source Software
Augmented Reality with Open Source Softwarenobby
 
RabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeRabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeLenz Gschwendtner
 
Aula 01 IntroduçãO E MéTodos
Aula 01   IntroduçãO E MéTodosAula 01   IntroduçãO E MéTodos
Aula 01 IntroduçãO E MéTodosProfGilson Malta
 
Why databases suck for messaging
Why databases suck for messagingWhy databases suck for messaging
Why databases suck for messagingRabbit MQ
 
Notification Framework
Notification FrameworkNotification Framework
Notification FrameworkSokna Ly
 
Weather British Weather And Climate
Weather   British Weather And ClimateWeather   British Weather And Climate
Weather British Weather And Climatejohn.payne
 
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...将之 小野
 
Microservices Architectures on Amazon Web Services
Microservices Architectures on Amazon Web ServicesMicroservices Architectures on Amazon Web Services
Microservices Architectures on Amazon Web ServicesAmazon Web Services
 

Destaque (14)

Mercedes Benz
Mercedes BenzMercedes Benz
Mercedes Benz
 
Ww2 tanks
Ww2 tanksWw2 tanks
Ww2 tanks
 
Pr Meets The Blogs
Pr Meets The BlogsPr Meets The Blogs
Pr Meets The Blogs
 
Building An Open Progressive Community
Building An Open Progressive CommunityBuilding An Open Progressive Community
Building An Open Progressive Community
 
Dansedu Handen
Dansedu HandenDansedu Handen
Dansedu Handen
 
Zend Framework Push Notifications
Zend Framework Push NotificationsZend Framework Push Notifications
Zend Framework Push Notifications
 
Augmented Reality with Open Source Software
Augmented Reality with Open Source SoftwareAugmented Reality with Open Source Software
Augmented Reality with Open Source Software
 
RabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeRabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = Awesome
 
Aula 01 IntroduçãO E MéTodos
Aula 01   IntroduçãO E MéTodosAula 01   IntroduçãO E MéTodos
Aula 01 IntroduçãO E MéTodos
 
Why databases suck for messaging
Why databases suck for messagingWhy databases suck for messaging
Why databases suck for messaging
 
Notification Framework
Notification FrameworkNotification Framework
Notification Framework
 
Weather British Weather And Climate
Weather   British Weather And ClimateWeather   British Weather And Climate
Weather British Weather And Climate
 
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
 
Microservices Architectures on Amazon Web Services
Microservices Architectures on Amazon Web ServicesMicroservices Architectures on Amazon Web Services
Microservices Architectures on Amazon Web Services
 

Semelhante a What's New In Apache Lenya 1.4

symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratiqueSimon Morvan
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJiayun Zhou
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012Arun Gupta
 
Creating your own framework on top of Symfony2 Components
Creating your own framework on top of Symfony2 ComponentsCreating your own framework on top of Symfony2 Components
Creating your own framework on top of Symfony2 ComponentsDeepak Chandani
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh! Chalermpon Areepong
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionCloudera, Inc.
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For ManagersAgileThought
 
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...Mark A
 
Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Eugenio Minardi
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java PlatformSivakumar Thyagarajan
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in AdaStephane Carrez
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsSadayuki Furuhashi
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration BackendArun Gupta
 

Semelhante a What's New In Apache Lenya 1.4 (20)

symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSF
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012
 
Creating your own framework on top of Symfony2 Components
Creating your own framework on top of Symfony2 ComponentsCreating your own framework on top of Symfony2 Components
Creating your own framework on top of Symfony2 Components
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Knolx session
Knolx sessionKnolx session
Knolx session
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault Injection
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
 
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
 
Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration Backend
 

Último

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

What's New In Apache Lenya 1.4

  • 1. What‘s
new
in Apache
Lenya
1.4? 
Andreas
Hartmann BeCompany
GmbH 1
  • 4. Goals
of
Modularization • Improve
Separation
of
Concerns • Reuse
functionality • Loose
coupling
of
functional
areas • Better
maintainability • Reduce
learning
curve • Easier
extensibility 4
  • 5. Modularization Module Module Editor X ... Resource Type A Integration Code Foo Service API Module Module Alternative ... Foo Impl Default Foo Impl API Core Impl 5
  • 6. Module
Deployment cocoon.xconf modules.root.dirs=src/modules: src/webapp/lenya/pubs/default/modules: /home/john/lenya/modules modules.copy=false 6
  • 7. Directory
Structure mymodule/ config/ configuration files module.xml module descriptor cocoon-xconf/ patches for cocoon.xconf services.xconf sitemap/ patches for main Lenya sitemap transformers.xconf usecases/ myusecase.jx usecase view resources/ images/ image files css/ CSS files schemas/ XML schemas (RNG, XSD, ...) samples/ Samples (in case of resource type modules) java/ src/ Java source files test/ Java test classes lib/ Java libraries xslt/ XSLT stylesheets sitemap.xmap main module sitemap 7
  • 8. Modularization Descriptor
of
the
access
control
module <module xmlns=quot;http://apache.org/lenya/module/1.0quot;> <id>org.apache.lenya.modules.ac</id> <export package=quot;org.apache.lenya.ac.filequot;/> <depends module=quot;org.apache.lenya.modules.cachequot;/> <package>org.apache.lenya.modules</package> <version>0.1-dev</version> <name>Access control</name> <lenya-version>@lenya.version@</lenya-version> <description>Access control</description> </module> 8
  • 9. Module
API Stable org.project.foo.* Foo Service API Module org.project.foo.impl.* Default Foo Impl org.project.foo.util.* org.otherproject.* Subject
to
 Change <module> ... <export package=quot;org.project.fooquot;/> ... </module> 9
  • 10. Module
Dependencies Foo <module> <id>org.project.modules.foo</id> <export package=quot;org.project.fooquot;/> </module> Bar <module> <id>com.company.modules.bar</id> <depends module=quot;org.project.modules.fooquot;/> </module> package com.company.bar; import org.project.foo.*; import org.project.foo.impl.*; class SomeService { ... 10
  • 12. Next
Steps • Requirements • Easy
installation • Hot-deploying
modules • Versioning
of
modules • Approaches • Maven • OSGi 12
  • 14. What
is
a
UUID? • Universally
Unique
Identifier • Standardized
by
the
Open
Software
Foundation • Canonical
form:
32
hexadecimal
digits 550e8400-e29b-41d4-a716-446655440000 • Neglectable
risk
of
duplicates:
UUID-based
 collections
can
be
combined
without
problems 14
  • 15. Advantages
of
UUIDs
 • Separation
of
Concerns:
No
duplication
of
URL
 information
(sitetree
and
document
path) • No
need
to
copy/move
files
when
URLs
change • No
need
for
link
rewriting
when
URLs
change • Multiple
views
(URL
spaces)
for
document
space • Document
collections
can
be
combined
(import) 15
  • 16. <<interface>> LinkResolver Link MODE_DEFAULT_LANGUAGE getUri() : String MODE_FAIL getPubId() : String getArea() : String resolve(sourceDocument, uri) : LinkTarget getUuid() : String getFallbackMode() : int getLanguage() : String setFallbackMode(int) <<interface>> LinkManager LinkTarget getLinksFrom(sourceDocument) : Link[] exists() : boolean getReferencingDocuments(targetDoc) : Document[] getDocument() : document isRevisionSpecified() : boolean getRevisionNumber() : int ContentLinkManager UuidToUrlRewriter <<interface>> OutgoingLinkRewriter LinkRewriter IncomingLinkRewriter matches(url) : boolean rewrite(url) : String UrlToUuidRewriter 16
  • 17. Link
Transformers • UuidToUrlTransformer • urls
=
absolute
|
relative • ProxyTransformer • IncomingProxyTransformer • UrlToUuidTransformer 17
  • 20. Content
Handling
Layers Modules CollectionWrapper AddNewsMessage Lenya Core Publication Area SiteStructure Document Link SiteNode Repository Session Node History MetaData 20
  • 21. <<interface>> <<interface>> MetaDataOwner Session commit() rollback() <<interface>> ContentHolder exists() : boolean * getContentLength() : long <<interface>> getInputStream() : InputStream RepositoryItem getlastModified() : long getMimeType() : String getSourceURI() : String <<interface>> Node checkin(), checkout() SourceNode lock(), unlock() exists() : boolean delete() getChildren() : Collection JCRSourceNode getHistory() : History 21
  • 22. <<interface>> SiteStructure <<interface>> getNodes() : SiteNode[] Publication getNode(path) : SiteNode getAreaNames() : String[] getByUuid(uuid, language) : Link getArea(String) : Area contains(path) : boolean contains(path, language) : boolean containsByUuid(uuid, language) : booelan * add(path) : SiteNode add(path, Document) : Link <<interface>> Area getDocuments() : Document[] * getDocument(uuid, language) : Document <<interface>> SiteNode contains(uuid, language) : boolean getUuid() : String getSite() : SiteStructure getChildren() : SiteNode[] hasLink(language) : boolean getLink(language) : Link * isVisible() : boolean <<interface>> setVisible(boolean) Document * getUUID() : String <<interface>> Link getLanguages() : String[] getTranslation(String) : Document getLanguage() : String getRepositoryNode() : Node getLabel() : String 0..1 getInputStream() : InputStream setLabel(String) getOutputStream() : OutputStream getDocument() : Document 22
  • 23. <<interface>> Collection getDocuments() : Document[] add(Document) remove(Document) clear() contains(Document) : boolean CollectionWrapper <<interface>> checkin(), checkout() Document lock(), unlock() exists() : boolean getInputStream() delete() <<interface>> Usecase getOutputStream() getChildren() : Collection getHistory() : History execute() NewsWrapper AddNewsMessage addNewsMessage(NewsMessage) execute() 23
  • 24. Next
Steps • Queryable
meta
data String xPath = “*[@media:width &gt; 100]“; Query query = new XPathQuery(xPath); Document[] docs = area.getDocuments(query); 24
  • 25. Code
Example public void addNewsDocument(String newsPath, String uuid, String language) { Session session = RepositoryUtil.getSession(this.manager, this.request); DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, this.request); String webappUrl = ServletHelper.getWebappUrl(this.request); URLInformation info = new URLInformation(webappUrl); Publication pub = factory.getPublication(info.getPublicationId()); Area authoring = pub.getArea(„authoring“); Document[] docs = authoring.getDocuments(); Document messageDoc = authoring.getDocument(uuid, language); SiteStructure site = authoring.getSite(); SiteNode node = site.getNode(newsPath); String[] languages = node.getLanguages(); Link link = node.getLink(language); Document newsDoc = link.getDocument(); NewsWrapper newsWrapper = new NewsWrapper(newsDoc, getLogger()); wrapper.add(0, messageDoc); } 25
  • 27. <<interface>> <<interface>> MetaDataRegistry MetaDataOwner getElementSet(namespaceUri) : ElementSet getMetaData(namespaceUri) : MetaData getNamespaceUris() : String[] getMetaDataNamespaceUris() : String[] register(namespaceUri, elementSet) isRegistered(namespaceUri) : boolean * * <<interface>> <<interface>> ElementSet MetaData getNamespaceUri() : String getAvailableKeys() getElements() : Element[] addValue(key, value) getElement(name) : element setValue(key, value) containsElement(name) : boolean getValues(key) * <<interface>> Element ONCOPY_COPY ONCOPY_DELETE ONCOPY_IGNORE getName() : String isEditable() : String isMultiple() : String getActionOnCopy() : int 27
  • 28. Meta-Data
Code
Example <meta-data> ... <component-instance name=quot;http://apache.org/lenya/metadata/media/1.0quot; class=quot;org.apache.lenya.cms.metadata.ConfigurableElementSetquot;> <element name=quot;filenamequot; multiple=quot;falsequot;/> <element name=quot;widthquot; multiple=quot;falsequot;/> <element name=quot;heightquot; multiple=quot;falsequot;/> </component-instance> ... </meta-data> String mediaNamespace = quot;http://apache.org/lenya/metadata/media/1.0quot;; MetaData metaData = document.getMetaData(mediaNamespace); String width = metaData.getFirstValue(quot;widthquot;); 28
  • 30. Chemistry Math Science Physics Biology 

 University English French Spanish Languages Italian 30
  • 31. Overriding
Resources @import ... University XSLT A XSLT B main.css head.css Science XSLT A XSLT B' main.css head.css Physics XSLT A XSLT B'' main.css head.css <xsl:import> 31
  • 32. Templating
API <<interface>> <<interface>> Instantiator PublicationTemplateManager instantiate(templatePub, id, name) visit(publication, publicationVisitor) visit(publication, path, sourceVisitor) <<interface>> <<interface>> <<interface>> SourceVisitor VisitingSourceResolver PublicationVisitor visit(resolver, sourceUri) getSource() : Source visit(publication) ExistingSourceResolver AllExistingSourceResolver getUris() : String[] ExistingAncestorSourceResolver 32
  • 33. Publication
and
Source
Visitors • Bottom-up
traversal
of
publication
tree • PublicationVisitor General
purpose • ExistingSourceResolver
-
fallback:// Find
first
existing
source • ExistingAncestorSourceResolver
-
template-fallback:// Find
second
existing
source
(works
only
for
leaf
source!) • AllExistingSourceResolver
-
aggregate-fallback:// Find
all
existing
sources 33
  • 35. Usecases • User
interaction • Typically
form-based • Edit
and
manage
content • Interact
with
other
applications
(newsletter) • Functionality
for
website
visitors
(contact
form) • ... • Triggered
using
a
request
parameter
(lenya.usecase) • Full
screen
or
document-based 35
  • 36. continuation Form Form ! ! Template Template View Sitemap + Flowscript Controller ! Usecase Handler vali- dation Documents, ... Documents, ... Model 36
  • 37. Declaring
a
Usecase <component-instance name=quot;site.createquot; class=quot;o.a.lenya.cms.site.usecases.CreateDocumentquot;> <view template=quot;modules/.../usecases/site/create.jxquot;> <parameter name=“...“ value=“...“/> </view> <parameter name=“...“ value=“...“/> <parameter name=“...“ value=“...“/> <transaction policy=“pessimistic“/> <exit usecase=“...“> <parameter name=“...“ value=“...“/> </exit> </component-instance> 37
  • 38. Example
Usecase: <<interface>> Usecase Contact
Form initParameters() checkPreconditions() advance() checkExecutionConditions() execute() <<interface>> checkPostconditions() UserManager getUser(userId) : User AbstractUsecase <<interface>> Notifier notify(recipients, sender, message) ContactForm MailNotifier SmsNotifier InboxNotifier 38
  • 40. <<interface>> <<interface>> RepositoryEvent Notifier RepositoryListener getDescriptor() : Object notify(message) eventFired(RepositoryEvent) Object AbstractNotifier NotificationListener notify(message) NotificationEventDescriptor notify(user, translatedMessage) translateMessage(locale, message) getMessage() : Message Message getSender() : Identifiable EmailNotifier getSubject() : String getSubjectParameters() : String[] InboxNotifier getBody() : String getBodyParameters() : String[] getTime() : Date 40
  • 41. Creating
a
Message User recipient = userManager.getUser(userId); Identifiable[] recipients = { recipient }; String subject = quot;publish-notificationquot;; String[] subjectParams = {}; String body = quot;document-was-publishedquot; String[] bodyParams = { DublinCoreHelper.getTitle(document) }; Message message = new Message(subject, subjectParams, body, bodyParams, sender, recipients); 41
  • 42. Sending
Notification
Messages a)
Directly • Immediate
notification NotificationUtil.notify(this.manager, message); b)
Via
repository
observation • Notification
when
(if)
session
is
committed NotificationEventDescriptor descriptor = new NotificationEventDescriptor(message); RepositoryEvent event = RepositoryEventFactory .createEvent(this.manager, authoringDocument, getLogger(), descriptor); getSession().enqueueEvent(event); 42
  • 43. Inbox
API <<interface>> InboxManager getInbox(User) : Inbox <<interface>> Inbox getMessages() : InboxMessage[] getMessage(id) : InboxMessage add(message) remove(message) * Message <<interface>> InboxMessage getSender() : Identifiable getSubject() : String getId() : String getSubjectParameters() : String[] getMessage() : Message getBody() : String isMarkedAsRead() : boolean getBodyParameters() : String[] markAsRead(boolean) getTime() : Date 43
  • 44. Configuring
Notification cocoon.xconf Lenya
Inbox: <component logger=quot;lenya.notificationquot; role=quot;org.apache.lenya.notification.Notifierquot; class=quot;org.apache.lenya.inbox.InboxNotifierquot;/> E-Mail: <component logger=quot;lenya.notificationquot; role=quot;org.apache.lenya.notification.Notifierquot; class=quot;org.apache.lenya.notification.EmailNotifierquot;> <smtp host=quot;localhostquot; username=quot;johnquot; password=quot;...quot;/> </component> 44