Skip to content
Commit e1b1b501 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Address reopening https://bugs.kde.org/show_bug.cgi?id=409411#c4

> > The sections "actors", "usecases", "interfaces", "classes" in the
> > generated docbook continue to be empty after that change: [...]
>
> This problem is fixed in the UML1 mode but in UML2 mode it persists.

umbrello/docgenerators/xmi1docbook.xsl
- Copy from xmi2docbook.xsl for use in UML1 mode.
- In <xsl:template name="actor"> <xsl:for-each> fix "select" expression.
- In <xsl:template name="usecase"> <xsl:for-each> fix "select" expr.

umbrello/docgenerators/xmi2docbook.xsl - adaptation to UML2 mode:
- In <xsl:stylesheet> replace
    xmlns:UML="http://schema.omg.org/spec/UML/1.4"
    exclude-result-prefixes="UML"
  by
    xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
    xmlns:uml="http://schema.omg.org/spec/UML/2.1"
    exclude-result-prefixes="uml"
- In all <xsl:key> replace use="@xmi.id" by use="@xmi:id".
- In all <xsl:template>,
  - change namespace prefix "UML:" to "uml:".
  - replace select="@xmi.id" by select="@xmi:id";
  - change UML:Actor to packagedElement[@xmi:type = 'uml:Actor'];
  - change UML:UseCase to packagedElement[@xmi:type = 'uml:UseCase'];
  - change UML:Interface to packagedElement[@xmi:type ='uml:Interface'];
  - change UML:Class to packagedElement[@xmi:type = 'uml:Class'];
  - change UML:Generalization to generalization;
  - change UML:Classifier.feature/UML:Operation to ownedOperation;
  - change UML:Classifier.feature/UML:Attribute to ownedAttribute;
  - change UML:Attribute to ownedAttribute;
  - change UML:Operation to ownedOperation;
  - change UML:BehavioralFeature.parameter/UML:Parameter to
    ownedParameter;
  - change UML:Parameter to ownedParameter.

umbrello/docgenerators/docbookgenerator.cpp
- In function customXslFile set xslBaseName to "xmi1docbook.xsl" if
  Settings::optionState().generalState.uml2 is false.

umbrello/umldoc.cpp
- In function saveToXMI case Settings::optionState().generalState.uml2
  add writing of attribute "uml" with value
  "http://schema.omg.org/spec/UML/2.1".
- In function loadFromXMI, if outerTag is "XMI" or "xmi:XMI" and
  versionString is "xmi.version" then set
  Settings::optionState().generalState.uml2 true if version is greater
  than or equal to 2.0.

umbrello/docgenerators/CMakeLists.txt
- In install FILES add xmi1docbook.xsl.

umbrello/version.h
- Increment XMI2_FILE_VERSION to "2.0.4" due to <xmi:XMI> added writing
  of attribute "xmlns:uml" (see UMLDoc::saveToXMI).

BUG: 409411
FIXED-IN: 2.33.80 (KDE releases 22.03.80)
parent 999d6338
Pipeline #145831 passed with stage
in 24 minutes and 23 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment