Manage central outoutclass
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Manage central outoutclass
I am looking for a way to manage a central list of outputclasses for our authoring team.
Currently I have the list in default-options.xml but this has caused an issue where those outputclasses are listed in the Edit Profiling window.
I would like to find a different solution. I started looking at the cc_value_config.xml which works in 17.0 but does not work in 16.1 and we are currently limited to this version.
One note the cc_value_config.xml works with codeblock which is the file by default.
Any suggestions?
Thanks
Currently I have the list in default-options.xml but this has caused an issue where those outputclasses are listed in the Edit Profiling window.
I would like to find a different solution. I started looking at the cc_value_config.xml which works in 17.0 but does not work in 16.1 and we are currently limited to this version.
One note the cc_value_config.xml works with codeblock which is the file by default.
Any suggestions?
Thanks
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi,
A couple of weeks ago I wrote a blog entry about various ways to have controlled attribute values with DITA:
http://blog.oxygenxml.com/2015/07/contr ... -your.html
You should try the Subject Scheme Map approach.
One more thing, I do not understand this remark you made:
Radu
A couple of weeks ago I wrote a blog entry about various ways to have controlled attribute values with DITA:
http://blog.oxygenxml.com/2015/07/contr ... -your.html
You should try the Subject Scheme Map approach.
One more thing, I do not understand this remark you made:
Regards,One note the cc_value_config.xml works with codeblock which is the file by default.
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Manage central outoutclass
Hi Radu,
thanks for the reply.
I tried dropping the cc_value_config.xml file into our 16.1 plugin folder and it worked for codeblock but when I tried to edit the file to add outputclasses for other elements it did not work.
Our vendor for our CMS/Oxygen tool has heard back from your support recommending we:
ro.sync.contentcompletion.xml.SchemaManagerFilter" API and use it in the "Extensions" tab for the DITA document type configuration.
But i am not sure how to do this.
I will look at the Subject Scheme Map approach as well as an alternative.
thanks for the reply.
I tried dropping the cc_value_config.xml file into our 16.1 plugin folder and it worked for codeblock but when I tried to edit the file to add outputclasses for other elements it did not work.
Our vendor for our CMS/Oxygen tool has heard back from your support recommending we:
ro.sync.contentcompletion.xml.SchemaManagerFilter" API and use it in the "Extensions" tab for the DITA document type configuration.
But i am not sure how to do this.
I will look at the Subject Scheme Map approach as well as an alternative.
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi,
I also discussed in a separate email exchange with your vendor.
The " cc_value_config.xml" is a feature added in Oxygen 17.0 so it will not work with Oxygen 16.1.
The subject scheme map approach does not work when Oxygen is integrated with Ixiasoft because they have their own way of editing DITA Maps.
So if you have a Java developer the only approach with 16.1 would be to develop a Java extension of the "ro.sync.contentcompletion.xml.SchemaManagerFilter" API and use it in the "Extensions" tab for the DITA document type configuration.
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
Our Author SDK Maven-based project is located here:
http://www.oxygenxml.com/oxygen_sdk.html
Of course I would recommend upgrading to Oxygen 17.0 but I do not know if Ixia officially supports it.
Regards,
Radu
I also discussed in a separate email exchange with your vendor.
The " cc_value_config.xml" is a feature added in Oxygen 17.0 so it will not work with Oxygen 16.1.
The subject scheme map approach does not work when Oxygen is integrated with Ixiasoft because they have their own way of editing DITA Maps.
So if you have a Java developer the only approach with 16.1 would be to develop a Java extension of the "ro.sync.contentcompletion.xml.SchemaManagerFilter" API and use it in the "Extensions" tab for the DITA document type configuration.
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
Our Author SDK Maven-based project is located here:
http://www.oxygenxml.com/oxygen_sdk.html
Of course I would recommend upgrading to Oxygen 17.0 but I do not know if Ixia officially supports it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Manage central outoutclass
Hi Radu,
I created a test extension based on the code samples found here:
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
I created the following class just to test getting this working:
It compiles. And my assumption this would set the default for the frame attribute to topbot.
So question when I go to the extensions tab how do I add it to the extensions tab?
Do i change the extensions bundle?
Or add it under one of the individual extensions?
Thanks
I created a test extension based on the code samples found here:
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
I created the following class just to test getting this working:
Code: Select all
package org.agfa.sync.contentcompletion.xml;
import java.util.List;
import java.util.ArrayList;
import ro.sync.contentcompletion.xml.CIAttribute;
import ro.sync.contentcompletion.xml.CIElement;
import ro.sync.contentcompletion.xml.CIValue;
import ro.sync.contentcompletion.xml.Context;
import ro.sync.contentcompletion.xml.ContextElement;
import ro.sync.contentcompletion.xml.SchemaManagerFilter;
import ro.sync.contentcompletion.xml.WhatAttributesCanGoHereContext;
import ro.sync.contentcompletion.xml.WhatElementsCanGoHereContext;
import ro.sync.contentcompletion.xml.WhatPossibleValuesHasAttributeContext;
public class SDFSchemaManagerFilter implements SchemaManagerFilter {
/**
* Filter attributes of the "table" element.
*/
public List<CIAttribute> filterAttributes(List<CIAttribute> attributes,
WhatAttributesCanGoHereContext context) {
// If the element from the current context is the 'table' element add the
// attribute named 'frame' to the list of default content completion proposals
if (context != null) {
ContextElement contextElement = context.getParentElement();
if ("table".equals(contextElement.getQName())) {
CIAttribute frameAttribute = new CIAttribute();
frameAttribute.setName("frame");
frameAttribute.setRequired(false);
frameAttribute.setFixed(false);
frameAttribute.setDefaultValue("topbot");
if (attributes == null) {
attributes = new ArrayList<CIAttribute>();
}
attributes.add(frameAttribute);
}
}
return attributes;
}
public List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context) {
return attributeValues;
}
public java.util.List<CIElement> filterElements(java.util.List<CIElement> elements, WhatElementsCanGoHereContext context){
return elements;
}
public java.util.List<CIValue> filterElementValues(java.util.List<CIValue> elementValues, Context context){
return elementValues;
}
public java.lang.String getDescription(){
return "";
}
}
So question when I go to the extensions tab how do I add it to the extensions tab?
Do i change the extensions bundle?
Or add it under one of the individual extensions?
Thanks
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Manage central outoutclass
Hi Radu,
I have tried the java route to create an extension as suggested but it does not seem to be working.
I took the code sample found here:
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
And tried to implement the Filter attributes but i cannot seem to get it to work. Reading the code if element equals table then it sets the frame attribute.
I made this slight change:
frameAttribute.setDefaultValue("topbot");
So for a table element and if I select frame attribute it should default to topbot.
I added the classpath to DITA Document Type association and on the extensions tab added my extension to the Content Completion handler. Is this correct?
Thanks
Arron
I have tried the java route to create an extension as suggested but it does not seem to be working.
I took the code sample found here:
http://www.oxygenxml.com/doc/versions/1 ... ndler.html
And tried to implement the Filter attributes but i cannot seem to get it to work. Reading the code if element equals table then it sets the frame attribute.
I made this slight change:
frameAttribute.setDefaultValue("topbot");
So for a table element and if I select frame attribute it should default to topbot.
I added the classpath to DITA Document Type association and on the extensions tab added my extension to the Content Completion handler. Is this correct?
Thanks
Arron
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi Aaron,
Coming back to your original intention of providing a default list of possible values for a certain @outputclass attribute on a certain element, that could have been done like this:
If the extension is properly installed, then in the Attributes view when you want to edit the @outputclass attribute on a DITA <p> element you should have 2 values listed there.
You can also check your extension is installed by printing some debug information to an external file when the filterAttributeValues method is called. In this way we would know if the extension was properly installed or not.
Coming back to what you tried to do by changing the filterAttributes callback, is it another use case that you have?
Regards,
Radu
Coming back to your original intention of providing a default list of possible values for a certain @outputclass attribute on a certain element, that could have been done like this:
Code: Select all
public List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context) {
if (context != null) {
ContextElement contextElement = context.getParentElement();
if ("p".equals(contextElement.getQName())) {
if("outputclass".equals(context.getAttributeName())){
if(attributeValues == null){
attributeValues = new ArrayList<CIValue>();
}
attributeValues.add(new CIValue("val1"));
attributeValues.add(new CIValue("val2"));
}
}
}
return attributeValues;
}
You can also check your extension is installed by printing some debug information to an external file when the filterAttributeValues method is called. In this way we would know if the extension was properly installed or not.
Coming back to what you tried to do by changing the filterAttributes callback, is it another use case that you have?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Manage central outoutclass
Issue popped up..the extension is overriding all attributes, so our audience, prop, etc are not loading.
Is there a way to have the default behaviour happen for other attributes and only override outputclass?
Is there a way to have the default behaviour happen for other attributes and only override outputclass?
Code: Select all
public List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context)
{
ContextElement contextElement = context.getParentElement();
if (context == null || contextElement == null)
{
//log.ERROR
return attributeValues;
}
String elementName = contextElement.getQName();
if("outputclass".equals(context.getAttributeName()))
{
try
{
if(attributeValues == null)
{
attributeValues = new ArrayList<CIValue>();
//Get outputclasses that apply to all nodes
addAttributesToList(getItemNodeList("*"),attributeValues);
}
}
catch (Exception e)
{
appendToFile(e, "filterAttributeValues - all nodes");
}
try
{
if (elementName != null)
{
//Get outputclasses that apply to current element
NodeList nodeList = null;
try
{
nodeList = getItemNodeList(elementName);
}
catch (Exception e)
{
appendToFile(e, "filterAttributeValues - nodeList");
}
try
{
addAttributesToList(nodeList,attributeValues);
}
catch (Exception e)
{
appendToFile(e, "filterAttributeValues - addAttributesToList");
}
}
}
catch (Exception e)
{
appendToFile(e, "filterAttributeValues - current element=" + elementName);
}
}
return attributeValues;
}
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi,
That's the main problem with setting the Java extension, it overrides the default DITA ro.sync.ecss.extensions.dita.DITASchemaManagerFilter which provides values for profiling attribute values, for key references.
You could try to extend the ro.sync.ecss.extensions.dita.DITASchemaManagerFilter (located in the "dita.jar") and at the end of your implementation of filterAttributeValues, delegate to super.filterAttributeValues.
https://www.oxygenxml.com/InstData/Edit ... ilter.html
If for some reason this fails you can email us at support@oxygenxml.com and I will provide the entire Java sources for the DITASchemaManagerFilter class so that you can incorporate both behaviors in your extension class.
Regards,
Radu
That's the main problem with setting the Java extension, it overrides the default DITA ro.sync.ecss.extensions.dita.DITASchemaManagerFilter which provides values for profiling attribute values, for key references.
You could try to extend the ro.sync.ecss.extensions.dita.DITASchemaManagerFilter (located in the "dita.jar") and at the end of your implementation of filterAttributeValues, delegate to super.filterAttributeValues.
https://www.oxygenxml.com/InstData/Edit ... ilter.html
If for some reason this fails you can email us at support@oxygenxml.com and I will provide the entire Java sources for the DITASchemaManagerFilter class so that you can incorporate both behaviors in your extension class.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Manage central outoutclass
Thanks Radu.
I tried extending my implementation but now I can no longer add my class to the content completion handler. It does not find it.
I tried extending my implementation but now I can no longer add my class to the content completion handler. It does not find it.
Code: Select all
public class SDFSchemaManagerFilter extends ro.sync.ecss.extensions.dita.DITASchemaManagerFilter implements SchemaManagerFilter
{
//SDFSchemaManagerFilter(){
//return super();
//}
SDFSchemaManagerFilter(java.lang.String documentTypeName){
super(documentTypeName);
return;
...
}
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi Aaron,
I will look into the problem with the detection when the class does not directly extend the interface.
Could you try this workaround?
Have the class directly extend the interface. The class would have the "DITASchemaManagerFilter" defined as a field inside it like:
Regards,
Radu
I will look into the problem with the detection when the class does not directly extend the interface.
Could you try this workaround?
Have the class directly extend the interface. The class would have the "DITASchemaManagerFilter" defined as a field inside it like:
Code: Select all
public class SDFSchemaManagerFilter implements SchemaManagerFilter {
private DITASchemaManagerFilter ditaFilter = new DITASchemaManagerFilter("DITA");
/**
* @see ro.sync.contentcompletion.xml.SchemaManagerFilter#filterElements(java.util.List, ro.sync.contentcompletion.xml.WhatElementsCanGoHereContext)
*/
@Override
public List<CIElement> filterElements(List<CIElement> elements,
WhatElementsCanGoHereContext context) {
return ditaFilter.filterElements(elements, context);
}
/**
* @see ro.sync.contentcompletion.xml.SchemaManagerFilter#filterAttributeValues(java.util.List, ro.sync.contentcompletion.xml.WhatPossibleValuesHasAttributeContext)
*/
@Override
public List<CIValue> filterAttributeValues(List<CIValue> attributeValues,
WhatPossibleValuesHasAttributeContext context) {
//HERE YOU DO YOUR THING
return ditaFilter.filterAttributeValues(attributeValues, context);
}
///AND SO ON, DELEGATE ALL CALLBACKS TO THE DITA FILTER
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Manage central outoutclass
Hi,
I looked more into this problem:
So the code should have been something like:
Regards,
Radu
I looked more into this problem:
When the schema manager filter is set as an individual custom extension, it needs to have a default constructor in order to be instantiated.I tried extending my implementation but now I can no longer add my class to the content completion handler.
So the code should have been something like:
Code: Select all
public class SDFSchemaManagerFilter extends ro.sync.ecss.extensions.dita.DITASchemaManagerFilter implements SchemaManagerFilter
{
SDFSchemaManagerFilter(){
super("DITA");
return;
...
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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