Is it possible to integrate IBM RTC Advisor fields to JAXB - rtc

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.

Related

Unable to convert mondrian 4 schema file to mondrain 3.x schema file

We have Mondrian 4 schema file (Cube file .xml) , which is created in Mondrian 4, but the Mondrian Schema workbench(It is a beta version) currently not available. Now we are using stable version of Mondrian Schema Workbench (3.6.1) so we want to read and modify the Mondrian 4 schema file in Mondrian Schema Workbench (3.6.1) .
We use IvySE plugin but unable to succeed.
Is there any way to downgrade the schema file version (i.e. Mondrian 4.0 to Mondrian 3.6.1)?
Is any adaptor/plugin to convert schema file (i.e. Mondrian 4.0 to Mondrian 3.6.1) ?
What we have :
Mondrian 4 schema file.(Cube file .xml)
Mondrian 3.6.1 Pentaho Schema Workbench (PSW)
Example Code :
<?xml version="1.0" encoding="UTF-8"?>
<Schema name="sales" metamodelVersion="4.0">
<PhysicalSchema>
<Table name="sales" />
</PhysicalSchema>
<Cube name="Sales">
<Dimensions>
<Dimension name="City" key="City">
<Attributes>
<Attribute name="City" keyColumn="city" hasHierarchy="false" />
</Attributes>
<Hierarchies>
<Hierarchy name="City" hasAll="true">
<Level attribute="City" />
</Hierarchy>
</Hierarchies>
</Dimension>
<Dimension name="Store" key="Store">
<Attributes>
<Attribute name="Store" keyColumn="store" hasHierarchy="false" />
</Attributes>
<Hierarchies>
<Hierarchy name="Store" hasAll="true">
<Level attribute="Store" />
</Hierarchy>
</Hierarchies>
</Dimension>
</Dimensions>
<MeasureGroups>
<MeasureGroup name="Sales" table="sales">
<Measures>
<Measure name="Units sold" column="unitssold" aggregator="sum" formatString="#,###" />
</Measures>
<DimensionLinks>
<ForeignKeyLink dimension="City" foreignKeyColumn="city" />
<ForeignKeyLink dimension="Store" foreignKeyColumn="store" />
</DimensionLinks>
</MeasureGroup>
</MeasureGroups>
</Cube>
</Schema>
Thanks and Advance.
The way to downgrade 4.0 to 3.6 is edit xml manually to be compliant with 3.6.
Schema workbench had dropped support in ~2014 as far as I remember.
It don't know any tool and I don't expect somebody will spent time on creation a tool to convert from newer versions to older versions.
It depends on real xml schema you have, in very simple case if you don't use any 4.0 xml features try to edit metamodel version here:
<Schema name="sales" metamodelVersion="4.0">
Otherwise - it depends, and you can try to rewrite structure manually.

Mule 'jersey:resources' Element: binding is not allowed to be child of element component

I see following error in Anypoint studio, while working with 'jersey:resources' component of Mule as per Mule Documentation.
I understand this types of errors are due to not defining the schema. But here in this case, though schema defined, still points out the error as "not allowed to be child of element component".
Can any one help me in fixing this.?
Anypoint Studio Details:
Anypoint Studio January 2015 Release
Version: 5.0.2
Build Id: 201502251307
thanks
--Mohammad Rafiq.
The binding element is defined as:
<xsd:complexType name="pojoBindingType">
<xsd:sequence>
<xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="interface" use="required" type="substitutableClass">
<xsd:annotation>
<xsd:documentation>
The interface to be injected. A proxy will be created that implements this interface by calling out to the endpoint.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="method" use="optional">
<xsd:annotation>
<xsd:documentation>
The method on the interface that should be used. This can be omitted if the interface has a single method.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
But you are trying to put a flow-ref element in it. This can't work. Add a vm:inbound-endpoint in the TransformationFlow and replace the flow-ref with a vm:outbound-endpoint connected to the vm:inbound-endpoint.
Reference material: http://www.mulesoft.org/documentation/display/current/Component+Bindings

What do you put in RegistrySpec.xml for Izpack installation to set Size field

