Different results of ciAttribute.getPossibleValues() on schema or DTD
Post here questions and problems related to editing and publishing DITA content.
Different results of ciAttribute.getPossibleValues() on schema or DTD
Hallo,
I have a stange behaviour of the methode ciAttribute.getPossibleValues().
The methode returns different results depending if I use XML Schema or DTD.
Using DTD it returs null if there are no values defined in the DTD.
On Schema it returns an empty List.
Is this behaviour because of a mistake on my Schema? I use the DITA schema from Open Dita in version 1.3.
Best Regards
Stefan
I have a stange behaviour of the methode ciAttribute.getPossibleValues().
The methode returns different results depending if I use XML Schema or DTD.
Using DTD it returs null if there are no values defined in the DTD.
On Schema it returns an empty List.
Is this behaviour because of a mistake on my Schema? I use the DITA schema from Open Dita in version 1.3.
Best Regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
Re: Different results of ciAttribute.getPossibleValues() on schema or DTD
Hello,
I have another question about the editableState of the CIAttribute Class.
Can I use this state to distinguish between a text field and a combo? Or is it also possible to get TRUE as the editable state and also a list of values in the possible Values?
Best Regards
Stefan
I have another question about the editableState of the CIAttribute Class.
Can I use this state to distinguish between a text field and a combo? Or is it also possible to get TRUE as the editable state and also a list of values in the possible Values?
Best Regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
Re: Different results of ciAttribute.getPossibleValues() on schema or DTD
Hi Stefan,
About this:
About the "editableState" we use a method like this on our side:
About this:
I confirm that's how things seem to be implemented on our side. Indeed it's a bit inconsistent, does that interfere with your work? I mean you can check if the list is not null and not empty to decide if there are possible values.Using DTD it returs null if there are no values defined in the DTD.
On Schema it returns an empty List.
About the "editableState" we use a method like this on our side:
Code: Select all
/**
* Check if the attribute can have only allowed items.
* @param attribute The attribute
* @return <code>true</code> if the attribute can have only allowed items.
*/
public static boolean canHaveOnlyAllowedValues(CIAttribute attribute){
if(attribute != null){
if(attribute.getEditableState() == EditableState.ONLY_ALLOWED_ITEMS){
return true;
} else if(attribute.getEditableState() == EditableState.SCHEMA_ONLY_ALLOWED_ITEMS){
return true;
}
}
return false;
}
}{/code}
to decide if the combo box in which the value is edited should be directly editable or not (in which case the end user can choose only by using the drop down button).
We choose to show a text field or a combo box depending on the size of the list of possible values, if the list is null or empty we show a text field.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Different results of ciAttribute.getPossibleValues() on schema or DTD
Hi Radu,
thanks for your answer.
about the EditableState it is still not clear if ist is possible to have the state TRUE and possible values?
Or the state can only be *ONLY_ALLOWED_ITEMS if there are possible values.
In case the editableState is set to TRUE and I get possible values I would have to use an editable combobox. Is this a valid case?
Best Regards,
Stefan
thanks for your answer.
This is how we fixd this issue!I mean you can check if the list is not null and not empty to decide if there are possible values.
about the EditableState it is still not clear if ist is possible to have the state TRUE and possible values?
Or the state can only be *ONLY_ALLOWED_ITEMS if there are possible values.
In case the editableState is set to TRUE and I get possible values I would have to use an editable combobox. Is this a valid case?
Code: Select all
EDITABLESTATE VALUES NO VALUES
false text field (read only) textfield (read only)
true editable combo text field
onlyAllowed.. combo x
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
Re: Different results of ciAttribute.getPossibleValues() on schema or DTD
Hi Stefan,
Regards,
Radu
Yes, it is. For example for the DITA codeblock element we proposed a number of @outputclass attribute values. But you can set your own value if you want. These proposed values do not come from the DTD but from a cc_config.xml content completion configuration file. But nonetheless this case exists.In case the editableState is set to TRUE and I get possible values I would have to use an editable combobox. Is this a valid case?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Different results of ciAttribute.getPossibleValues() on schema or DTD
Hi Radu,
how can we get the values from the content completion configuration? It feels like the values are not attached to the getPossibleValues function of CIAttribute.
Best Regards
Joseph
how can we get the values from the content completion configuration? It feels like the values are not attached to the getPossibleValues function of CIAttribute.
Best Regards
Joseph
Joseph Weichert
Senior Solution Architect
KGU TechPub Services GmbH
Senior Solution Architect
KGU TechPub Services GmbH
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service