Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Generating a config.xml file(Generating a configuration file using Sapphire?)
Generating a config.xml file [message #1010854] Mon, 18 February 2013 10:46 Go to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
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 #1011130 is a reply to message #1010854] Mon, 18 February 2013 22:51 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
Sapphire should have no problem handling your scenario. Could you elaborate on what problems or difficulties you've encountered?

- Konstantin
Re: Generating a config.xml file [message #1011686 is a reply to message #1011130] Wed, 20 February 2013 03:41 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
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]

Report message to a moderator

Re: Generating a config.xml file [message #1012011 is a reply to message #1011686] Wed, 20 February 2013 17:32 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
I am still not sure how your scenario is different from the scenarios demonstrated in the samples. Could you elaborate on this aspect?

- Konstantin
Re: Generating a config.xml file [message #1012199 is a reply to message #1012011] Thu, 21 February 2013 04:25 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
Okay, May be i have difficulties in putting up what i wanted to ask. Can you please point me to the closest possible amongst your samples which resembles my case?
Re: Generating a config.xml file [message #1012631 is a reply to message #1012199] Thu, 21 February 2013 23:23 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
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 #1012732 is a reply to message #1012631] Fri, 22 February 2013 06:16 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
Thanks for your replies. Will look into them. Hope i will be able to solve it !

-Harsha
Re: Generating a config.xml file [message #1015351 is a reply to message #1012732] Thu, 28 February 2013 10:14 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
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]

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 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
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]

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 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
index.php/fa/13622/0/

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 511 times)
Re: Generating a config.xml file [message #1015712 is a reply to message #1015533] Fri, 01 March 2013 21:14 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
Do you have org.eclipse.sapphire.workspace.ui bundle specified as required bundle in your manifest?

- Konstantin
Re: Generating a config.xml file [message #1015820 is a reply to message #1015712] Sun, 03 March 2013 07:54 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
Yes i have it in my Manifest
Re: Generating a config.xml file [message #1016028 is a reply to message #1015820] Mon, 04 March 2013 16:12 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
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 #1016369 is a reply to message #1016028] Wed, 06 March 2013 09:24 Go to previous messageGo to next message
Harsha G is currently offline Harsha G
Messages: 11
Registered: February 2013
Junior Member
Couldn't find a solution to the problem. Making it work by stripping the samples
Re: Generating a config.xml file [message #1031285 is a reply to message #1016369] Mon, 01 April 2013 13:50 Go to previous messageGo to next message
Joshua Spaulding is currently offline Joshua Spaulding
Messages: 16
Registered: April 2013
Junior Member
How did you resolve this issue? I'm experiencing the same thing?

Could not resolve definition path "org.eclipse.sapphire.workspace.ui.CreateWorkspaceFileForm".
Re: Generating a config.xml file [message #1032149 is a reply to message #1031285] Tue, 02 April 2013 16:20 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
Do you see an issue at runtime or only in the sdef editor? Could you post the contents of MANIFEST.MF file from your plugin?

- Konstantin
Re: Generating a config.xml file [message #1064182 is a reply to message #1010854] Tue, 18 June 2013 06:56 Go to previous messageGo to next message
kon f is currently offline kon f
Messages: 112
Registered: March 2012
Senior Member
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
Re: Generating a config.xml file [message #1064314 is a reply to message #1064182] Tue, 18 June 2013 15:44 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
Could you open a bug report? Please detail which Sapphire plugins you have imported in your workspace as a project. Is it just the samples project?
Re: Generating a config.xml file [message #1064419 is a reply to message #1064314] Wed, 19 June 2013 07:55 Go to previous messageGo to next message
kon f is currently offline kon f
Messages: 112
Registered: March 2012
Senior Member
I just imported the sample project into my workspace. I used Ctrl+Shift+T to check if the type does exists somewhere in the my target but it doesn't.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=411086

Thank you!

Kon
Re: Generating a config.xml file [message #1064733 is a reply to message #1064419] Thu, 20 June 2013 17:05 Go to previous message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 941
Registered: July 2009
Senior Member
I fixed the reported issue in 0.7 release stream. Imported definitions are now correctly resolved by sdef editor.
Previous Topic:Ideas to reduce memory usage
Next Topic:Scale vertically does not work for text field
Goto Forum:
  


Current Time: Mon Oct 20 18:15:08 GMT 2014

Powered by FUDForum. Page generated in 0.05732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software