Generating a config.xml file [message #1010854] |
Mon, 18 February 2013 10:46  |
Eclipse User |
|
|
|
Hello all,
This is my first post in here.
We had a task to generate a config.xml file for one of our projects which is in turn a code generator, using an UI based editor rather than typing via XML source.
I came across Sapphire and tried to model it our use case using the Bug Repository samples. But i was not successful in doing so.
I have to generate the XML based on the selection of Java Models (POJOs) from a package and other additional inputs like view, input-types and so on.
The end product XML that is expected to be generated is a JSF xml configuration file.
1. Is Sapphire the way to do it ? If yes, from where do i start? or what am i doing wrong ( I will be happy to provide you additional information on what i have done ) ?
2. Are tools like Java EE WTP (built on Sapphire) to generate the configuration file, is the way to do it ?
Thanks in advance for your suggestions and help ?
Regards,
Harsha
|
|
|
|
Re: Generating a config.xml file [message #1011686 is a reply to message #1011130] |
Wed, 20 February 2013 03:41   |
Eclipse User |
|
|
|
Thanks for the quick reply.
My aim is to generate a generic xml which looks like this.
<project>
<modules>
<module name="MainUser" auth="projectManagement">
<view-config>
<list>
<column name="username" />
<column name="forename" />
<column name="surname" />
<column name="email" />
</list>
<form>
<tab label="MainUser Details">
<input name="mainUserPk" />
<input name="username" />
<input name="password" />
<input name="forename" />
<input name="surname" />
<input name="email" />
</tab>
</form>
</view-config>
</module>
<module name="TypeCn">
<view-config>
<list type="">
<column name="typeCnId" />
</list>
<form>
<tab label="Type CN Details">
<input name="typeCnFirst" type="main-data-types/globalcls.ftl"/>
</tab>
</form>
</view-config>
</module>
</modules>
<datatypes>
<input type="id">
<template>
</input>
<input type="descr"></input>
<input type="globalcls"></input>
<input type="prp"></input>
</datatypes>
</project>
In this case, the modules are nothing but Java Models (POJOs) - which i have to pick / select from a java package within the project and the view-config below it are the properties inside the Java Models.
Currently, we are manually writing this xml using tags.
But we want to avoid this and give the user a UI where he can select this modules from a drop-down/ combo-box / picker and configure the properties below it and be able to view the xml at the end. This is when i came across Sapphire and was wondering how to model this case using Sapphire?
I went through the samples but was not able to visualize the same to my case properly. Hope some experts will be able to throw some light on this and give me a head-start in achieving this.
Thanks & Regards,
Harsha
[Updated on: Wed, 20 February 2013 03:57] by Moderator Report message to a moderator
|
|
|
|
|
Re: Generating a config.xml file [message #1012631 is a reply to message #1012199] |
Thu, 21 February 2013 23:23   |
Eclipse User |
|
|
|
The contacts repository sample should give you a decent idea on how to setup an XML-based model and present the content hierarchy in the editor. For examples of how to work with and reference java types in your model and UI, see the gallery sample.
- Konstantin
|
|
|
|
Re: Generating a config.xml file [message #1015351 is a reply to message #1012732] |
Thu, 28 February 2013 10:14   |
Eclipse User |
|
|
|
The selected wizard could not be started.
Plug-in "org.eclipse.sapphire.samples" was unable to execute setInitializationData on an instance of "org.eclipse.sapphire.workspace.ui.CreateWorkspaceFileWizard".
java.lang.IllegalArgumentException
Can you tell what might me the problem in this case?
I have cloned one of your sample code to my cases.
[Updated on: Thu, 28 February 2013 12:44] by Moderator Report message to a moderator
|
|
|
Re: Generating a config.xml file [message #1015448 is a reply to message #1015351] |
Thu, 28 February 2013 15:51   |
Eclipse User |
|
|
|
This exception can happen if the path to your sdef file is incorrect or there is something wrong in your sdef file such that it doesn't load correctly. Do you see any validation errors when you open your wizard's sdef file? Where is sdef located and how are you registering the wizard in plugin.xml?
- Konstantin
[Updated on: Thu, 28 February 2013 15:52] by Moderator Report message to a moderator
|
|
|
Re: Generating a config.xml file [message #1015533 is a reply to message #1015448] |
Fri, 01 March 2013 07:15   |
Eclipse User |
|
|
|

I checked the validity of the .sdef file as you suggested. I found that it is not able to resolve neither the class definition CreateWorkspaceFileWizard or the file CreateWorkspaceFileForm , the sdef file. Though i have the libraries in the plugin. Please find the attachment
Could not resolve definition path "org.eclipse.sapphire.workspace.ui.CreateWorkspaceFileForm".
And i have registered it in the plugin.xml file as this,
<extension point="org.eclipse.ui.newWizards">
<wizard
id="com.coutient.assetconfigfile.editor.CreateConfigFileWizard"
category="Asset/Configuration File Generation"
name="Asset Config File Generation"
icon="icons/config.png">
<description>Create a Configuration File.</description>
<class class="org.eclipse.sapphire.workspace.ui.CreateWorkspaceFileWizard">
<parameter name="sdef" value="com.coutient.assetconfigfile.editor.CreateConfigFileWizard"/>
<parameter name="editor" value="com.coutient.assetconfigfile.ConfigReportEditor"/>
</class>
</wizard>
</extension>
Attachment: sapphire.jpg
(Size: 71.80KB, Downloaded 2693 times)
|
|
|
|
|
Re: Generating a config.xml file [message #1016028 is a reply to message #1015820] |
Mon, 04 March 2013 16:12   |
Eclipse User |
|
|
|
At this point, you will need to carefully compare your project with the samples project to find what is causing it not to work.
1. Compare all of the project metadata (including the files that start with '.' and all of the contents of the '.settings' folder). For instance, did you enable annotation processing for your project.
2. If #1 all checks out, is your wizard sdef located at "com/coutient/assetconfigfile/editor/CreateConfigFileWizard.sdef"?
- Konstantin
|
|
|
|
|
|
Re: Generating a config.xml file [message #1064182 is a reply to message #1010854] |
Tue, 18 June 2013 06:56   |
Eclipse User |
|
|
|
Hey,
I have experienced the same even if I import the sample plugin as source project (0.6.2).
Could not resolve definition path "org.eclipse.sapphire.workspace.ui.CreateWorkspaceFileForm".
At runtime the wizard seems to work.
Thank you.
Kon
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06334 seconds