|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opencms.widgets.A_CmsWidget
org.opencms.widgets.A_CmsSelectWidget
org.opencms.widgets.CmsSelectWidget
org.opencms.frontend.templateone.form.CmsSelectWidgetXmlcontentType
public class CmsSelectWidgetXmlcontentType
A select widget that recursively collects all CmsXmlContent resources of a given type
(name) under a given path and creates select options that contain the xmlcontents field value specified by a name
(xpath) as display String and the xmlcontents path (given) as the value.
The configuration String has to be of the following form:
"folder=<vfspath>|displayOptionMacro=<macro>|resourcetypeName=<typename>|sortMacro=<macro>[|propertyname=propertyvalue]*
where
<macro>
is a String containing valid OpenCms macros or xpath expression in the form:
"You are viewing: %(property.Title) "or
"%(xpath.Firstname) %(xpath.Lastname), Nocakla inc."in which the xpath macros will be replaced with
A_CmsXmlDocument.getValue(String, Locale)
<vfspath>
is a valid resource path to a folder in the VFS where search is started from,
<typename>
is a resource type name defined in opencms-modules.xml and
[|propertyname = propertyvalue]*
is a arbitrary number of properties value mappings that have to exist on the resources to show.
| Field Summary | |
|---|---|
static java.lang.String |
CONFIGURATION_OPTION_DISPLAY_MACRO
Configuration parameter for construction of the option display value by a macro containing xpath macros for the xmlcontent. |
static java.lang.String |
CONFIGURATION_OPTION_SORT_MACRO
Configuration parameter for choosing the macro to sort the display options by. |
static java.lang.String |
CONFIGURATION_RESOURCETYPENAME
Configuration parameter to set the name of the resource types to accept. |
static java.lang.String |
CONFIGURATION_TOPFOLDER
Configuration parameter to set the top folder in the VFS to search for xmlcontent resources. |
protected org.opencms.file.CmsObject |
m_macroCmsObject
Only used for the macro resolver to resolve macros for the collected XML contents. |
protected org.opencms.util.CmsMacroResolver |
m_macroResolver
The macro resolver to use. |
| Fields inherited from class org.opencms.widgets.A_CmsWidget |
|---|
HELP_POSTFIX, LABEL_PREFIX |
| Constructor Summary | |
|---|---|
CmsSelectWidgetXmlcontentType()
Creates an unconfigured widget that has to be configured by A_CmsWidget.setConfiguration(String) before any html output API call is triggered. |
|
CmsSelectWidgetXmlcontentType(java.lang.String configuration)
Creates an instance with the given configuration. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDisplayOptionMacro()
Returns the displayOptionXpathMacro. |
org.opencms.file.CmsResource |
getResourceFolder()
Returns the resourceFolder under which xmlcontent resources will be investigated recursively. |
int |
getResourceTypeID()
Returns the resource type id. |
org.opencms.widgets.I_CmsWidget |
newInstance()
|
protected java.util.List |
parseSelectOptions(org.opencms.file.CmsObject cms,
org.opencms.widgets.I_CmsWidgetDialog widgetDialog,
org.opencms.widgets.I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required. |
| Methods inherited from class org.opencms.widgets.CmsSelectWidget |
|---|
getDialogWidget, getWidgetStringValue |
| Methods inherited from class org.opencms.widgets.A_CmsSelectWidget |
|---|
addSelectOption, getConfiguration, getSelectedValue, getSelectedValues, getSelectOptions, setSelectOptions |
| Methods inherited from class org.opencms.widgets.A_CmsWidget |
|---|
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, hashCode, setConfiguration, setEditorValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONFIGURATION_OPTION_DISPLAY_MACRO
public static final java.lang.String CONFIGURATION_OPTION_SORT_MACRO
public static final java.lang.String CONFIGURATION_RESOURCETYPENAME
public static final java.lang.String CONFIGURATION_TOPFOLDER
protected org.opencms.file.CmsObject m_macroCmsObject
protected org.opencms.util.CmsMacroResolver m_macroResolver
| Constructor Detail |
|---|
public CmsSelectWidgetXmlcontentType()
A_CmsWidget.setConfiguration(String) before any html output API call is triggered.
public CmsSelectWidgetXmlcontentType(java.lang.String configuration)
configuration - see the class description for the format| Method Detail |
|---|
public java.lang.String getDisplayOptionMacro()
public org.opencms.file.CmsResource getResourceFolder()
public int getResourceTypeID()
public org.opencms.widgets.I_CmsWidget newInstance()
newInstance in interface org.opencms.widgets.I_CmsWidgetnewInstance in class org.opencms.widgets.CmsSelectWidgetCmsSelectWidget.newInstance()
protected java.util.List parseSelectOptions(org.opencms.file.CmsObject cms,
org.opencms.widgets.I_CmsWidgetDialog widgetDialog,
org.opencms.widgets.I_CmsWidgetParameter param)
throws org.opencms.main.CmsIllegalArgumentException
parseSelectOptions in class org.opencms.widgets.A_CmsSelectWidgetcms - the current users OpenCms contextwidgetDialog - the dialog of this widgetparam - the widget parameter of this dialog
org.opencms.main.CmsIllegalArgumentException - if the "folder" property of the configuration does not denote a folder within the VFSA_CmsSelectWidget.parseSelectOptions(org.opencms.file.CmsObject,
org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||