[Alkacon Documentation]
OpenCms Scriptlet docs
Contents
Documentation for the user() method
Test for the user() method
* Documentation for the property() method
Test for the property() method
Documentation for the link() method
Test for the link() method
Documentation for the label() method
Test for the label() method
Documentation for the editable() method
Documentation for the include() method
Test for the include() method
Test for the include() method with parameters
Documentation for the template() method
Test for the template() method
JSP page with two simple template elements
Documentation for the info() method
Test for the info() method
Documentation for the getNavigation() method
Test for the getNavigation() method
|
The property() method
This method provides access to read the properties of the
current file or its parent folders as configured in the "Properties"
context menu dialog of the OpenCms explorer view.
Parameters:
Name |
Description |
java.lang.String name |
The name of the property to read. Common properties are
for example "Title", "Keywords", "Description" etc. |
Parameters:
Name |
Description |
java.lang.String name |
see above |
java.lang.String file |
This parameter allows you to specify where to search for the property.
The following values are supported:
- uri (default)
- Look up the property on the file with the
uri requested by the user.
- search.uri or search
- Look up the property by also checking all parent folders for the property,
starting with the file with uri requested by the user and
going "upward" if the property was not found there.
- element.uri
- Look up the property on the currently
processed sub - element. This is useful in templates or other pages that
consist of many elements.
- search.element.uri
- Look up the property by also checking all parent folders for the
property, starting with the file with the currently processed sub -
element and going "upward" if the property was not found there.
- {some-file-uri}
- Look up the property on that exact file
uri in the OpenCms VFS, fallback if no other valid option is
selected for the file attribute.
There are also some deprecated options for the "file" value that are
still supported but should not longer be used:
- parent
- same as uri
- search-parent
- same as search.uri
- this
- same as element.uri
- search-this
- same as search.element.uri
|
Parameters:
Name |
Description |
java.lang.String name |
see above
|
java.lang.String file |
see above |
java.lang.String
defaultValue |
A default value that is returned in
case the property was not found. |
Parameters:
Name |
Description |
java.lang.String name |
see above |
java.lang.String file |
see above |
java.lang.String
defaultValue |
see above |
boolean
escapeHtml |
If true, HTML characters are escaped by their
hexadecimal value (e.g. & becomes & #38;). |
Example usage:
Read the "Title" property of the current file:
org.opencms.jsp.CmsJspActionElement cms = new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);
String title = cms.property("Title");
Try to find the "Keywords" property of the current file and, if it is not found
there, try to find it on all parent folders:
org.opencms.jsp.CmsJspActionElement cms = new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);
String keywords = cms.property("Keywords", "search");
|
|