This is my xml file for installer.
<izpack:registry version="5.0"
xmlns:izpack="http://izpack.org/schema/registry"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/registry http://izpack.org/schema/5.0/izpack-registry-5.0.xsd">
<pack name="UninstallStuff">
<!-- Special "pack", if not defined an uninstall key will be generated automatically -->
<!-- The variable $UNINSTALL_NAME can be only used if CheckedHelloPanel will be used
because there the variable will be declared. With that variabel it is possible
to install more as one instances of the product on one machine each with an
unique uninstall key. -->
<value name="DisplayName"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
string="$APP_NAME" />
<value name="DisplayVersion"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
string="$APP_VER" />
<value name="UninstallString"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
string=""$JAVA_HOME\bin\javaw.exe" -jar "$INSTALL_PATH\uninstaller\uninstaller.jar"" />
<value name="DisplayIcon"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
string="$INSTALL_PATH\icon\uninstallericon.ico" />
<value name="Publisher"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
string="opname" />
</pack>
</izpack:registry>
I am getting publisher name but i am not able to get size field value.How can i add size field in add remove program.
I guess you've probably found the solution by now (or given up) as this question is over three years old, but I have found the solution. It doesn't seem to be documented on the IzPack site, but digging through the schema and the registry settings of other installed programs reveals the answer.
Application size is stored in the registry as a 32-bit DWORD value, which is the application's size in KB, under the key "EstimatedSize". For example, for a 100MB (==102400KB) application, your configuration would look like the following:
<value name="EstimatedSize"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
root="HKLM"
dword="102400" />

Showing command on toolbar based on perspective

I want to show a command on the toolbar based on the perspective. I have used core expressions to achieve this as below.
<extension point="org.eclipse.core.expressions.definitions">
<definition id="onValidationPerspective">
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="com.sample.perspective1"/>
</with>
</definition>
</extension>
and I have used this in the command tag as below.
<command
commandId="com.sample.run.root"
icon="icons/run_exc.gif"
label="Reset Card"
style="pulldown">
<visibleWhen checkEnabled="false">
<reference
definitionId="onValidationPerspective">
</reference>
</visibleWhen>
</command>
The above code is working fine.
But I want to extend this for mutiple perspectives, i.e. I want to show the commands on the toolbar in 2 perspectives namely com.sample.perspective1 and com.sample.perspective2.
How can I achieve this using core expressions?
You can use the OR operation element:
<definition id="onValidationPerspective">
<or>
<with ...
<with ...
</or>
</definition>
<definition id="onValidationPerspective">
<with variable="activeWorkbenchWindow.activePerspective">
<or>
<equals value="com.sample.perspective1"/>
<equals value="com.sample.perspective2"/>
</or>
</with>
</definition>

Datanucleus schema generation ignores "inheritance strategy=" directive

I'm working with the Datanucleus tutorial application for JDO, specifically this one.
Regardless which "inheritance strategy" I try the table layout is the same. I would like two tables, one for PRODUCT and one for BOOK, but using the configuration below I only get the PRODUCT table with columns for both class Product and class Book.
<class name="Product" identity-type="sequence">
<inheritance strategy="complete-table"/>
<field name="name">
<column name="PRODUCT_NAME" length="100" jdbc-type="VARCHAR"/>
</field>
<field name="description">
<column length="255" jdbc-type="VARCHAR"/>
</field>
</class>
<class name="Book" identity-type="sequence">
<field name="author">
<column length="40" jdbc-type="VARCHAR"/>
</field>
<field name="isbn">
<column length="20" jdbc-type="CHAR"/>
</field>
<field name="publisher">
<column length="40" jdbc-type="VARCHAR"/>
</field>
</class>
The directory structure is exactly as in the tutorial, as is the build.xml. I have tried generating the schema via both the Ant task and the command line.
I use the sequence of commands:
ant clean
ant compile
ant enhance
ant createschema
The schema is generated but not as the Datanucleus documentation suggests that it should be with inheritance strategy "compete-table."
My target database is PostgreSQL 8.4 running on Ubuntu 10.04 if that matters.
Anyone else run into this issue and found a solution?
To answer my own question:
In the datanucleus tutorial download, the build.xml file given has a "createschema" target like:
<target name="createschema">
...
<schematool ...>
<fileset dir="${basedir}/target/classes">
<include name="**/*.class"/>
</fileset>
...
</schematool>
</target>
It should be changed to include all .jdo files as shown below:
<target name="createschema">
...
<schematool ...>
<fileset dir="${basedir}/target/classes">
<include name="**/*.class"/>
<include name="**/*.jdo"/>
</fileset>
...
</schematool>
</target>
In addition the package-hsql.orm file needs to be renamed to package-hsql.jdo and its header needs to be changed to:
<?xml version="1.0"?>
<!DOCTYPE jdo PUBLIC
"-//Sun Microsystems, Inc.//DTD Java Data Objects ORM Metadata 2.0//EN"
"http://java.sun.com/dtd/orm_2_0.dtd">
<jdo>
...
<jdo>
Notice that the DOCTYPE and root element were changed. The root element was "orm" and changed to "jdo".
Once I made these changes the schema generation tool followed the "inheritance strategy" directive.
For my custom application, I had a similar issue, and it worked fine after making the changes in the header of the jdo file. I am using version 3.2.9.