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.
|
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");