Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
sendLocalMessage(Message message)
. Sends a message to the current user.sendUserMessage(String user, Message message)
. Sends a message to a named user. broadcastMessage(Message message)
. Sends a message to all users.The UI Framework is a collection of components for building the user interface in apps.
. Defines a form.
FieldDefinition
.Context is an abstraction layer representing the environment of the current process which can be a request process, a scheduled task or a command execution in the workflow. The context provides access to the most important components such as hierarchy managers jcr session, current user, context attributes and parameters, response object and so on. The context is initialized at the beginning of each process. Context attributes will have a different meaning based on the environment. In case of a request, the attributes are request attributes and request parameters. Magnolia implements context using a thread-local class.
getInstance()
Returns the current context.getUser()
Returns the current user.getJCRSession(String workspacename)
. Returns a JCR session to the provided workspace.getAttribute(name)
Returns a named context attribute. In case of a request, this can be a request parameter, request attribute or session attribute.getWebContext()
Returns the Web context if the current thread is processing a request.getAggregationState()
.getRequest()
Returns the current servlet request object.getResponse()
Returns the current servlet response object.getOriginalURI()
Original URI is the URI as requested by the client.getCurrentURI()
URI as mapped by Magnolia at a given point in processing. This value is for instance changed by the i18n filter, virtual URI mapping etc.getMainContentNode()
The content with which we start the rendering process. In general this is the page node.getCurrentContentNode()
The content that is processed at the moment. First this is typically the page, then a component and so on.render(javax.jcr.Node content, OutputProvider out)
Renders the content with its assigned template.
render(javax.jcr.Node content, RenderableDefinition definition, Map<String,Object> contextObjects, OutputProvider out)
Uses a specific RenderableDefinition to render the content and exposes the given context objects to the template script.
getName()
Name of the template definition.getRenderType()
Defines the renderer to use. For instance JSP or Freemarker.RenderableDefinition
which supports editing in the page editor and can define their areas.getDialog()
execute
method is executed before the rendering starts, a useful place to execute any business logic. The model is available in the template script under the named model.getParent()
Parent model. Most often the model of the page rendering.getNode()
The content node tied to this model.getContent()
Map representation of the content node tied to this model.getDefinition()
The renderable (template, area or component) tied to this model.
execute()
Called after all properties were set.
render(RenderingContext ctx, Map<String,Object> contextObjects)
Called by RenderingEngine
after it has setup the RenderingContext
.
content.<property name>
. It first tries to read a property with name (key) and, if not present, checks for the presence of a child node. Special property names map to JCR methods:@name
@id
@path
@level
@nodeType
cmsfn
.children(javax.jcr.Node content)
parent(javax.jcr.Node content)
isEditMode()
isPublicInstance()
language()
createLink(javax.jcr.Node node)
createAbsoluteLink(javax.jcr.Node node)
makePathRelative(String url, String absolutePath)
getI18n()
getTheme()
getVariations()
config
repository. This filter is bypassable.getNode(java.lang.String absPath)
. Returns the node at the specified absolute path in the workspace.getNodeByIdentifier(java.lang.String id)
Returns the node specified by the given identifier.save()
. Validates all pending changes currently recorded in this Session.getNode(java.lang.String relPath)
. Returns the node at relPath
relative to this node.getNodes()
Returns all child nodes of this node accessible through the current Session
.
getNodes(java.lang.String namePattern)
Gets all child nodes of this node accessible through the current Session
that match namePattern
.
getProperty(java.lang.String relPath)
Returns the property at relPath relative to this node.
setProperty(java.lang.String name, Value value)
Sets the single-value property of this node called name to the specified value.
Property
object represents the smallest granularity of content storage.getLong()
getString()
getBinary()
getCreated(javax.jcr.Node node)
Returns the creation date of a node or null if creation date isn't set.