Wednesday 13 July 2011

Web Content Management and Liferay Variables

WEB CONTENT MANAGEMENT

Liferay’s Web Content Management (WCM) is a system which allows non-technical users to publish content to the Web without having advanced knowledge of Web technology or programming of any sort. Liferay Content Management System (CMS) empowers you to publish your content with a simple point-and-click interface, and it helps you to keep your site fresh.

You can use WCM to author both structured and unstructured content. Unstructured content is authored using an HTML-based WYSIWYG editor. Structured content is authored and displayed by combining Web Content Structures, Web Content Templates, and Web Contents. Structures and Templates are defined individually using a text editor or through the Liferay WCM UI.

Accessing Structure Elements

The following table shows how to access structure data from your Web Content Template code (when using Velocity templates; other template languages such as FreeMarker, XSL, or CSS have similar constructs). The variable name defined in the structure are denoted in bold and will be different depending on the name assigned in the structure.

Element Type
Velocity Template Accessors




Text Field
$tf.name,  $tf.data,  $tf.type






Text Box
$textbox.data






Text Area (HTML)
$textarea.data






Checkbox
$checkbox.data






Selectbox
$selectbox.data






Multi-Selection List
#foreach($selection  in  $mylist.options)




$selection


#end




Image Gallery
<img  src=”/image/image_gallery?img_id=$img.getData()”/>






Link to Page
$linkToPage.url






Repeatable
$el.siblings






Hierarchy
#foreach($child  in  $el.children)




$child.data


#end




Reserved Variables
$reserved-article-[id,version,title,create-date,modified-




date,  display-date,author-id,author-name,author-email-


address,author-comments,author-organization,author-


location,author-job-title].data





Template and Theme Variables

The following table lists the most common built-in variables accessible from Velocity Template code (when using Velocity templates; other template languages such as FreeMarker, CSS, or XSL have similar constructs). For example, $layout.getChildren(). Items marked with an asterisk (*) are only available from Liferay Theme files.

Variable Name
Description


request
HTTPServletRequest object


company
The current company object. This represents the portal instance on

which the user is currently navigating.


companyId
The current company ID.


groupId
ID of the group in which this web content is published.


locale
The current user's locale, as defined by Java.


randomNamespace
A randomized string.  It is very useful for creating IDs that are

guaranteed to be unique.


browserSniffer
Dynamic browser capabilities.  e.g.$browserSniffer.isMobile()


portal
Current portal instance


portletURLFactory
Creates portlet URLs (action URLs, etc)


stringUtil
Useful string utilities


portletConfig*
Standard PortletConfig object  describing information from the

portal.xml file.


renderRequest*
Standard Portlet RenderRequest object


renderResponse*
Standard Portlet RenderResponse object


themeDisplay*
Contains many useful items, such as the logged in user, the layout,

logo information, paths, and much more.


user*
The User object representing the current user.


layoutSet*
The set of pages to which the user has currently navigated. Generally,

communities and organizations have two: a public set and a private set.


scopeGroupId*
groupId that is used to identify the scope where the data of the

current portlet is stored and retrieved.  The scope can represent a

community, organization, user, the global scope, or a scope tied to a

specific page.


timeZone*
The current user's time zone, as defined by Java.


viewMode
e.g. “print” when clicked print icon


fullTemplatesPath*
Path to all templates used.


pageTitle*
Title of the page




serviceLocator
Access to other Liferay services.  Note by default this variable is

disabled, must be enabled via portal-ext.properties




prefsPropsUtil
Access to portal settings that were set from the Control Panel or

through the portal.properties configuration file.




permissionChecker
An object which can determine given a particular resource whether or

not the current user has a particular permission for that resource.


[css|images|javascrip
Full path to various theme files
t|templates]_folder*



LIFERAY ADMINISTRATION

Portal Properties

Liferay uses the concept of overriding the defaults in a separate file, rather than going in and customizing the default configuration file. The default configuration file is called portal. properties, and it resides inside of the portal-impl.jar file.
This .jar file is located in Liferay Portal’s WEB-INF/lib folder. If you have a copy of the Liferay source code, this file can be found in portal-impl/src. The file which is used to override the configuration is portal-ext.properties. This file can be created in your Liferay Home folder or anywhere in the application server’s classpath.

