Package ro.sync.contentcompletion.xml
Class StyleGuideSchemaManagerFilterBase
java.lang.Object
ro.sync.contentcompletion.xml.SchemaManagerFilterBase
ro.sync.contentcompletion.xml.StyleGuideSchemaManagerFilterBase
- All Implemented Interfaces:
SchemaManagerFilter
,Extension
@API(type=EXTENDABLE,
src=PUBLIC)
public abstract class StyleGuideSchemaManagerFilterBase
extends SchemaManagerFilterBase
Style guide schema manager filter base.
The default implementation adds annotations to elements and attributes by looking into a mapping file URI which is passed through the XML Catalog system...
- Since:
- 15
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ro.sync.i18n.MessageBundle
The messages resource bundle. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.StyleGuideSchemaManagerFilterBase
(String locationOfMappingFile) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfilterAttributes
(List<CIAttribute> attributes, WhatAttributesCanGoHereContext context) Filters the attributes proposed by the editor content completion schema manager.filterElements
(List<CIElement> elements, WhatElementsCanGoHereContext context) Filters the elements proposed by the editor content completion schema manager.getAttributeDescription
(CIAttribute attribute, WhatPossibleValuesHasAttributeContext ctxt) Get an element's description in a certain context.getElementDescription
(CIElement element, Context ctxt) Get element description, contributes HTML annotation to it..protected String
getMappingFileLocation
(Context context) Get the location for the mapping between elements name and their documentation.void
Invalidates any cached data.protected boolean
Iftrue
will redirect all links through the Oxygen web site.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ro.sync.ecss.extensions.api.Extension
getDescription
Methods inherited from interface ro.sync.contentcompletion.xml.SchemaManagerFilter
filterAttributeValues, filterElementValues
-
Field Details
-
messages
protected static final ro.sync.i18n.MessageBundle messagesThe messages resource bundle.
-
-
Constructor Details
-
StyleGuideSchemaManagerFilterBase
public StyleGuideSchemaManagerFilterBase()Constructor. -
StyleGuideSchemaManagerFilterBase
Constructor.- Parameters:
locationOfMappingFile
- Location of the mapping file.
-
-
Method Details
-
filterElements
public List<CIElement> filterElements(List<CIElement> elements, WhatElementsCanGoHereContext context) Description copied from interface:SchemaManagerFilter
Filters the elements proposed by the editor content completion schema manager. The original list of elements is obtained by examining the current document schema and determining what possible elements can be inserted in the current context. For example ifperson
is the currentCIElement
, and the list of children contains the elementsname
andaddress
, the result of choosing the person entry from the content completion window will be the insertion of the following sequence:<person> <name>...</name> <address>...</address> </person>
name
CIElement can be replaced by a new one which returns a list with two new CIElements,firstName
andlastName
, on theCIElement.getGuessElements()
method call. The new generated sequence would be:<person> <name> <firstName>...</firstName> <lastName>...</lastName> </name> <address>...</address> </person>
- Parameters:
elements
- The list of elements (CIElement
) to be filtered.context
- TheWhatElementsCanGoHereContext
where the list of elements is requested. Ifnull
then the given list of content completion elements contains global elements.- Returns:
- The filtered list of
CIElement
ornull
if all elements are rejected by the filter. - See Also:
-
getMappingFileLocation
Get the location for the mapping between elements name and their documentation.- Parameters:
context
- The current elements context.- Returns:
- The styles guide mapping location.
-
filterAttributes
public List<CIAttribute> filterAttributes(List<CIAttribute> attributes, WhatAttributesCanGoHereContext context) Description copied from interface:SchemaManagerFilter
Filters the attributes proposed by the editor content completion schema manager. The original list of attributes is obtained by examining the current document schema and determining what attributes can be inserted in the current element and taking into account the list of existing attributes.- Parameters:
attributes
- The list of attributes (CIAttribute
) to be filtered. Can be NULLcontext
- TheWhatAttributesCanGoHereContext
where the list of attributes is requested.- Returns:
- The filtered list of
CIAttribute
ornull
if all attributes are rejected by the filter. - See Also:
-
getElementDescription
Get element description, contributes HTML annotation to it..- Overrides:
getElementDescription
in classSchemaManagerFilterBase
- Parameters:
element
- The CIElementctxt
- The context.- Returns:
- The modified CIElement with HTML annotation.
-
getAttributeDescription
public CIAttribute getAttributeDescription(CIAttribute attribute, WhatPossibleValuesHasAttributeContext ctxt) Description copied from class:SchemaManagerFilterBase
Get an element's description in a certain context.- Overrides:
getAttributeDescription
in classSchemaManagerFilterBase
- Parameters:
attribute
- The attribute description which has been computed in the context by the default schema manager implementation.ctxt
- The context.- Returns:
- The attribute description which could be changed by this implementation or the same description.
- See Also:
-
invalidate
public void invalidate()Description copied from class:SchemaManagerFilterBase
Invalidates any cached data.- Overrides:
invalidate
in classSchemaManagerFilterBase
- See Also:
-
shouldRedirectThroughOxygenWebSite
protected boolean shouldRedirectThroughOxygenWebSite()Iftrue
will redirect all links through the Oxygen web site.- Returns:
true
if the filter will redirect all links through the Oxygen web site.
-