Difference between revisions of "Cocoon And Manakin"

From Dryad wiki
Jump to: navigation, search
(Created page with "The DSpace user interface layer is called Manakin. It is based on Apache Cocoon. Here are some helpful notes. == Philosophy == * An "aspect" is a bit of java code that creat...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The DSpace user interface layer is called Manakin. It is based on Apache Cocoon. Here are some helpful notes.
+
The DSpace user interface layer is called Manakin. It is based on Apache Cocoon.  
 
 
 
== Philosophy ==
 
== Philosophy ==
  
Line 10: Line 9:
 
== Samples ==
 
== Samples ==
  
* (repo)/xmltest/form/basic
+
To see basic Cocoon features in action, navigate to:
* (repo)/xmltest/form/inline
+
* (server-base-url)/xmltest/form/basic
* (repo)/xmltest/form/advanced
+
* (server-base-url)/xmltest/form/inline
* (repo)/xmltest/form/structural
+
* (server-base-url)/xmltest/form/advanced
* (repo)/xmltest/form/HTML
+
* (server-base-url)/xmltest/form/structural
 +
* (server-base-url)/xmltest/form/HTML
 +
 
 +
The code for these are in:
 +
* dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/xmltest
 +
* dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/XMLTest/sitemap.xmap
  
 
== Flow of control ==
 
== Flow of control ==
  
* the theme directs a call to sitemap.xmap for each abstract
+
* the theme directs a call to the sitemap.xmap for each abstract that is active
* sitemap.xmap determines what classes to call
+
* sitemap.xmap determines what Java classes to call
* pipeline may include a selector (decides which section of a pipeline to follow)
+
* A pipeline in the sitemap
* pipeline must have a generator and serializer.  
+
** may include a selector (decides which section of a pipeline to follow)
* pipeline may have an optional number of transformers in between
+
** must have a generator and serializer.  
* all steps in a pipeline may be subject to matchers that turn pieces on and off for certain URLs.
+
*** there are generators (see xmlui sitemap) for ORE, directory listing, reading a file, etc. -- e.g., org.dspace.app.xmlui.cocoon.?????OREGenerator
 +
** may have an optional number of transformers in between
 +
** may have "actions" -- like transformers, but don't output xml (they are intended to produce a side effect)
 +
** may have matchers that turn pieces of the sitemap on and off for certain URLs.
 
* pipeline transformer classes modify the DRI  
 
* pipeline transformer classes modify the DRI  
 
* the serializer runs the DRI through XSL in i18n
 
* the serializer runs the DRI through XSL in i18n
 
* the resultant page is sent to the browser, which may apply a CSS
 
* the resultant page is sent to the browser, which may apply a CSS
  
[[Category:Technical Docs]]
+
== Random notes ==
 +
 
 +
* adding ?XSL to the URL is similar to adding /DRI, but it doesn't do the internationalization step -- so strings aren't replaced....
 +
* sitemaps (or just one?) define the ordering of the compile-time overlays -- right now, the items in the "current directory" for the sitemap have precedence, then items explicitly defined in the sitemap, and finally other things from the mvn dependency analysis
 +
* when you get an exception, you see all of the cocoon pieces that have run (not quite the same as a regular stack trace)
 +
 
 +
 
 +
 
 +
[[Category:Technical Documentation]]

Latest revision as of 11:24, 23 March 2018

The DSpace user interface layer is called Manakin. It is based on Apache Cocoon.

Philosophy

  • An "aspect" is a bit of java code that creates XML to be inserted into a page. Aspects usually represent things that are repeated on multiple pages (e.g., the user's login status and associated menu items)
  • A "theme" applies XSL to create HTML, which dictates the content's basic layout. We use separate themes for the Dryad look-and-feel, and the DryadLab look-and-feel.
  • CSS dictates how the layout is rendered.
  • JavaScript dictates how the rendering behaves.

Samples

To see basic Cocoon features in action, navigate to:

  • (server-base-url)/xmltest/form/basic
  • (server-base-url)/xmltest/form/inline
  • (server-base-url)/xmltest/form/advanced
  • (server-base-url)/xmltest/form/structural
  • (server-base-url)/xmltest/form/HTML

The code for these are in:

  • dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/xmltest
  • dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/XMLTest/sitemap.xmap

Flow of control

  • the theme directs a call to the sitemap.xmap for each abstract that is active
  • sitemap.xmap determines what Java classes to call
  • A pipeline in the sitemap
    • may include a selector (decides which section of a pipeline to follow)
    • must have a generator and serializer.
      • there are generators (see xmlui sitemap) for ORE, directory listing, reading a file, etc. -- e.g., org.dspace.app.xmlui.cocoon.?????OREGenerator
    • may have an optional number of transformers in between
    • may have "actions" -- like transformers, but don't output xml (they are intended to produce a side effect)
    • may have matchers that turn pieces of the sitemap on and off for certain URLs.
  • pipeline transformer classes modify the DRI
  • the serializer runs the DRI through XSL in i18n
  • the resultant page is sent to the browser, which may apply a CSS

Random notes

  • adding ?XSL to the URL is similar to adding /DRI, but it doesn't do the internationalization step -- so strings aren't replaced....
  • sitemaps (or just one?) define the ordering of the compile-time overlays -- right now, the items in the "current directory" for the sitemap have precedence, then items explicitly defined in the sitemap, and finally other things from the mvn dependency analysis
  • when you get an exception, you see all of the cocoon pieces that have run (not quite the same as a regular stack trace)