Database Setup

Out of the box, Liferay bundles are configured to use HSQLDB, which should only be used for development or demo purposes. You cannot use this database in production.

For production use, Liferay supports the following databases: MySQL, Microsoft SQL Server, Oracle Database, IBM DB2, PostgresSQL, and Sybase. Liferay can also connect to Apache Derby, Firebird, Informix, Ingres, or SAP DB. To use these databases, the database and user with appropriate access must be created, and the appropriate JDBC driver must

be available in your app server. Consult your database documentation for details on syntax and how to create databases and users.
To use a particular database, you must set the following four

properties in your portal-ext.properties.

MySQL Example:

1.
jdbc.default.driverClassName=com.mysql.jdbc.Driver
2.
jdbc.default.url=jdbc:mysql://localhost/lportal?

useUnicode=true&characterEncoding=UTF-

8&useFastDateParsing=false
3.
jdbc.default.username=
4.
jdbc.default.password=



Oracle Example:

jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe jdbc.default.username=lportal

jdbc.default.password=lportal

It’s also possible to delegate this configuration to the application server through a DataSource by using the following property:

jdbc.default.jndi.name=NameOfDataSource

App Server Configuration

Liferay is supported on the following app servers or servlet containers: Geronimo, GlassFish, JBoss, Jetty, JOnAS, Oracle, Resin, Tomcat, WebLogic, and WebSphere. Consult your app server documentation for details on configuration. The following table lists common files that are involved in configuring your app server.

Tomcat 6.x
Location




Global Libraries
${TOMCAT_DIR}/lib/ext






Portal Libraries
${TOMCAT_DIR}/webapps/ROOT/WEB-INF/lib






Primary Configuration
${TOMCAT_DIR}/conf/server.xml






Primary Log Files
${TOMCAT_DIR}/logs/catalina.out






GlassFish 3.x
Location




Default Domain Directory
${GLASSFISH_DIR}/domains/domain1






Global Libraries
${GLASSFISH_DOMAIN_DIR}/lib






Portal Libraries
${GLASSFISH_DOMAIN_DIR}/applications/j2ee-modules/




Liferay-portal/WEB-INF/lib




Primary Configuration
${GLASSFISH_DOMAIN_DIR}/config/domain.xml






Primary Log Files
${GLASSFISH_DOMAIN_DIR}/logs/server.log






JBoss 5.x
Location




Default Instance Directory
${JBOSS_DIR}/server/default






Global Libraries
${JBOSS_INSTANCE_DIR}/lib






Portal Libraries
${JBOSS_INSTANCE_DIR}/deploy/ROOT.war/WEB-INF/lib






Primary Configuration
${JBOSS_INSTANCE_DIR}/conf/jboss-service.xml






Primary Log Files
${JBOSS_INSTANCE_DIR}/log/server.log  ${JBOSS_INSTANCE_




DIR}/log/boot.log





Troubleshooting and Debugging

The following items should be checked when troubleshooting a problem.

Item
Notes


Log Files
Log files for several app servers are listed above. These should be checked for

warnings, errors, Java stack traces, etc.


Log Settings
Liferay uses the Apache Log4j library to perform all of its logging operations.

See below on how to configure log settings.


JMX
Liferay provides out-of-the-box JMX MBeans, which allow introspection into

the runtime, for example to identify and isolate problematic behavior such as

poor cache performance or slow portlet rendering.


Debug
To attach a Java debugger to Liferay, you must start the JVM with special

properties. Some servers have done this for you. For example, to start Tomcat

under a debugger, run “bin/catalina.sh jpda start”

Other servers may need the JVM properties added manually. A typical set of

properties is:

-Xdebug

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005


