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
Fields Modifier and Type Field Description protected static ro.sync.i18n.MessageBundle
messages
The messages resource bundle.
-
Constructor Summary
Constructors Constructor Description StyleGuideSchemaManagerFilterBase()
Constructor.StyleGuideSchemaManagerFilterBase(java.lang.String locationOfMappingFile)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CIAttribute>
filterAttributes(java.util.List<CIAttribute> attributes, WhatAttributesCanGoHereContext context)
Filters the attributes proposed by the editor content completion schema manager.java.util.List<CIElement>
filterElements(java.util.List<CIElement> elements, WhatElementsCanGoHereContext context)
Filters the elements proposed by the editor content completion schema manager.CIAttribute
getAttributeDescription(CIAttribute attribute, WhatPossibleValuesHasAttributeContext ctxt)
Get an element's description in a certain context.CIElement
getElementDescription(CIElement element, Context ctxt)
Get element description, contributes HTML annotation to it..protected java.lang.String
getMappingFileLocation(Context context)
Get the location for the mapping between elements name and their documentation.void
invalidate()
Invalidates any cached data.protected boolean
shouldRedirectThroughOxygenWebSite()
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
-
-
-
-
Constructor Detail
-
StyleGuideSchemaManagerFilterBase
public StyleGuideSchemaManagerFilterBase()
Constructor.
-
StyleGuideSchemaManagerFilterBase
public StyleGuideSchemaManagerFilterBase(java.lang.String locationOfMappingFile)
Constructor.- Parameters:
locationOfMappingFile
- Location of the mapping file.
-
-
Method Detail
-
filterElements
public java.util.List<CIElement> filterElements(java.util.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:
SchemaManagerFilter.filterElements(java.util.List, ro.sync.contentcompletion.xml.WhatElementsCanGoHereContext)
-
getMappingFileLocation
protected java.lang.String getMappingFileLocation(Context context)
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 java.util.List<CIAttribute> filterAttributes(java.util.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:
SchemaManagerFilter.filterAttributes(java.util.List, ro.sync.contentcompletion.xml.WhatAttributesCanGoHereContext)
-
getElementDescription
public CIElement getElementDescription(CIElement element, Context ctxt)
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:
SchemaManagerFilterBase.getAttributeDescription(ro.sync.contentcompletion.xml.CIAttribute, ro.sync.contentcompletion.xml.WhatPossibleValuesHasAttributeContext)
-
invalidate
public void invalidate()
Description copied from class:SchemaManagerFilterBase
Invalidates any cached data.- Overrides:
invalidate
in classSchemaManagerFilterBase
- See Also:
SchemaManagerFilterBase.invalidate()
-
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.
-
-