Content Flows
In order to understand how Jahia works with content, we have illustrated this with the following diagram:
![jahia6_6-technicaloverview_en-3.jpg [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/TechnicalOverview/jahia6.6_technicaloverview_en003.jpg)
Starting from the bottom up, the developer can create different types of objects, ranging from content definitions to macros that will be used by Jahia to customize the experience for other users. We will now briefly detail the different types of objects:
-
Definitions: content definitions define the type of objects that will be edited in the system as well as their structure. These may range from simple properties to complex sub-tree structures
-
Rules: rules define “consequences” (similar to actions) that must be performed when a certain condition is met. They make it possible, for example, to listen to modifications on content objects (such as page creation), to trigger any type of consequence.
-
Actions: actions are similar to method calls, except that they are called from the REST API. Developer may either use existing actions (such as “createUser” or “startWorkflow”) or define their own custom ones to fit their needs. This simple yet powerful extension mechanism makes it possible to perform almost any task in the Jahia back-end from a REST call.
-
Templates: templates are defined in the Jahia Template Studio, and they make it easy to define page and content layouts that may be used when creating pages or displaying content elements (such as a news entry). Templates may be packaged in Template Sets, and then be deployed to any web site, or moved from staging to production environments. Template Sets may even contain default content, which is useful to create powerful site factory scenarios.
-
Scripts: used to render a specific content object type. The default script type is JSP, but Jahia supports any Java Scripting API (http://www.jcp.org/en/jsr/detail?id=223) compatible script language (for example Velocity, Freemarker, or even PHP). Multiple scripts may be provided for a single node type: these are called “views” in Jahia.
-
Macros: macros may also be defined to provide quick substitutions on the final output of a Jahia page. Macros are executed even if a page is retrieved from the HTML cache, so macros can be very useful to quickly customize page output. There are some performance caveats as macros are constantly executed; they must always be very fast to execute.
Editors will then log into the system and start creating sites, pages and other content types that were specified by the developers. They use Jahia’s powerful Edit Mode or the simpler Contribute Mode to submit content and build the site bit by bit. As they enter content, rules, actions are used to perform logic actions upon submission; and then templates, scripts and finally macros are used to output the resulting HTML.
Visitors will either surf anonymously or log into the system, browse the site and interact with any dynamic object types that the editors and developers have made available to them. An example of such a dynamic object could be a forum, or a comment list. The content they contribute is called “User Generated Content” (or UGC). Again, Jahia will use the templates, scripts and macros to render the pages for the visitors, and if they are allowed to enter content, rules, actions and content definitions will again come into play (but not illustrated above to keep the diagram simple).