18 comments:

  1. his is so interesting blog. You are best listing knowledge provide at this site. I am very excited read this nice article. web content management Thank you for the info.

    ReplyDelete
    Replies
    1. Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download Now

      >>>>> Download Full

      Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download LINK

      >>>>> Download Now

      Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download Full

      >>>>> Download LINK xt

      Delete
  2. you have a great listing knowledge your article is really helpful and full of information and knowledge. thanks for sharing it with us.
    www.digitalsence.com

    ReplyDelete
  3. AVG antivirus has many products which gives protection against all kind of cyber threat like malware, and virus. Www.avg.com/retail

    MS Office is the software which increases the productivity of work and helps the employees making their work easier. Www.office.com/setup

    Webroot antivirus blocks the dangerous emails and gives the alert signals when it found danger. Www.Webroot.Com/Safe

    ReplyDelete
  4. Quickbooks general help line. want quick, easy help? We recommend having a QuickBooks expert call you. They'll have the info you'be already entered. So you won't have to repeat it. If you prefer to call us directly, we'll ask you a series of questions to confirm your personal info and the reason for your call.

    QuickBooks Support Phone Number | Quickbooks Payroll Support Phone Number | Quickbooks Enterprise Support Phone Number | Quickbooks Technical Support Phone Number

    ReplyDelete
  5. Official QuickBooks updates and new features, expert tips, and videos. Get news, learn about QuickBooks Online, and access the QuickBooks Resource Center and accountant advice. If you are looking for direct product support for QuickBooks, get connected by clicking here or call our Quickbooks expert now.

    Quickbooks Support Phone Number | Quickbooks Enterprise Support Phone Number | Quickbooks Payroll Support Phone Number

    ReplyDelete
  6. MS Office has earned its reputation as an outstanding Suite of Integrated Productivity Tools by serving Business and Home users with unmatched efficiency. It comes in multiple versions to give utmost versatility and choice to its users. In this way, it has surpassed any competition that it encountered on its way to becoming a necessity in today’s world. Besides being an exceptionally simple to use software suite, it is equally convenient to set it up. At “office.com/setup”, you can easily deploy your purchased version of MS Office without much hassle.





    Office.com/setup

    ReplyDelete
  7. Hp has added one great feature with their Hp printers which is known as Hp printer assistant whose work is to manage the printing tasks of the machine. It also helps you to print and scan the documents.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. How to Activate McAfee Security by Email Activation Code. When you purchase McAfee products through an online store or through its official website.

    www.mcafee.com/activate |

    If you want to activate Amazon prime video on the device just follow easy steps to Register Amazon Prime Video on TV and Devices.

    www.amazon.com/mytv |

    ReplyDelete
  10. Saumitr desi A2 cow milk ghee Saumitr desi A2 cow milk ghee is success in
    Delhi NCR Delhi NCR . A2 is the primary part of milk that brings from unique variety
    of cow .For unadulterated and new milk we give desi treatment to our creature .we are not utilizing any drug or infusion for
    milk. we give great climate to solid and new milk .we give appropriate treatment with specialist remedy. our
    milk quality milk quality checked by specialist then we are utilizing Authentic
    Vedic interaction of making A2 cow milk that accommodating for medical advantages and improve your mind working and memory,
    improve your vision ,eliminate dim circle, reinforces heart, help in developing child to accomplish superb stature
    accommodating for pregnant ladies, increment bone thickness, help in processing ,improve your skin shine and heaps of
    advantages in our A2 desi cow milk gheeA2 desi cow milk ghee.

    ReplyDelete
  11. This will give you the power to stream all the ESPN content on your device without facing any problems. TO know more about the activation process click here.
    https://www.espn-comactivate.com
    Espn.com/activate

    ReplyDelete
  12. Wow Great quality stuff here. Definitely value bookmarking for revisiting. I am surprised how many attempts you have made to make any such excellent informative website.
    https://hbomax-maxtvsign.com/
    https://www.espn-comactivate.com
    Espn.com/activate

    ReplyDelete
  13. It is a great blog post. I am Always reading your blog. Helpful and Informative blog. Thanks for sharing this information with us.
    espn.com/activate
    www.espn.com/activate
    office.com/setup home & student 2019

    ReplyDelete
  14. Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download Now

    >>>>> Download Full

    Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download LINK

    >>>>> Download Now

    Liferay Tech Support: Web Content Management And Liferay Variables >>>>> Download Full

    >>>>> Download LINK Gv

    ReplyDelete
  15. If you don't know that how to write good content so you can go to Web Content Management to write a content without knowledge of content writing. NordVPN 3 year coupon

    ReplyDelete