Cq5 Interview Questions
Cq5 Interview Questions
Apache Sling
Apache Sling is a web application
framework for content-centric
applications, using a Java Content
Repository, such as Apache Jackrabbit or
CRX, to store and manage content.
Sling:
is based
on REST principles to provide easy
development of content-oriented
applications.
is embedded within CQ5.
is used to process HTTP rendering and data-storage requests which assemble,
render and send the content to a client (i.e. the new delivery).
maps Content objects to Components (which render them and process incoming
data).
comes with both server-side and AJAX scripting support.
can be used with a range of scripting languages, including JSP, ESP and Ruby.
started as an internal project of Day Management AG .
has been contributed to the Apache Software Foundation.
Note
CQ WCM
Web Content
Management within
the CQ5 platform
allows you to generate
and publish pages to
your website..
CQ Workflow Engine
The CQ Workflow
Engine is a powerful
and easy to use
process engine that
can be used by all
applications running
on the CQ5 platform. A
Java API and RESTful HTTP interface is also provided for access by applications
outside CQ5.Within CQ WCM workflows can be used to control the process of
generating and publishing content, which are often subject to organizational
processes, including steps such as approval and sign-off by various participants.
CQ Components
Components provide the logic (code) to render content. They include both
templates and specific components such as Text with Image, Column Control and
Subtitle amongst others. Components are based on a combination of widgets,
replacing the CFC from Communiqu 4.
CQ Widgets
Widgets are the basic elements used to implement a specific user function, often the
editing of a piece of content; they include buttons, radio-boxes, dialogs, etc.
Apache Sling
2.
Drive the content hierarchy, dont let it happen. Properly Design the content Hierarchy
3.
4.
5.
6.
7.
Qus: Boosting
Any particular property or search term can be boosted either at indexing time or at runtime.
Boosting allows you to control the relevance of a document by boosting its term. For example,
boosting can specify that a match on the Title property of a node is more important than the
match on the Text property.
<index-rule nodeType=nt:unstructured boost=2.0 condition=@priority = high>
<property>Text</property>
</index-rule>
Template
A template is the blueprint for a specific type of page. When creating a page in the
siteadmin the user has to select a template. The new page is then created by copying this
template.
A template is a hierarchy of nodes that has the same structure as the page to be created,
but without any actual content.
It defines the page component used to render the page and the default content (primary
top-level content). The content defines how it is rendered as CQ is content-centric.
Page Component (Top-Level Component)
The component to be used to render the page.
Page
A page is an 'instance' of a template.
A page has a hierarchy node of type cq:Page and a content node of type cq:PageContent.
The property sling:resourceType of the content node points to the Page Component used
for rendering the page.
Qus: CQ Widgets
Widgets are the basic elements used to implement a specific user function, often the editing
of a piece of content; they include buttons, radio-boxes, dialogs, etc
jcr:all
Advanced
crx:replicate
jcr:addChildNodes
jcr:lifecycleManagement
jcr:lockManagement
jcr:modifyAccessControl
jcr:modifyProperties
jcr:namespaceManagement
jcr:nodeTypeDefinitionManagement
jcr:nodeTypeManagement
jcr:readAccessControl
jcr:removeChildNodes
jcr:removeNode
jcr:retentionManagement
jcr:versionManagement
jcr:workspaceManagement
jcr:write
rep:privilegeManagement
1.
In the table of Local Access Control Policies select the required entry and drag it to the new position in the
table.
2.
The changes will be shown in both the tables for the Local and the Effective Access Control Policies.
In the table of Local Access Control Policies click the red icon (-) at the right of the entry.
2.
The entry will be removed from both the tables for the Local and the Effective Access Control Policies.
if (myComponentDesignRsrc != null) {
pageContext.setAttribute("myComponentDesign",
myComponentDesignRsrc.adaptTo(ValueMap.class));
}
Finally, once you have the design properties set as a page context attribute, you can retrieve the
values in your component JSP.
${myComponentDesign.attribute}
The only unfortunate thing about this approach is that the currentStyles variable will no longer point to
the correct design path.
Now in the content page (jsp) of the rendering component add the following code.
<%@ page import="org.apache.sling.api.resource.Resource"%>
<%@ taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %>
<sling:defineObjects />
<%= slingRequest.getResourceBundle(slingRequest.getLocale()).getString("hello_world") %>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.adobe.example.myapp</groupId>
<artifactId>hsqldb-jdbc-driver-bundle</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>wrapper-bundle-hsqldb-driver</name>
<url>www.adobe.com</url>
<description>Exports the HSQL JDBC driver</description>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.3</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*</Embed-Dependency>
<_exportcontents>org.hsqldb.*</_exportcontents>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.9</version>
</dependency>
</dependencies>
</project>
The following links open the download pages for some popular database products:
Microsoft SQL Server
Oracle
IBM DB2
CONFIGURING THE JDBC CONNECTION POOL SERVICE
Add a configuration for the JDBC Connections Pool service that uses the JDBC driver to create data source
objects. Your application code uses this service to obtain the object and connect to the database.
JDBC Connections Pool (com.day.commons.datasource.jdbcpool.JdbcPoolService) is a
factory service. If you require connections that use different properties, for example read-only or read/write
access, create multiple configurations.
To create a connection, use the Configuration tab of the Web Console or create
a sling:OsgiConfig node in the repository. (See Adding a New Configuration to the Repository.)
The following properties are available to configure a pooled connection service. The property names are listed
as they appear in the Web Console. The corresponding name for a sling:OsgiConfig node appears in
parentheses. Example values are shown for an HSQLDB server and a database that has an alias of mydb:
JDBC Driver Class (jdbc.driver.class): The Java class to use that implements the java.sql.Driver
interface, for example org.hsqldb.jdbc.JDBCDriver. The data type is String.
JDBC Connection URI (jdbc.connection.uri): The URL of the database to use to create the connection,
for example jdbc:hsqldb:hsql//10.36.79.223:9001/mydb. The format of the URL must be valid
for use with the getConnection method of the java.sql.DriverManager class. The data type is String.
Username (jdbc.username): The user name to use to authenticate with the database server. The data type
isString.
Password (jdbc.password): The password to use for authentication of the user. The data type is String.
Validation Query (jdbc.validation.query): The SQL statement to use to verify that the connection is
successful, for example select 1 from INFORMATION_SCHEMA.SYSTEM_USERS. The data type
is String.
Readonly By Default (default.readonly): Select this option when you want the connection to provide read-only
access. The data type is Boolean.
Autocommit By Default (default.autocommit): Select this option to create separate transactions for
each SQL command that is sent to the database, and each transaction is automatically committed. Do not
select this option when you are committing transactions explicitly in your code. The data type is Boolean.
Pool Size (pool.size): The number of simultaneous connections to be made available to the database. The
data type is Long.
Pool wait (pool.max.wait.msec): The amount of time before a connection request times out. The data
type isLong.
Datasource Name (datasource.name): The name of this data source. The data type is String.
Additional Service Properties (datasource.svc.properties): A set of name/value pairs that you want
to append to the connection URL. The data type is String[].
The JDBC Connections Pool service is a factory. Therefore, if you use a sling:OsgiConfig node to
configure the connection service, the name of the node must include the factory service PID followed by alias. The alias that you use must be unique for all configuration nodess for that PID. An example node
name is com.day.commons.datasource.jdbcpool.JdbcPoolService-myhsqldbpool.
The following example JSP code obtains an instance of the hsqldbds data source, executes a simple SQL query,
and displays the number of results that are returned.
JSP that performs a database lookup
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false"%><%
%><%@ page import="com.day.commons.datasource.poolservice.DataSourcePool" %><%
%><%@ page import="javax.sql.DataSource" %><%
%><%@ page import="java.sql.Connection" %><%
%><%@ page import="java.sql.SQLException" %><%
%><%@ page import="java.sql.Statement" %><%
%><%@ page import="java.sql.ResultSet"%><%
%><html>
<cq:include script="head.jsp"/>
<body>
<%DataSourcePool dspService = sling.getService(DataSourcePool.class);
try {
DataSource ds = (DataSource) dspService.getDataSource("hsqldbds");
if(ds != null) {
%><p>Obtained the datasource!</p><%
%><%final Connection connection = ds.getConnection();
final Statement statement = connection.createStatement();
final ResultSet resultSet = statement.executeQuery("SELECT * from
INFORMATION_SCHEMA.SYSTEM_USERS");
int r=0;
while(resultSet.next()){
r=r+1;
}
resultSet.close();
%><p>Number of results: <%=r%></p><%
}
}catch (Exception e) {
%><p>error! <%=e.getMessage()%></p><%
}
%></body>
</html>
profile
Content can then be specifically targeted to the visitor's needs and interests, depending on the
segment(s) they match.
When discussing segmentation, the following terminology is used:
Visitor
A visitor is a person visiting a website. That person's visit typically starts from a referring page, then
moves on to one or more page views on your own website. A behavioral profile can be created from
the details of that person's visit.
User
A user is a visitor who registers with the website to receive an account profile. To generate their
profile they provide additional identification, such as an email address and gender, amongst others.
Additional information can also be collected, including community activity and purchase patterns,
again amongst others. Based on the information provided in the profile, a demographic profile can be
created.
Trait
A trait is a characteristic or property of a visitor that can be used to determine membership in a
specific segment.
Segment
A segment is a collection of visitors that share certain traits. Segments should be distinctive, with a
minimum of overlap with other segments.
Behavioral Traits
Behavioral traits are those that relate to a visitor's behavior on the website. These include:
Interest within your website; including pages visited and products bought.
Interest on the referring website; including search terms used, or adverts clicked on.
Age
Income
Family size
Marital status
Gender
Location
Derived Traits
Some demographic traits are hard to determine without registration, but can be derived by combining
behavioral and demographic traits.
For example, combining the referring URL (as a behavioral trait) with demographic data (acquired
from tools such asGoogle Ad Planner) allows site owners to derive demographics traits of their
visitors.
Subsegment
A segment can be subdivided into several subsegments. This is done by defining additional traits.
Teaser Page
A teaser page is directed at a specific audience. It contains re-usable content that can be used in the
teaser paragraph.
Campaign
A campaign is a collection of teaser pages and e-mail marketing pages, such as newsletters or
invitations. Typically a campaign runs for a limited period and is superceded by another campaign.
Teaser Paragraph
This is a paragraph that pulls content from another page dependent on a selection strategy. This
selection strategy can take segments and campaigns into consideration.
List
A list is extracted from a segment of registered users. For example, the location used to steer the
contents of the teaser paragraph.
NOTE
Please see Segmentation for further information on segments in CQ.
SEGMENTATION IN CQ
Depending on the information you have already collected about your site visitors and the goals you
want to achieve, you will need to define the segments and strategies needed for your targeted
content.
These segments are then used to provide a visitor with specifically targeted content. This content is
maintained in theCampaigns section of the website. Teaser pages defined here can be included as
teaser paragraphs on any page and define which visitor segment the specialized content is applicable
for.
CQ allows you to easily create and update segments, teasers, and campaigns. It also allows you to
verify the results of your definitions.
You can Edit each segment to specify a Title, Description and Boost factor. Using the sidekick you
can add AND andOR containers to define the Segment Logic, then add the required Segment
Traits to define the selection criteria.
Boost Factor
Each segment has a Boost parameter that is used as a weighting factor; a higher number indicates
that the segment will be selected in preference to a segment with a lower number.
Segment Logic
The following logic containers are available out-of-the-box and allow you to construct the logic of your
segment selection. They can be dragged from the sidekick to the editor:
AND Container
OR Container
Segment Traits
The following segment traits are available out-of-the-box; they can be dragged from the sidekick to
the editor:
IP Range
Page Hits
Page Property
Referral
Keywords
Script
Segment
Reference
Tag Cloud
User Age
User Property
You can combine these traits using the boolean operators OR and AND (see Defining a New
Segment) to define the exact scenario for selecting this segment.
When the entire statement evaluates to true then this segment has resolved. In the event of multiple
segments being applicable, then the Boost factor is also used.
5. Use either the sidekick or the context menu (usually right mouse button click, then
select New... to open the Insert New Component window) to find the segment trait you need.
Then drag it to the Segment Editor it will appear in the default AND container.
6. Double-click on the new trait to edit the specific parameters; for example the mouse position:
8. You can Edit the segment definition to give it a Title, Description and Boost factor:
9. Add more traits if required. You can formulate boolean expressions using the AND
Container and OR Container components found under Segment Logic. With the segment editor
you can delete traits or containers not needed anymore, or drag them to new positions within the
statement.
The top level of the definition is always the AND container that is initially created; this cannot be
changed, but does not have an effect on the rest of your segment definition.
Ensure that the nesting of your container makes sense. The containers can be viewed as the
brackets of your boolean expression.
The following example is used to select visitors who are either:
Male and between the ages of 16 and 65
OR
Female and between the ages of 16 and 62
As the main operator is OR you need to start with an OR Container. Within this you have 2 AND
statements, for each of these you need an AND Container, into which you can add the individual
traits.
Or not:
NOTE
All traits are resolved immediately, though most only change on page reload.
Changes to mouse position are visible immediately, so useful for testing purposes.
Such tests can also be performed on content pages and in combination with Teaser components.
Mouseover on a teaser paragraph will show the segments applied, whether they currently resolve and
therefore, why the current teaser instance has been selected:
Brands
In CQ, brands are the top level unit and form a collection of Campaigns.
Campaigns
A campaign is a collection of individual Experiences.
Experiences
The focused content forms the various experiences, presented to the visitor at Touchpoints. There are several
types of experience available:
Teasers
Teaser Pages / Paragraphs are used to steer specific visitor Segments to content that is focused on their
interests.
Teaser pages can:
show only one teaser paragraph that is based on the specific visitor segment; for example, the teaser
paragraph shown may be dependent on the age of the visitor.
Typically a teaser page is a temporary action that will last for a specific period of time, until it is replaced by
the next teaser page.
Newsletters
E-mail Communications are used to engage users and encourage them to visit your web site. These usually
take the form of a newsletter, sent to your Leads (which are usually grouped into Lists).
Test&Target
This allows integration with Adobe's Test&Target which gives marketers a conversion website optimization
tool with the necessary capabilities to continually make their online content and offers more relevant to their
customersyielding greater conversion. Test&Target provides an intuitive interface for designing and
executing tests, creating audience segments and targeting contentall from a single application.
Touchpoints
These are the points of contact between the visitor and your campaign. The touchpoints are connected to the
experiences that you have created.
For example, for teasers it is the content page where the teaser paragraph is located, for a newsletter it is the
mailing list.
Leads
The information that you have collected about your visitors and how to contact them forms the basis for your
leads.
Lists
Leads are usually grouped into lists so that you can take collective action on them.
Segments
Site visitors have different interests and objectives when they come to a site. Analyzing this according to factors
such as activity on the website, profile information registered and activity on other websites, helps you to define
segments. Content can then be specifically targeted to the visitor's needs and interests according to the
segment(s) they match.
MCM
The Marketing Campaign Manager (MCM) is a console that allows you to access all the functionality you need
to create and control your campaigns, brands, experiences, touchpoints, leads, lists, segments and reports.
It can be accessed from various locations (labelled as Campaigns), or with, for example, the URL:
http://localhost:4502/libs/mcm/content/admin.html
NOTE
Brands were introduced with CQ 5.5, so campaigns created before then are not connected to
a brand; such campaigns are fully supported though.
Dashboard
This is divided into four panes:
Lists
This pane shows the lists you have already created, together with the number of leads in that list. From this
pane you can create a new list directly or import leads to create a new list.
Selecting a specific list will take you to the Lists section showing details for your list.
Segments
This pane show the segments that you have defined. Segments let you characterize a collection of visitors
that share certain traits.
Selecting a specific segment will open the segment definition page.
Reports
CQ provides different reports to help you analyze and monitor the state of your instance. This MCM pane lists
the reports.
Selecting a report will open the report page.
Campaigns
This pane lists your campaign experiences such as newsletters and teasers.
Leads
Here you can manage your leads. You can create or import leads, edit specific details for individual leads or
delete when no longer needed. You can also put leads in different groups, called Lists.
Lists
Here you can manage your lists (of leads).
Campaigns
Here you can manage your Brands, Campaigns and Experiences.
DASHBOARD
The dashboard shows four panes that provide you with an overview of your lists (of leads), segments, reports
and campaigns. Access to basic functionality for these is also available here.
LEADS
NOTE
See Working with Leads for detailed information about specific tasks.
In CQ MCM, you can organize and add leads by either entering them manually or importing a comma-separated
list; for example, a mailing list. Additional ways to generate leads are from newsletter sign-ups or community
sign-ups (if configured, these can trigger a workflow that populates leads). Leads are usually categorized and put
into a list so that later you can perform actions on the whole list; for example, sending out a custom email to a
certain list.
Under Leads in the left pane you can create, import, edit and delete your leads, then activate or deactivate as
required. You can add a lead to a list, or see which lists it already belongs to.
LISTS
NOTE
See Working with Lists for detailed information about specific tasks.
Lists let you organize your leads into groups. With lists, you can target your marketing campaigns to a select
group of people; for example, you can send a targeted newsletter to a list.
Under Lists, you can manage your lists by creating, importing, editing, merging and deleting lists which you can
then activate or deactivate as required. You can also view the leads within that list, see if the list is a member of
another list or view the description.
CAMPAIGNS
NOTE
See Teasers and Strategies, Setting up your Campaign and Newsletters for detailed
information about specific tasks.
To access existing campaigns, in the MCM click Campaigns.
expand the list to show all related campaigns in the left pane; this list also shows the number of experiences
that exist for each campaign.
NOTE
Brands were introduced with CQ 5.5, so campaigns created before then will also be listed without a brand.
A single click on such entries (e.g. Geometrixx) will open the campaign overview in the right
pane.
See the number of campaigns and experiences (number shown in the left pane) that exist for this brand.
Change the timespan being viewed; select Week, Month or Quarter, use the arrows to select specific periods
Campaign Overview
For the individual campaigns there are two views available:
1.
Calendar View
This presents a list of all touchpoints (grey) with a horizontal timeframe of the experiences (green) connected
to that touchpoint:
Change the timespan you are viewing by using the arrows, or return to Today.
Click on a teaser (in the right pane) to set the On Time and Off Time.
2.
List View
This lists all experiences (e.g. teasers and newsletters) for the selected campaign:
Create a New... experience; for example, Test&Target offers, teasers and newsletters.
Edit the details of a specific teaser page or newsletter (a double-click can also be used).
Search for your text (the Title field of the experience will be searched).
Use Advanced search to apply filters to the search.
From here you can also open the sidekick (click the small down arrow) to change to edit mode for updating the
page.
Qus: How you can inherit properties of one dialog to another dialog?
For inheriting properties we have to create two components with unique names in the base
component dialog. For eg. If your plan is to have two rich text two rich text areas in the dialog of
components that inherit from the base, then you must include two rich text areas with unique
names in the base component dialog. In any case every input field of a dialog must have a unique
name, else they will point to the same property path relative to the jcr:content node of the
component when used on a page.
Any issue if name is not unique?
Each input field of a dialog must have a unique name else both will point to the same property path
relative to the jcr:content node of the component when used on a page.
Qus: Can we restrict for certain users not to display some digital assets ?
You can always limit who can access certain folders in CQ Digital Assets by making the folder part of
a CUG(closed user group).
Steps to make a folder part of a CUG:
>In CQ DAM, right-click the folder you want to add closed user group properties for and select
Properties.
>Click the CUG tab.
>Select the Enabled check box to make the folder and its assets available only to a closed user group.
>Browse to the login page, if there is one, to add that information. Add admitted groups by clicking
Add item. If necessary, add the realm. Click OK to save your changes.
- Data first
- Content Hierarchy
- Workspaces
- SNS
- References
- Files
- ID
Qus: Explain the process of Content Moved from author to publish instance in CQ5?
Replication agent is the guy who does movement of data from author instance to publish instance.
It agent has following functions:
1. Move content from author to publish instance.
2. If any content is updated, then it flushes the older content from dispatcher cache.
Persistence Manager: The persistence manager handles storage of the node/property tree that makes up the
structure of the repository. This includes the name and position of each node and property in the hierarchy as
well as the actual values of the smaller properties (the data store takes care of storing the larger values, see
below). The default persistence manager is TarPersistenceManager. By default, it stores its data at crxquickstart/repository/workspaces/crx.default/.
Data Store: The data store handles storage of large content objects. When the value of property exceeds a
given threshold, that data is not stored directly in the persistence manager storage. Rather, the data is stored in
the data store and only a reference to the data is stored in the actual property record within the persistence
manager storage. The default data store is ClusterDataStore. By default, it stores its data in crxquickstart/repository/workspaces/crx.default/.
Journal: The journal helps maintains data consistency and helps the system to recover quickly from crashes. In
a clustered environment the journal plays the critical role of synchronizing content across cluster instances. The
default journal is TarJournal, which stores its state in crx-quickstart/repository/tarJournal/.
Version Storage: The version storage holds all the versioning information for the repository. From within the
repository this information is exposed at the repository path /jcr:system/jcr:versionStorage. By
default, the actual storage location of the data on-disk is crx-quickstart/repository/version/.
Indexes: The indexes are used for fast lookup of data for search and other functions. On disk, the index files
can be found in crx-quickstart/repository/workspaces/crx.default/index/ and crxquickstart/repository/repository/index/.
Other File-Based Storage: In addition to the above elements, CRX also stores some repository state as plain
text and XML files directly in the following file system directories under crxquickstart/repository/repository/:
Qus: Annotations
Service components can be annotated using the annotations provided by the
org.apache.felix.dependencymanager.annotation bundle.
The following annotations are supported:
Component - To register your components without the Annotations, you would have to
implement Activators, which extend the DependencyActivatorBase class.
Activate
Deactivate
Modified
Service
- The @Service annotation defines whether and which service interfaces are
provided by the component. This is a class annotation.
Property
- The @Property annotation defines properties which are made available to the
component through the ComponentContext.getProperties() method
Reference
- The @Reference annotation defines references to other services. These other
services (consumed services) are made available to the component by the Service
Component Runtime.
Qus: Explain the process steps involved in content moved from publish instance to
author instance?
The latest/recent content is moved from publish instance to author instance using reverse
replication and the job is done by reverse replication agent.
The agent places any content updates in an out-box configured in publish instance. The author
environment replication listeners always keep listening to the publish out-box and whenever any
content is placed in publish out-box, the listeners takes it and update the content.
A: Mod_rewriter rules will take care of just mapping and not link rewriting. You need /etc/map or
resource resolver rules for link rewriting.
Q: Why dispatcher flush do not take mapping rules in to account ?
A: There is already an enhancement request for this.
Q: I don't want to write these rewrite rules, How else I can handle this ?
A: One option is set your stat file level to 0 (Which is default), This might invalidate all resource
under invalidation tag of dispatcher.any upon activation. But again if you watch your dispatcher log
carefully, wrong file will get evicted on activation. But you still see updated content due to
invalidation.
Q: How about vanity URL ?
A: Well thats problematic. You might want to stick with stat file or write mod_rewrite rules for them
as well.
Tar is a standard file format, accessible via known tools, such as tar, WinZip, and so on.
Tar is a platform-independent format.
Low cost of ownership and license.
Tar PM is specifically designed for JCR repositories.
Tar PM is faster than RDBMS-based persistence managers for the JCR use case.
The Tar PM takes advantage of the very simple key-value pair data structure of CRX.
Configuring the Tar PM
The configuration options are:
<PersistenceManager class="com.day.crx.persistence.tar.TarPersistenceManager">
<param name="maxFileSize" value="256"/>
<param name="autoOptimizeAt" value="2:00-5:00"/>
<!-- since 1.4.1 -->
<param name="bindAddress" value=""/>
<param name="portList" value=""/>
<param name="preferredMaster" value="false"/>
<param name="lockClass" value="com.day.crx.util.NativeFileLock"/>
<param name="lockTimeout" value="0"/>
<param name="fileMode" value="rw"/>
<param name="optimizeSleep" value="1"/>
<param name="maxIndexBuffer" value="32"/>
</PersistenceManager>
maxFileSize
(optional, default is 256) If the current data file grows larger than this
number (in megabytes), a new data file is greated (that means, if the
last entry in a file is very big, a data file can actually be much bigger,
as entries are not split among files). The maximum file size is 1024 (1
GB). Data files are kept open at runtime. Depending on the amount
of data is stored in the Tar PM, this value needs to be increased or
the limit of open files per process needs to be adjusted. If this value
is changed when tar files already exist, new tar files will grow up to
this size (existing files are not changed).
autoOptimizeAt
bindAddress
portList
The list of ports to use in master mode. By default any free port is
used. When using a firewall, open ports must be listed. One port per
workspace is required. A list of ports or ranges is supported, for
example: 9100-9110 or 9100-9110,9210-9220. Default: 0 (any port).
preferredMaster
lockClass
lockTimeout
fileMode
The file mode how to open the data files. Options are "rw" (readwrite), "r" (read-only), "rwd" (read-write, content is written
synchronously), and "rws" (read-write, content and metadata
changes are written synchronously). Optionally a + can be appended
to call fsync after writing (however this will slow down writes a lot).
Default: "rw" for read-write.
optimizeSleep
maxIndexBuffer
Configuration values are read when the repository is started; that means you may want to re-start
the repository after changing the configuration.Note: If you change the configuration after a
workspace has already been created, you need to change both the repository.xml and
workspace.xml files.
Optimizing Tar Files
See TarPM Optimization
Consistency Checking and Fixing
The Tar PM can check repository consistency and fix consistency problems at startup. To enable
consistency checking and automatically fix problems, set the following options in the repository.xml
and workspace.xml, and re-start CRX:
<param name="consistencyCheck" value="true"/>
<param name="consistencyFix" value="true"/>
In order to fix consistency problems, the consistency check setting must be enabled as well.
After the consistency check finished, disable the relevant settings, otherwisethe consistency check
will always run when starting up CRX.
If Tar Files Get Big
If some data*.tar file are very large, the there are large transactions. Large transactions are a
problem (in any case - not only for the Tar PM but also for the main memory and other subsystems). You can analyze what is in a data*.tar file using the jsp file in the attachment.
Migration from Regular to Clustered Environment
The easiest way to migrate to a clustered environment is to export the data, change the
configuration, and then import the data.
Migration from Clustered to Regular Environment
The easiest way to migrate to a regular environment is to export the data, change the configuration,
and then import the data.
The disk space required to run the optimization is at most the size of one data tar file,
which is 256 MB by default (for CRX 2.0; this setting can be changed using the
parameter maxFileSize). This applies to both the shared directory as well as the local
directory, meaning the total amount of temporary disk space used is at most 512 MB by
default.
Note: In a clustered environment, this only works on the cluster nodes that is currently
running as the master. Starting optimization on a slave cluster node has no effect.
The paragraph system (parsys) is a compound component that allows authors to add
components of different types to a page and contains all other paragraph components.
Each paragraph type is represented as a component. The paragraph system itself is
also a component, which contains the other paragraph components.
You configure which components users see by making them available to the user in
Design mode.
For example, the content of a product page may contain the following:
An image of the product (in the form of an image or textimage paragraph)
A form users fill out (as a forms begin, forms element, and forms end
paragraph)
The inherited paragraph system is a paragraph system that also allows you to inherit
the created paragraphs from the parent. You add paragraphs to iparsys at for
example, /content/geometrixx/en/products and as result, all the subpages
of products that also have iparsys with the same name inherit the created paragraphs
from the parent. On each level, you can add more paragraphs, which are then
inherited by the children pages. You can also cancel paragraph inheritance at a level
at any time.
Simply, iparsys is a parsys that inherits it's content from the ancestor pages.
Disable Inheritance
If the checkbox is selected, child pages do not inherit the paragraph of this page.
The following example shows the iparsys component in Geometrixx:
secondly, the representation, or script, is located from the resource properties in combination with
certain parts of the request (e.g. selectors and/or the extension)
RESTful Sling
Due to the content-centric philosophy, Sling implements a REST-oriented server and thus features a
new concept in web application frameworks. The advantages are:
very RESTful; resources and representations are correctly modelled inside the server
removes one or more data models
previously the following were needed: URL structure, business objects, DB schema;
this is now reduced to: URL = resource = JCR structure
URL Decomposition
In Sling, and therefore also CQ5, processing is driven by the URL of the user request. This defines the
content to be displayed by the appropriate scripts. To do this, information is extracted from the URL.
If we analyze the following URL:
http://myhost/tools/spy.printable.a4.html/a/b?x=12
We can break it down into its composite parts:
Table 1. URL Decomposition
protocol host
extension
suffix
/ a/b
param(s)
? x=12
protocol
HTTP.
host
Name of the website.
content path
Path specifying the content to be rendered. Is used in combination with the extension; in this
example they translate to tools/spy.html.
selector(s)
Used for alternative methods of rendering the content; in this example a printer-friendly version in
A4 format.
extension
Content format; also specifies the script to be used for rendering.
suffix
Can be used to specify additional information.
param(s)
Any parameters required for dynamic content.
From URL to Content and Scripts
Using these principles:
the mapping uses the content path extracted from the request to locate the resource
when the appropriate resource is located, the sling resource type is extracted, and used to locate
the script to be used for rendering the content
The figure below illustrates the mechanism used, which will be discussed in more detail in the
following sections.
Therefore:
DO NOT specify which data entities to access in your scripts (as an SQL statement in a PHP script
would do)
DO specify which script renders a certain entity (by setting the sling:resourceType property in the
JCR node)
Mapping requests to resources
The request is broken down and the necessary information extracted. The repository is searched for
the requested resource (content node):
first Sling checks whether a node exists at the location specified in the request;
e.g. ../content/corporate/jobs/developer.html
if no node is found, the extension is dropped and the search repeated;
e.g. ../content/corporate/jobs/developer
if no node is found then Sling will return the http code 404 (Not Found).
Note
Sling also allows things other than JCR nodes to be resources, but this is an advanced feature.
Locating the script
When the appropriate resource (content node) is located, the sling resource type is extracted. This is
a path, which locates the script to be used for rendering the content.
The path specified by the sling:resourceType can be either:
absolute
relative, to a configuration parameter
Note
Relative paths are recommended by Day as they increase portability.
All Sling scripts are stored in subfolders of either /apps or /libs, which will be searched in this order.
A few other points to note are:
when the Method (GET, POST) is required, it will be specified in uppercase as according to the HTTP
specification e.g. jobs.POST.esp (see below)
various script engines are supported:
.esp, .ecma: ECMAScript (JavaScript) Pages (server-side execution)
.jsp: Java Server Pages (server-side execution)
.java: Java Servlet Compiler (server-side execution)
.jst: JavaScript templates (client-side execution)
.js: ECMAScript / JavaScript (client-side execution)
The list of script engines supported by the given instance of CQ are listed on the Felix Management
Console (http://localhost:4502/system/console/scriptengines ).
Additionally, Apache Sling supports integration with other popular scripting engines (e.g., Groovy,
JRuby, Freemarker), and provides a way of integrating new scripting engines.
Using the above example, if the sling:resourceType is hr/jobs then for:
GET/HEAD requests, and URLs ending in .html (default request types, default format)
The script will be /apps/hr/jobs/jobs.esp; the last section of the sling:resourceType forms the file
name.
POST requests (all request types excluding GET/HEAD, the method name must be uppercase)
POST will be used in the script name.
The script will be /apps/hr/jobs/POST.esp.
URLs in other formats, not ending with .html
For example ../content/corporate/jobs/developer.pdf
The script will be /apps/hr/jobs/jobs.pdf.esp; the suffix is added to the script name.
URLs with selectors
Selectors can be used to display the same content in an alternative format. For example a printer
friendly version, an rss feed or a summary.
If we look at a printer friendly version where the selector could be print; as
in ../content/corporate/jobs/developer.print.html
The script will be /apps/hr/jobs/jobs.print.esp; the selector is added to the script name.
If no sling:resourceType has been defined then:
the content path will be used to search for an appropriate script (if the path based
ResourceTypeProvider is active).
For example, the script for ../content/corporate/jobs/developer.html would generate a search
in/apps/content/corporate/jobs/.
the primary node type will be used.
If no script is found at all then the default script will be used.
The default rendition is currently supported as plain text (.txt), HTML (.html) and JSON (.json), all of
which will list the node's properties (suitably formatted). The default rendition for the extension .res,
or requests without a request extension, is to spool the resource (where possible).
For http error handling (codes 404 or 500) Sling will look for a script
at /libs/sling/servlet/errorhandler/404.esp, or 500.esp, respectively.
If multiple scripts apply for a given request, the script with the best match is selected. The more
specific a match is, the better it is; in other words, the more selector matches the better, regardless
of any request extension or method name match.
For example, consider a request to access the
resource /content/corporate/jobs/developer.print.a4.html of typesling:resourceType="hr/jobs".
Assuming we have the following list of scripts in the correct location:
1.
2.
3.
4.
5.
jobs.esp
jobs.GET.esp
jobs.GET.html.esp
jobs.html.esp
jobs.print.esp
6.
7.
8.
9.
10.
jobs.print.a4.esp
jobs.print.html.esp
jobs.print.GET.html.esp
jobs.print.a4.html.esp
jobs.print.a4.GET.html.esp
Then the order of preference would be (10) - (9) - (6) - (8) - (7) - (5) - (3) - (4) - (2) - (1).
Answer, Resolution
1. <c:import url="layout-link.jsp" />
I assume this is the import tag of the Standard Tag Library. This tag is
documented athttp://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/import.html and
does not know about Sling directly.
But -- asuming -- this tag is using a RequestDispatcher to dispatch the
request, this tag will also pass Sling and the Sling resource resolver.
2. <sling:include path="layout-link.jsp" />
This is the include tag of the Sling JSP Tag library. This tag knows about Sling
and also supports RequestDispatcherOptions.
3. <cq:include script="layout-link.jsp" />
This tag is Communiqu specific extension of the Sling JSP Tag library include
tag. IIRC it supports callings scripts in addition to just including renderings of
resources.
The Activator.java file. It is the optional listener class to be notified of bundle start and stop events.
Qus: How you can inherit properties of one dialog to another dialog?
No, there is no way to directly inherit dialogs. The best you can do is to include the dialog tabs
using path property.
You should create your tab your tabs in a different location and you can include it in your dialog
using path property like shown below:
<items jcr:primaryType="cq:WidgetCollection">
<tabs jcr:primaryType="cq:TabPanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Widget"
path="/apps/myproject/tab1.infinity.json"
xtype="cqinclude"/>
<tab2
jcr:primaryType="cq:Widget"
path="/apps/myproject/tab2.infinity.json"
xtype="cqinclude"/>
</items>
</tabs>
</items>
Where tab1 and tab2 are tab panels.
So, in your case it will be something like this :
base_page_dialog_tab
- dialog
- title
- description
inherited page-dialog-tab
- custom field
base-page-template
- include base page dialog tab here.
inerited-from-base-page
- include Tab 1 - inherited page-dialog tab using path property
Resource Mapping
You are reading the Adobe Experience Manager 5.6.1 version of Resource Mapping.
This documentation is also available for the following versions: Adobe Experience Manager 6.0 AEM
5.6
Resource mapping is used to define redirects, vanity URLs and virtual hosts for AEM.
For example, you can use these mappings to:
Prefix all requests with /content so that the internal structure is hidden from the visitors to your website.
Define a redirect so that all requests to the /content/en/gateway page of your website are redirected
tohttp://gbiv.com/.
One possible HTTP mapping prefixes all requests to localhost:4503 with /content. A mapping like this
could be used to hide the internal structure from the visitors to the website as it allows:
localhost:4503/content/geometrixx/en/products.html
to be accessed using:
localhost:4503/geometrixx/en/products.html
as the mapping will automatically add the prefix /content to /geometrixx/en/products.html.
NOTE
Configuration
Shows the current configuration (as defined for the Apache Sling Resource Resolver).
Configuration Test
This allows you to enter a URL or resource path. Click Resolve or Map to confirm how the system will
transform the entry.
The two lists show various entries, including those defined as defaults by the application(s). These often aim to
simplify URLs for the user.
The lists pair a Pattern, a regular expression matched to the request, with a Replacement that defines the
redirection to impose.
For example, the:
Pattern ^[^/]+/[^/]+/welcome$
will trigger the:
Replacement /libs/cq/core/content/welcome.html.
to redirect a request:
http://localhost:4503/welcome
to:
http://localhost:4503/libs/cq/core/content/welcome.html
New mapping definitions are created within the repository.
NOTE
There are many resources available that help explain how to define
regular expressions; for example http://www.regular-expressions.info/.
1.
2.
Type sling:Mapping
This node type is intended for such mappings, though its use is not mandatory.
Name localhost_any
3.
4.
Name sling:match
Type String
Value localhost.4503/
5.
Name sling:internalRedirect
Type String
Value /content/
CQ can handle what you are looking to do in a straight forward manner. They way to look at it, is that
you're products are the content, you'll either have a specific template or data structure that represents
your content(product) and the components that you would be building would be views that reference
you're content(product)
UNINSTALLED
INSTALLED
RESOLVED
STARTING
STOPPING
ACTIVE
A Blueprint is created from an existing site. A site is a collection of pages, so you will be
using "New Page" option for creating the site initially.
So if you don't have "MySite" ready as of yet, you'll be using "New page" option. Once "MySite"
is ready and you want to create copies of "MySite" for different languages and countries to
enforce a common structure, you will have to use "New Site" option.
You can read more about AEM's MSM capabilities here :
http://dev.day.com/docs/v5_2/html-resources/cq5_guide_power_user/ch13s04.html
http://dev.day.com/docs/en/cq/current/administering/multi_site_manager.html