Dumping some notes I wrote - I hope it'll help some of you These are personal notes so I apologize if these are very messy. However, you will find here most of the classes & implicit objects (for the front end) that I use.
*** API *** Note: infos taken on Magnolia 4.5.8 - Magnolia API (4.5.8 at the time of writing) http://documentation.magnolia-cms.com/technical-guide/api.html info.magnolia.context.Context : interface defines all the methods which should be implemented by any configured magnolia context info.magnolia.context.MgnlContext info.magnolia.context.WebContext info.magnolia.cms.core.AggregationState info.magnolia.objectfactory.Components info.magnolia.module.ModuleRegistry info.magnolia.rendering.engine.RenderingEngine : main entry point for rendering content info.magnolia.rendering.template.RenderableDefinition : Base interface for all renderables info.magnolia.rendering.template.TemplateDefinition : (extends RenderableDefinition) supports editing in the page editor & can define their areas info.magnolia.rendering.model.RenderingModel : info.magnolia.module.templating.MagnoliaTemplatingUtilities info.magnolia.templating.functions.TemplatingFunctions : exposed in templates as cmsfn, exposing several methods useful for templates, children(), parent(), content(), isEditMode(), isPublicInstance(), language() info.magnolia.cms.i18n.I18nContentSupport - Magnolia API (4.5.8 at the time of writing), JCR related stuff Magnolia JCR does have Classes wrapping some of the JCR Classes. info.magnolia.cms.core.HierarchyManager - Deprecated (since 4.5) - use JCR-Session instead info.magnolia.cms.core.Content - Deprecated (since 4.5) - use jcr.Node instead info.magnolia.cms.core.NodeData - Deprecated (since 4.5) - use jcr.Property instead info.magnolia.jcr.util.ContentMap : Map based representation of JCR content, special property names map to the JCR methods: \@name, \@id, \@path, \@level, \@nodeType info.magnolia.cms.core.MetaData : Meta data of a content like creation date, modification date, assigned template, ... info.magnolia.cms.core.MgnlNodeType : Constant for node-types used within Magnolia info.magnolia.module.templatingkit.navigation.SubNavigation : Navigation Utility class info.magnolia.module.templatingkit.navigation.NavigationModel : used in the rendering script (freemarker,...) to display a navidation tree info.magnolia.module.templatingkit.navigation.NavigationItem : Element of a navigation tree info.magnolia.jcr.util.NodeUtil : utility methods to collect data from JCR repository, collectAllChildren(), info.magnolia.jcr.util.PropertyUtil : Property-related utility methods, use in conjonction with javax.jcr.Node info.magnolia.module.templatingkit.dam.DAMUtil info.magnolia.link.LinkUtil : Utility methods for link transformations & handling - Magnolia STK API (2.0.2 at the time of writing) info.magnolia.module.templatingkit.functions.STKTemplatingFunctions info.magnolia.module.templatingkit.templates.category.TemplateCategory info.magnolia.module.templatingkit.sites.Site : Site Configuration Bean. Default Site configuration merge with the specific user defined site. getI18n() , - JCR API Introduction: http://en.wikipedia.org/wiki/Content_repository_API_for_Java http://dev.day.com/docs/en/crx/current/developing/accessing_jcr_connectors.html Content Repository Extreme (CRX) + JCR Node The data in a JCR consists of a tree of nodes with associated properties. Data is stored in the properties, which may hold simple values such as numbers and strings or binary data of arbitrary length. http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html node.getNode(<nodeName> or <nodePath>) - Returns the node at relPath relative to this node. node.getProperty(<propName> or <propPath>) - Returns the property at relPath relative to this node. node.getProperty(<propName>).getValue().getString() javax.jcr.Node : every node has a UUID (universally unique identifier), TODO: carry on research + info.magnolia.jcr.util.NodeUtil http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/jcr/util/NodeUtil.html + NavigationUtils + info.magnolia.jcr.util.PropertyUtil + info.magnolia.jcr.util.SessionUtil + info.magnolia.cms.core.MetaData + info.magnolia.cms.util.QueryUtil + info.magnolia.cms.util.SiblingsHelper + org.apache.jackrabbit.commons.predicate.Predicate **** FRONT END API **** + content http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/jcr/util/ContentMap.html content nodes are wrapped such that you can use the built-ins for nodes. http://freemarker.org/docs/ref_builtins_node.html content : Current node exposed as a map like cms:setNode. ${content.getJCRNode()} ${content?children} ${content?parent} ${content?node_type} ${content.@name} ${content.@path} ${content.@uuid} ${content.metaData.authorId!} ${content.metaData.creationDate} ${content.metaData.modificationDate?string("yyyy-MM-dd HH:mm:ss")!} + ctx http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/context/Context.html http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/context/WebContext.html ${ctx.contextPath} - ie. use it to acess an img <img src="${ctx.contextPath}/resources/templating-kit/themes/<projectName>/img/prototype/imgageName.jpg" > ${ctx.parameters} - Get all parameter values as a Map<String, String> ${ctx.getRequest()} + state - Current AggregationState http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/cms/core/AggregationState.html ${state.originalBrowserURL} ${state.locale} ${state.mainContent.@handle} + def ${def.parameters.<paramName>} - Access parameters of the current template (used for CSS for instance) ${def.name} + http://documentation.magnolia-cms.com/reference/templating.html#Templatingsupportobjects CMS and CMS Utility tag libraries were DROPPED in Magnolia CMS 4.5 + cmsfn taglib http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/templating/functions/TemplatingFunctions.html ${cmsfn.content(String path)} - Return the Node for the Given Path from the website repository. ${cmsfn.content(String repository, String path)} - Return the Node for the Given Path from the given repository. ${cmsfn.contentByIdentifier(String id)} - Return the Node by the given identifier from the website repository. ${cmsfn.metaData(ContentMap or Node, String property)} - Returns the string representation of a property from the metaData of the node or null if the node has no Magnolia metaData or if no matching property is found. ie. ${cmsfn.metaData(content, "authorId")!} ${cmsfn.asContentMap(javax.jcr.Node content)} - Wraps a Node instance inside a ContentMap ${cmsfn.asJCRNode(ContentMap contentMap)} - Unwrap a ContentMap to a Node ${cmsfn.asContentMapList(Collection<javax.jcr.Node> nodeList)} = new ContentMap(newestIssue) - Wraps a Node Collection inside a ContentMap List ${cmsfn.link(Node or ContentMap)} ${cmsfn.link('website', content.link)} ${cmsfn.link(cmsfn.content(event.allEventsByDateLink))} ${cmsfn.page(content).getPath()} returns the path of the current page on which a component is located ${cmsfn.decode(javax.jcr.Node content) - Removes escaping of HTML on properties ${cmsfn.encode(javax.jcr.Node content) - Adds escaping of HTML on properties as well as changing line breaks into <br/> tags. ${cmsfn.children(contentMap)} ${cmsfn.parent(ContentMap)} ${cmsfn.siblings(ContentMap or Node)} - Returns an instance of SiblingsHelper (utility class) for the given node ${cmsfn.language()} ${cmsfn.isEditMode()} ${cmsfn.isPreviewMode()} ${cmsfn.isAuthorInstance() } ${cmsfn.isPublicInstance()} + stkfn taglib http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/standard-templating-kit/2.0.9/apidocs/info/magnolia/module/templatingkit/functions/STKTemplatingFunctions.html stkfn.site() stkfn.site(javax.jcr.Node content) - Returns the according Site of the passed content Node stkfn.siteRoot(info.magnolia.jcr.util.ContentMap content) - Returns the site's root ContentMap of the param ContentMap stkfn.homeLink(info.magnolia.jcr.util.ContentMap content) - Return the home link of this ContentMap stkfn.getAsset(info.magnolia.jcr.util.ContentMap content, String nodeDataPrefix) stkfn.getAssetLink(info.magnolia.jcr.util.ContentMap content, String nodeDataPrefix) stkfn.metaDataTemplate(ContentMap or Node) - Return the template id associated with this content. + SiblingsHelper utility class A utility class to navigate amongst the siblings of a given node http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.8/apidocs/info/magnolia/cms/util/SiblingsHelper.html -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=7f010ec3-7ca8-4bda-a583-ca7c58c58238 ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
