Class PropertyXMLBuilderBase
- java.lang.Object
-
- com.sun.identity.console.property.PropertyXMLBuilderBase
-
- All Implemented Interfaces:
PropertyTemplate
- Direct Known Subclasses:
AgentPropertyXMLBuilder,PolicyPropertyXMLBuilderBase,PropertyXMLBuilder,SubConfigPropertyXMLBuilder
public abstract class PropertyXMLBuilderBase extends Object implements PropertyTemplate
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallAttributesReadonlyprotected StringcurrentRealmstatic Debugdebugprotected static MapmapSchemaTypeToNameprotected static MapmapSyntaxToNameprotected MapmapTypeToAttributeSchemaprotected static MapmapTypeToNameprotected static MapmapUITypeToNameprotected AMModelmodelprotected static ListorderDisplaySchemaTypeprotected static ResourceBundlepropertiesprotected ResourceBundleserviceBundleprotected StringserviceNameprotected booleansupportSubConfigprotected ServiceSchemaManagersvcSchemaManagerprotected StringviewBeanName-
Fields inherited from interface com.sun.identity.console.property.PropertyTemplate
ADD_REMOVE_COMPONENT_XML, ANY_ADMIN_DISPLAY, ANY_ADMIN_DISPLAYRO, ANY_DISPLAY, ANY_DISPLAYRO, ANY_REQUIRED, BLANK_VALUE, COMPONENT_ACTION_BUTTON_START_TAG, COMPONENT_ADD_REMOVE_DUPLICATION_EDIT_TAG, COMPONENT_BOOLEAN_START_TAG, COMPONENT_BUTTON_START_TAG, COMPONENT_EDITABLE_LIST_START_TAG, COMPONENT_END_TAG, COMPONENT_GLOBAL_MAP_LIST_START_TAG, COMPONENT_LINK_START_TAG, COMPONENT_MAP_LIST_START_TAG, COMPONENT_ORDERED_LIST_START_TAG, COMPONENT_PWD_START_TAG, COMPONENT_START_TAG, COMPONENT_UNORDERED_LIST_START_TAG, COMPONENT_UPLOAD_BUTTON_START_TAG, DATE_MARKER, DATE_MARKER_NAME, DEFAULT_TEXTFIELD_SIZE, DEFINITION, DYN_GUI_MULTIPLE_LIST_CHECKBOX_MARKER, DYN_GUI_MULTIPLE_LIST_CHECKBOX_PREFIX, DYN_GUI_MULTIPLE_LIST_CHECKBOX_XML, DYN_GUI_MULTIPLE_LIST_MARKER_XML, END_TAG, GROUP_END_TAG, GROUP_START_TAG, HELP_TAG, LABEL_PWD_TAG, LABEL_TAG, LIST_SIZE_TAG, MULTIPLE_ATTRIBUTE_TAG, NO_AUTO_SUBMIT, NON_LOCALIZED_FIELD, NULL_TYPE, OPTION_LABEL_ATTR_NAME, OPTION_TAG, OPTION_TAG_NAME, OPTION_VALUE_ATTR_NAME, PARAM_ATTR_NAME, PARAM_PROPERTIES_VIEW_BEAN_URL, PASSWORD_VALUE_TAG, PROPERTY_END_TAG, PROPERTY_REQUIRED_START_TAG, PROPERTY_START_OPEN_TAG, PROPERTY_START_TAG, PWD_CONFIRM_SUFFIX, READONLY_START_TAG, SECTION_DUMMY_START_TAG, SECTION_END_TAG, SECTION_START_TAG, START_TAG, STATIC_TEXT_TAG_NAME, SUB_CONFIG_TABLE_VIEW_BEAN, SUB_CONFIG_TABLE_XML, SUBSECTION_DUMMY_START_TAG, SUBSECTION_END_TAG, SUBSECTION_START_TAG, TAGNAME_BUTTON, TAGNAME_CHECKBOX, TAGNAME_DROPDOWN_MENU, TAGNAME_EDITABLE_LIST, TAGNAME_GLOBAL_MAP_LIST, TAGNAME_HREF, TAGNAME_MAP_LIST, TAGNAME_MULTIPLE_CHOICE, TAGNAME_ORDERED_LIST, TAGNAME_PASSWORD, TAGNAME_TEXTAREA, TAGNAME_TEXTFIELD, TAGNAME_UNORDERED_LIST, TEXTAREA_SIZE_TAG, TEXTBOX_SIZE_TAG, VALUE_OPTION_TAG, VALUE_OPTION_TAG_NAME
-
-
Constructor Summary
Constructors Constructor Description PropertyXMLBuilderBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringappendXMLProperty(String xml, String propertyXML)Returns an altered XML.protected voidbuildAttributeSchemaTypeXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, boolean addSubSection)protected voidbuildConfirmPasswordXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle)protected voidbuildReadonlyXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle)protected voidbuildSchemaTypeXML(String schemaTypeName, Set<AttributeSchema> attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly, List<String> sectionList)protected voidbuildSchemaTypeXML(String schemaTypeName, Set attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly)protected voidbuildSchemaTypeXML(String schemaTypeName, Set attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly, boolean section, boolean addSubSection)StringescapeSpecialChars(String text)static voidfilterAttributes(Set attributeSchemas, String[] a)Removes the attributes that do not match a specified set of any display strings.static voidfilterHiddenAttributes(Set attributeSchemas)Removes hidden attribute schemas.static StringformPropertySheetXML(String properties)Returns a property XML of a given well formed attributes XML string.static StringformPropertySheetXML(String properties, boolean addSection)Returns a property XML of a given well formed attributes XML string.protected StringgetAttributeNameForPropertyXML(AttributeSchema as)protected Set<AttributeSchema>getAttributeSchemaForSection(Set<AttributeSchema> attributeSchemas, List<String> sectionList)SetgetAttributeSchemas()Returns a set of attributeSchemas that are displayed.protected StringgetCurrentRealm()static StringgetMultipleChoiceCheck(String attrName, Set choices)protected voidgetServiceResourceBundle()protected voidgetServiceResourceBundle(ServiceSchema ss)ServiceSchemaManagergetServiceSchemaManager()Returns service schema manager.StringgetViewBeanName()Returns name of view bean.static StringgetXMLDefinitionHeader()static booleanhasAnyAttribute(String any, String attribute)static StringinsertXML(String xml, String insertXML, String marker)Inserts XML to a property XML.static StringinsertXML(String xml, String insertXML, String marker, boolean afterMarker)Inserts XML to a property XML.booleanisSubConfigSupported()Returns true if sub configuration is supported.static StringprependXMLProperty(String xml, String propertyXML)Returns an altered XML.static voidremoveAttributeSchemaWithoutI18nKey(Set attributeSchemas)Removes attribute schema that does not havei18nKey.static StringremoveSubSection(String original, String attribute, String insert)voidsetAllAttributeReadOnly(boolean flag)Set all all attribute values read only.protected voidsetCurrentRealm(String value)voidsetSupportSubConfig(boolean state)Set support sub configuration state.voidsetViewBeanName(String name)Set name of view bean.static StringswapXMLProperty(String xml, String propertyName, String propertyXML)Returns a replaced XML.protected StringtagSwap(String template, String tag, String value)Performs a tag substitution on a string.
-
-
-
Field Detail
-
debug
public static Debug debug
-
properties
protected static ResourceBundle properties
-
mapSchemaTypeToName
protected static Map mapSchemaTypeToName
-
orderDisplaySchemaType
protected static List orderDisplaySchemaType
-
mapUITypeToName
protected static Map mapUITypeToName
-
mapTypeToName
protected static Map mapTypeToName
-
mapSyntaxToName
protected static Map mapSyntaxToName
-
svcSchemaManager
protected ServiceSchemaManager svcSchemaManager
-
model
protected AMModel model
-
supportSubConfig
protected boolean supportSubConfig
-
viewBeanName
protected String viewBeanName
-
serviceBundle
protected ResourceBundle serviceBundle
-
mapTypeToAttributeSchema
protected Map mapTypeToAttributeSchema
-
serviceName
protected String serviceName
-
allAttributesReadonly
protected boolean allAttributesReadonly
-
currentRealm
protected String currentRealm
-
-
Method Detail
-
filterHiddenAttributes
public static void filterHiddenAttributes(Set attributeSchemas)
Removes hidden attribute schemas.- Parameters:
attributeSchemas- Set of Attribute Schemas.
-
removeAttributeSchemaWithoutI18nKey
public static void removeAttributeSchemaWithoutI18nKey(Set attributeSchemas)
Removes attribute schema that does not havei18nKey.- Parameters:
attributeSchemas- Set of Attribute Schemas.
-
filterAttributes
public static void filterAttributes(Set attributeSchemas, String[] a)
Removes the attributes that do not match a specified set of any display strings.- Parameters:
attributeSchemas- Set of Attribute Schemas.
-
swapXMLProperty
public static String swapXMLProperty(String xml, String propertyName, String propertyXML)
Returns a replaced XML. This method replaces a property element.- Parameters:
xml- XML to operate on.propertyName- Name of the property (attribute) that is going to be replaced.propertyXML- XML to replace.- Returns:
- a replaced XML.
-
insertXML
public static String insertXML(String xml, String insertXML, String marker, boolean afterMarker)
Inserts XML to a property XML.- Parameters:
xml- Original property XML.insertXML- XML to be inserted toxml.marker- A marker whereinsertXMLwill be inserted.afterMarker-trueto insert XML after marker.- Returns:
- the modified XML.
-
insertXML
public static String insertXML(String xml, String insertXML, String marker)
Inserts XML to a property XML.- Parameters:
xml- Original property XML.insertXML- XML to be inserted toxml.marker- A marker whereinsertXMLwill be inserted.- Returns:
- the modified XML.
-
isSubConfigSupported
public boolean isSubConfigSupported()
Returns true if sub configuration is supported.- Returns:
- true if sub configuration is supported.
-
setSupportSubConfig
public void setSupportSubConfig(boolean state)
Set support sub configuration state.- Parameters:
state-trueto support sub configuration.
-
setViewBeanName
public void setViewBeanName(String name)
Set name of view bean.- Parameters:
name- Name of view bean.
-
getViewBeanName
public String getViewBeanName()
Returns name of view bean.- Returns:
- Name of view bean.
-
getServiceResourceBundle
protected void getServiceResourceBundle()
-
getAttributeSchemas
public Set getAttributeSchemas()
Returns a set of attributeSchemas that are displayed.- Returns:
- Set of attribute names that are displayed.
-
getServiceResourceBundle
protected void getServiceResourceBundle(ServiceSchema ss)
-
buildReadonlyXML
protected void buildReadonlyXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle)
-
buildAttributeSchemaTypeXML
protected void buildAttributeSchemaTypeXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, boolean addSubSection)
-
buildConfirmPasswordXML
protected void buildConfirmPasswordXML(AttributeSchema as, StringBuffer xml, AMModel model, ResourceBundle serviceBundle)
-
setCurrentRealm
protected void setCurrentRealm(String value)
-
getCurrentRealm
protected String getCurrentRealm()
-
removeSubSection
public static String removeSubSection(String original, String attribute, String insert)
-
prependXMLProperty
public static String prependXMLProperty(String xml, String propertyXML)
Returns an altered XML. This method prepends a property element.- Parameters:
xml- XML to operate on.propertyXML- XML to replace.- Returns:
- the altered XML.
-
appendXMLProperty
public static String appendXMLProperty(String xml, String propertyXML)
Returns an altered XML. This method appends a property element.- Parameters:
xml- XML to operate on.propertyXML- XML to replace.- Returns:
- the altered XML.
-
getServiceSchemaManager
public ServiceSchemaManager getServiceSchemaManager()
Returns service schema manager.- Returns:
- service schema manager.
-
buildSchemaTypeXML
protected void buildSchemaTypeXML(String schemaTypeName, Set attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly)
-
buildSchemaTypeXML
protected void buildSchemaTypeXML(String schemaTypeName, Set attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly, boolean section, boolean addSubSection)
-
buildSchemaTypeXML
protected void buildSchemaTypeXML(String schemaTypeName, Set<AttributeSchema> attributeSchemas, StringBuffer xml, AMModel model, ResourceBundle serviceBundle, Set readonly, List<String> sectionList)
-
getAttributeSchemaForSection
protected Set<AttributeSchema> getAttributeSchemaForSection(Set<AttributeSchema> attributeSchemas, List<String> sectionList)
-
formPropertySheetXML
public static String formPropertySheetXML(String properties)
Returns a property XML of a given well formed attributes XML string.- Parameters:
properties- Well formed attributes XML string..- Returns:
- a property XML of a given well formed attributes XML string.
-
formPropertySheetXML
public static String formPropertySheetXML(String properties, boolean addSection)
Returns a property XML of a given well formed attributes XML string.- Parameters:
properties- Well formed attributes XML string..addSection-trueto add a dummy section to the XML.- Returns:
- a property XML of a given well formed attributes XML string.
-
setAllAttributeReadOnly
public void setAllAttributeReadOnly(boolean flag)
Set all all attribute values read only.- Parameters:
flag- true if all attribute values are read only.
-
getAttributeNameForPropertyXML
protected String getAttributeNameForPropertyXML(AttributeSchema as)
-
tagSwap
protected String tagSwap(String template, String tag, String value)
Performs a tag substitution on a string.- Parameters:
template- Template for tag swapping.tag- Tag.value- Value of Tag.
-
getXMLDefinitionHeader
public static String getXMLDefinitionHeader()
-
-