简体   繁体   中英

Is it possible to integrate IBM RTC Advisor fields to JAXB

I'm working on IBM RTC Advisors, based on a Workshop provided in http://jazz.net .

Now I´m trying to port the xsd document provided in their OSGi module to annotations+jaxb.

That´s part of the XSD:

<xsd:element name="followup-action" substitutionGroup="process:followup-action"
    type="buildOnStateChangeType"/>

<xsd:complexType name="buildOnStateChangeType">
    <xsd:annotation>
        <xsd:documentation>
            This type defines the build on state change type. It is a
            subtype of the abstract process:followupActionType. This
            restriction, along with the substitutionGroup specification
            above, makes it possible to add configuration of the participant
            to a project or team area's process configuration. Note the
            forward references to the trigger and build types defined below.
            Take particular note of the id attribute. It is required and has
            a fixed value that points to our operation participant extension.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
        <xsd:restriction base="process:followupActionType">
            <xsd:all>
                <xsd:element name="trigger" type="triggerType"
                    minOccurs="1" maxOccurs="1"/>
                <xsd:element name="build" type="buildType" minOccurs="1"
                    maxOccurs="1"/>
            </xsd:all>
            <xsd:attribute name="id" type="xsd:string" use="required"
                fixed="net.jazz.rtcext.workitem.extensions.service.buildOnStateChange"/>
        </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="triggerType">
    <xsd:annotation>
        <xsd:documentation>
            This type defines the work item type to be monitored
            and the work item state that should trigger the
            operation participant.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:all>
        <xsd:element name="changed-workitem-type" minOccurs="1"
            maxOccurs="1">
            <xsd:complexType>
                <xsd:attribute name="id" type="xsd:string"
                    use="required"/>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="trigger-state" minOccurs="1" maxOccurs="1">
            <xsd:complexType>
                <xsd:attribute name="id" type="xsd:string"
                    use="required"/>
            </xsd:complexType>
        </xsd:element>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="buildType">
    <xsd:annotation>
        <xsd:documentation>
            This type defines the build to run. At this point, it just
            includes the build definition id. In the future, it could
            include more information, for example, a list of properties
            to pass to the build.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:all>
        <xsd:element name="build-definition" minOccurs="1" maxOccurs="1">
            <xsd:complexType>
                <xsd:attribute name="id" type="xsd:string"
                    use="required"/>
            </xsd:complexType>
        </xsd:element>
    </xsd:all>
</xsd:complexType>

And this is part of the XML from process template:

<followup-action
    xmlns="http://net.jazz.rtcext.workitem.extensions.service/server/buildOnStateChange"
    description="When the specified work item type changes to the specified state, the
    specified build will be requested."
    id="net.jazz.rtcext.workitem.extensions.service.buildOnStateChange"
    name="Build on State Change">
    <trigger>
        <changed-workitem-type id="com.ibm.team.apt.workItemType.story"/>
        <trigger-state id="com.ibm.team.apt.story.tested"/>
    </trigger>
    <build>
        <build-definition id="our.integration.build.bogus"/>
    </build>
</followup-action>

My problem is, how is the best way to port that XSD, to Java Classes with JAXB annotations? I tried reverse engineering using Eclipse (Luna) JAXB support.

Source: https://jazz.net/library/article/1000

Thank you

Sorry, can't comment yet........

Why do you want to do what you describe above? The data described by the XSD is stored in the process configuration and there is a set of API available to access the data from within the extension.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM