Content completion issue
Posted: Fri Jul 21, 2023 1:25 pm
Hello,
We used the version 25.0.0.0 of oxygen sdk.
We have this xsd :
In content completion, we have this :
If I insert model element alone, the model attribute is well defined with TBD value.
If I insert version element in an existing model element, the version attribute is well defined with TBD value.
But if I force the insertion of version element without the model parent existing, the schemaAware insertion will add something like this :
And if I force the insertion of versrank element without the version and model parent existing, the schemaAware insertion will add something like this :
Why content completion rules are lost when insertion is build thanks to shemaAware ?
I tried to set those attributes manually thanks to AuthorDocumentFilter, but it does not work.
The method insertNode is used to insert parents node (model and/or version), before the insertion I set the attribute values.
It seems to insert node correctly with good values, but when it comes to insertFragment method, attributes values have been replaced.
How can I fix this ?
Regards,
Isabelle
We used the version 25.0.0.0 of oxygen sdk.
We have this xsd :
Code: Select all
<xs:attribute name="model" type="xs:string"/>
<xs:element name="model" type="modelType"/>
<xs:complexType name="modelType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="version"/>
<xs:element minOccurs="0" ref="batchno"/>
<xs:element minOccurs="0" ref="maintlevel"/>
</xs:sequence>
<xs:attribute ref="model" use="required"/>
</xs:complexType>
<xs:attribute name="version" type="xs:string"/>
<xs:element name="version" type="versionType"/>
<xs:complexType name="versionType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="versrank"/>
</xs:sequence>
<xs:attribute ref="version" use="required"/>
<xs:attribute ref="id"/>
</xs:complexType>
<xs:element name="versrank" type="versrankType"/>
<xs:complexType name="versrankType">
<xs:choice maxOccurs="unbounded">
<xs:element ref="single"/>
<xs:element ref="range"/>
</xs:choice>
<xs:attribute ref="verstatus"/>
</xs:complexType>
<xs:element name="single" type="xs:string"/>
<xs:element name="range" type="xs:string"/>
Code: Select all
<elementProposals path="model">
<insertAttribute name="model" value="TBD"/>
</elementProposals>
<elementProposals path="version">
<insertAttribute name="version" value="TBD"/>
</elementProposals>
Code: Select all
<model model="TBD"/>
Code: Select all
<model model="TBD">
<version version="TBD"/>
</model>
Code: Select all
<model model="model_gwf_gfs_2yb">
<version version="TBD"/>
</model>
Code: Select all
<model model="model_xpm_hfs_2yb">
<version version="version_jqm_hfs_2yb">
<versrank/>
</version>
</model>
I tried to set those attributes manually thanks to AuthorDocumentFilter, but it does not work.
The method insertNode is used to insert parents node (model and/or version), before the insertion I set the attribute values.
Code: Select all
@Override
public boolean insertNode(AuthorDocumentFilterBypass authorDocumentFilterBypass, int i, AuthorNode authorNode)
{
setRequiredAttributes(authorNode);
return super.insertNode(authorDocumentFilterBypass, i, authorNode);
}
private void setRequiredAttributes(AuthorNode authorNode) {
AuthorElement elementNote = (AuthorElement) authorNode;
if(StringUtils.equals(authorNode.getName(), "model")){
elementNote.setAttribute("model", new AttrValue("TBD"));
} else if(StringUtils.equals(authorNode.getName(), "version")){
elementNote.setAttribute("version", new AttrValue("TBD"));
}
}
How can I fix this ?
Regards,
Isabelle