JBoss Tools SVN: r10773 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-10 09:52:12 -0400 (Fri, 10 Oct 2008)
New Revision: 10773
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-2345
https://jira.jboss.org/jira/browse/JBIDE-2344
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 13:52:12 UTC (rev 10773)
@@ -79,7 +79,7 @@
};
public GenerateInitWizardPage(JpaProject jpaProject){
- super("", "", null);
+ super("", Messages.title, null);
this.jpaProject = jpaProject;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2008-10-10 13:52:12 UTC (rev 10773)
@@ -19,9 +19,10 @@
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.ui.wizard.messages"; //$NON-NLS-1$
- public static String ccName;
- public static String connectionProfileError;
- public static String selectName;
+ public static String ccName;
+ public static String connectionProfileError;
+ public static String title;
+ public static String selectName;
public static String wizardMessage;
static {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2008-10-10 13:52:12 UTC (rev 10773)
@@ -1,4 +1,5 @@
ccName=Console Configuration name
connectionProfileError=Connection profile should be selected.
selectName=Create default Console Configuration
+title=Use existing console configuration or connection profile for database connection
wizardMessage=Enter console configuration name if you want to create new one for selected project.
17 years, 6 months
JBoss Tools SVN: r10771 - in workspace/grid: org.jboss.tools.jbpm.convert and 36 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-10 06:29:15 -0400 (Fri, 10 Oct 2008)
New Revision: 10771
Added:
workspace/grid/org.jboss.tools.jbpm.convert/
workspace/grid/org.jboss.tools.jbpm.convert/.classpath
workspace/grid/org.jboss.tools.jbpm.convert/.project
workspace/grid/org.jboss.tools.jbpm.convert/.settings/
workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
workspace/grid/org.jboss.tools.jbpm.convert/META-INF/
workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
workspace/grid/org.jboss.tools.jbpm.convert/bin/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
workspace/grid/org.jboss.tools.jbpm.convert/build.properties
workspace/grid/org.jboss.tools.jbpm.convert/icons/
workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
workspace/grid/org.jboss.tools.jbpm.convert/lib/
workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties
workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml
workspace/grid/org.jboss.tools.jbpm.convert/src/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
change plugin name
Added: workspace/grid/org.jboss.tools.jbpm.convert/.classpath
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.classpath (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.classpath 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="bin/" sourcepath="src/org/jboss/tools/jbpm/convert/b2j/messages"/>
+ <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/grid/org.jboss.tools.jbpm.convert/.project
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.project (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.project 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jbpm.convert</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,7 @@
+#Wed Jul 23 02:43:33 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %PLUGIN_NAME
+Bundle-SymbolicName: org.jboss.tools.jbpm.convert.bpmnto;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.common;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .,
+ lib/dom4j-1.6.1.jar,
+ bin/
+Bundle-Vendor: %PLUGIN_PROVIDER
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.model
+Export-Package: org.jboss.tools.jbpm.convert.bpmnto,
+ org.jboss.tools.jbpm.convert.bpmnto.translate,
+ org.jboss.tools.jbpm.convert.bpmnto.util,
+ org.jboss.tools.jbpm.convert.bpmnto.wizard
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/build.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/build.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/build.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ lib/dom4j-1.6.1.jar,\
+ bin/
Added: workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,5 @@
+wizard.name=BPMN -> JPDL
+wizard.description = Export a BPMN file to JPDL
+category.name=BPMN Export
+PLUGIN_NAME=BPMNExport
+PLUGIN_PROVIDER=Red Hat, Inc.
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.ui.exportWizards">
+ <category name="%category.name"
+ id="org.jboss.tools.jbpm.convert.export.category"/>
+ <wizard name="%wizard.name"
+ icon="icons/sample.gif"
+ category="org.jboss.tools.jbpm.convert.export.category"
+ class="org.jboss.tools.jbpm.convert.b2j.wizard.B2JExportWizard"
+ id="org.jboss.tools.jbpm.convert.export.b2jexportwizard">
+ <description>%wizard.description</description>
+ <selection name="*.bpmn" class="org.eclipse.core.resources.IFile"/>
+ </wizard>
+ </extension>
+
+</plugin>
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class B2JMessages {
+
+ private static final String BUNDLE_NAME = "org.jboss.tools.jbpm.convert.b2j.messages.B2J"; //$NON-NLS-1$
+
+ private B2JMessages() {
+ // Do not instantiate
+ }
+
+ public static String Loop_Decision;
+ public static String To;
+ public static String Folder_Name_Separator;
+ public static String Space;
+ public static String Underline;
+ public static String Width_Attribute_Name;
+ public static String Height_Attribute_Name;
+ public static String X_Attribute_Name;
+ public static String Y_Attribute_Name;
+ public static String Label_Select_All;
+ public static String Label_Deselect_All;
+ public static String Label_Button_Browse;
+ public static String Bpmn_Diagram_Name_Suffix;
+ public static String Bpmn_Pool_Element_Name;
+ public static String Bpmn_Element_ID;
+ public static String Bpmn_Vertice_Element_Name;
+ public static String Bpmn_SequenceFlow_Element_Name;
+ public static String Bpmn_Looping_Attribute_Name;
+ public static String Bpmn_InFlow_Attribute_Name;
+ public static String Bpmn_XmiType_Attribute_Name;
+ public static String Bpmn_Href_Attribute_Name;
+ public static String Bpmn_ActivityType_Attribute_Name;
+ public static String Bpmn_FlowSource_Attribute_Name;
+ public static String Bpmn_FlowTarget_Attribute_Name;
+ public static String Bpmn_FlowDefault_Attribute_Name;
+ public static String Bpmn_Wizard_Title;
+ public static String Bpmn_File_Choose_WizardPage_Name;
+ public static String Bpmn_File_Choose_WizardPage_Title;
+ public static String Bpmn_File_Choose_WizardPage_Message;
+ public static String Bpmn_File_Choose_WizardPage_ViewerTitle;
+ public static String Bpmn_Pool_Choose_WizardPage_Name;
+ public static String Bpmn_Pool_Choose_WizardPage_Message;
+ public static String Bpmn_Pool_Choose_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Name;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Message;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_CheckBox;
+ public static String Bpmn_Translate_Message_WizardPage_Name;
+ public static String Bpmn_Translate_Message_WizardPage_Title;
+ public static String Bpmn_Translate_Message_WizardPage_Message;
+ public static String Bpmn_Translate_Message_WizardpageViewer_Title;
+ public static String Bpmn_EAnnotations_Element_Name;
+ public static String Bpmn_Details_Element_Name;
+ public static String Bpmn_Value_Attribute_Name;
+ public static String Jpdl_Element_Decision_Suffix;
+ public static String Jpdl_Element_Complete_Suffix;
+ public static String Jpdl_Element_Cancel_Suffix;
+ public static String Jpdl_Element_Successful_Name;
+ public static String Jpdl_Suffix;
+ public static String Jpdl_Process_Definition_Name;
+ public static String Jpdl_ProcessState_Element_Name;
+ public static String Jpdl_SubProcess_Element_Name;
+ public static String Jpdl_32_Namespace_Url;
+ public static String Jpdl_Process_Definition_Element_Name;
+ public static String Jpdl_Transition_Element;
+ public static String Jpdl_Decision_Element_Name;
+ public static String Jpdl_Fork_Element_Name;
+ public static String Jpdl_Join_Element_Name;
+ public static String Jpdl_Start_Element_Name;
+ public static String Jpdl_State_Element_Name;
+ public static String Jpdl_End_Element_Name;
+ public static String Jpdl_Node_Element_Name;
+ public static String Gpd_Definition_Name;
+ public static String Gpd_Layout_Element_Name;
+ public static String Gpd_Element_Name;
+ public static String Gpd_Process_Diagram_Name;
+ public static String Gpd_Label_Element_Name;
+ public static String Dom_Element_Name;
+ public static String Dom_Element_ID;
+ public static String Translate_Error_JpdlProcess_Definition_Null;
+ public static String Translate_Error_JpdlFile_CanNotWrite;
+ public static String Translate_Error_JpdlFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotWrite;
+ public static String Translate_Error_File_CanNotRead;
+ public static String Translate_Warning_Bpmn_Element_Name;
+ public static String Translate_Warning_Bpmn_Element_Type;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, B2JMessages.class);
+ }
+}
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,466 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn ->jpdl
+ */
+public class BPMN2JPDL extends BPMNTranslator {
+
+ Document bpmnDocument;
+ List<Document> processDefs = new ArrayList<Document>();
+
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public Map<String, Element> getMap() {
+ return map;
+ }
+
+ public void setMap(Map<String, Element> map) {
+ this.map = map;
+ }
+
+ public BPMN2JPDL() {
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ Document bpmnDocument) {
+ this(bpmnFileName, bpmnFilePath, null, bpmnDocument);
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList, Document bpmnDocument) {
+ super(bpmnFileName, bpmnFilePath, poolIDList);
+ this.bpmnDocument = bpmnDocument;
+ }
+
+ /*
+ * Translate a bpmn diagram to string[]. Every string is jpdl process
+ * definition
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[processDefs.size()];
+ int i = 0;
+ for (Document def : processDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_JpdlFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+
+ return strForProcessDefs;
+ }
+
+ /*
+ * Translate a bpmn diagram to file[]. Every file is a jpdl file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForProcessDefs = translateToStrings();
+ String[] jpdlFileNames = new String[processDefs.size()];
+
+ int i = 0;
+ for (Document def : processDefs) {
+ jpdlFileNames[i] = def.getName();
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForProcessDefs, jpdlFileNames,
+ B2JMessages.Jpdl_Process_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_JpdlFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn diagram Domument tree to some jpdl process Dom trees
+ */
+ public void translateDiagram() {
+
+ // set the namemap = null
+ TranslateHelper.setNameMap(new HashMap<String, Integer>());
+
+ Element diagram = bpmnDocument.getRootElement();
+ if (this.poolIDList == null || this.poolIDList.size() == 0) {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ translateGraph((Element) pool);
+ }
+ } else {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (this.poolIDList.contains(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID))) {
+ translateGraph((Element) pool);
+ }
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn pool or subprocess to a jpdl process Dom tree
+ */
+ private Element translateGraph(Element graph) {
+ Document processDef = TranslateHelper.createJpdlDomTree(true);
+ Element processRoot = processDef.getRootElement();
+
+ DomXmlWriter.addAttribute(processRoot, B2JMessages.Dom_Element_Name,
+ TranslateHelper.generateProcessName(graph));
+ processDef.setName(processRoot
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ map.put(graph.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Pool_Element_Name, processRoot);
+
+ for (Object activity : graph.elements()) {
+ if (B2JMessages.Bpmn_Vertice_Element_Name
+ .equals(((Element) activity).getName())) {
+ translateActivity(((Element) activity), processRoot);
+ }
+ }
+ translateSequenceFlows(graph, processRoot);
+ processDefs.add(processDef);
+
+ return processRoot;
+ }
+
+ /*
+ * Translate a bpmn activity to a jpdl node according to activity type
+ */
+ private void translateActivity(Element activity, Element processRoot) {
+ String type = activity
+ .attributeValue(B2JMessages.Bpmn_XmiType_Attribute_Name);
+ Element element = null;
+
+ // According to bpmn activity type, map to different jpdl node
+ // Some type can not be supported by this translation, we give
+ // a warining message for it.
+ if ("bpmn:Activity".equals(type)) {
+ String activityType = activity
+ .attributeValue(B2JMessages.Bpmn_ActivityType_Attribute_Name);
+ if (activityType == null || "Task".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ } else if ("EventStartEmpty".equals(activityType)
+ || "EventStartMessage".equals(activityType)
+ || "EventStartRule".equals(activityType)
+ || "EventStartTimer".equals(activityType)
+ || "EventStartLink".equals(activityType)
+ || "EventStartMultiple".equals(activityType)
+ || "EventStartSignal".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Start_Element_Name);
+ if (!"EventStartEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventIntermediateEmpty".equals(activityType)
+ || "EventIntermediateMessage".equals(activityType)
+ || "EventIntermediateTimer".equals(activityType)
+ || "EventIntermediateError".equals(activityType)
+ || "EventIntermediateCompensation".equals(activityType)
+ || "EventIntermediateRule".equals(activityType)
+ || "EventIntermediateMultiple".equals(activityType)
+ || "EventIntermediateCancel".equals(activityType)
+ || "EventIntermediateLink".equals(activityType)
+ || "EventIntermediateSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_State_Element_Name);
+ if (!"EventIntermediateEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventEndEmpty".equals(activityType)
+ || "EventEndMessage".equals(activityType)
+ || "EventEndError".equals(activityType)
+ || "EventEndCompensation".equals(activityType)
+ || "EventEndTerminate".equals(activityType)
+ || "EventEndLink".equals(activityType)
+ || "EventEndMultiple".equals(activityType)
+ || "EventEndCancel".equals(activityType)
+ || "EventEndSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_End_Element_Name);
+ if (!"EventEndEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayDataBasedExclusive".equals(activityType)
+ || "GatewayEventBasedExclusive".equals(activityType)
+ || "GatewayComplex".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+ if (!"GatewayDataBasedExclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayParallel".equals(activityType)
+ || "GatewayDataBasedInclusive".equals(activityType)) {
+ if (activity
+ .attributeValue(B2JMessages.Bpmn_InFlow_Attribute_Name) == null
+ || activity.attributeValue(
+ B2JMessages.Bpmn_InFlow_Attribute_Name).split(
+ B2JMessages.Space).length == 1) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Fork_Element_Name);
+ } else {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Join_Element_Name);
+ }
+ if (!"GatewayDataBasedInclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ }
+ } else if ("bpmn:SubProcess".equals(type)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_ProcessState_Element_Name);
+ translateSubprocess(activity, element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(activity, element)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + activity.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), element);
+
+ // If bpmn activity is loop type, then create a structure to mock it.
+ if ("true".equals(activity
+ .attributeValue(B2JMessages.Bpmn_Looping_Attribute_Name))) {
+ createMockLoop(activity, element);
+ }
+ }
+
+ /*
+ * Translate a bpmn subprocess to a jpdl processstate and a new jpdl process
+ * difinition
+ */
+ private void translateSubprocess(Element subProcess, Element element) {
+ Element processRoot = translateGraph(subProcess);
+ Element ele = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_SubProcess_Element_Name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name,
+ processRoot);
+
+ // translate the transaction of subprocess
+ Element eAnnot = subProcess
+ .element(B2JMessages.Bpmn_EAnnotations_Element_Name);
+ if (eAnnot != null) {
+ Element details = eAnnot
+ .element(B2JMessages.Bpmn_Details_Element_Name);
+ if (details != null
+ && "true"
+ .equals(details
+ .attributeValue(B2JMessages.Bpmn_Value_Attribute_Name))) {
+ translateTransaction(processRoot);
+ }
+ }
+ }
+
+ /*
+ * translate a transaction of sub process
+ */
+ private void translateTransaction(Element processRoot) {
+ List<Element> lastEleList = TranslateHelper.locateLastElements(processRoot);
+
+ if (lastEleList.size() == 0) {
+ return;
+ }
+ // create a decision
+ Element decision = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Successful_Name);
+ // get bpmn id from map
+ String bpmnId = null;
+ for (String key : map.keySet()) {
+ if (map.get(key) == lastEleList.get(0)) {
+ bpmnId = key;
+ break;
+ }
+ }
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Decision_Suffix, decision);
+
+ // create a transition from element to decision
+ for (Element ele : lastEleList) {
+ Element transition = DomXmlWriter.addElement(ele,
+ B2JMessages.Jpdl_Transition_Element);
+ transition.addAttribute(B2JMessages.Dom_Element_Name, ele
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.To + B2JMessages.Jpdl_Decision_Element_Name);
+ transition.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ // create a complete element
+ Element complete = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(complete, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Complete_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Complete_Suffix, complete);
+
+ // create a cancel element
+ Element cancel = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(cancel, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Cancel_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Cancel_Suffix, cancel);
+
+ // create transition from decision to complete element
+ Element toComplete = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toComplete.addAttribute(B2JMessages.Dom_Element_Name, "true");
+ toComplete.addAttribute(B2JMessages.To, complete
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create transition from decision to cancel element
+ Element toCancel = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toCancel.addAttribute(B2JMessages.Dom_Element_Name, "false");
+ toCancel.addAttribute(B2JMessages.To, cancel
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+
+ /*
+ * Translate bpmn sequenceflows to jpdl transitions
+ */
+ private void translateSequenceFlows(Element graph, Element processRoot) {
+ for (Object edge : graph
+ .elements(B2JMessages.Bpmn_SequenceFlow_Element_Name)) {
+ translateSequenceFlow((Element) edge, processRoot);
+ }
+ }
+
+ /*
+ * Translate a bpmn sequenceflow to a jpdl transition
+ */
+ private void translateSequenceFlow(Element edge, Element processRoot) {
+
+ Element source = map.get(edge
+ .attributeValue(B2JMessages.Bpmn_FlowSource_Attribute_Name));
+
+ Element transition = null;
+ if ("true".equals(edge
+ .attributeValue(B2JMessages.Bpmn_FlowDefault_Attribute_Name))
+ && source.element(B2JMessages.Jpdl_Transition_Element) != null) {
+ // move default transition to the first of transition list
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element, 0);
+ } else {
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(edge, transition)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + edge.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ transition
+ .addAttribute(
+ B2JMessages.To,
+ map
+ .get(
+ edge
+ .attributeValue(B2JMessages.Bpmn_FlowTarget_Attribute_Name))
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ /*
+ * create a jpdl decision structure to map bpmn loop activity
+ */
+ private void createMockLoop(Element activity, Element element) {
+
+ // create a decision
+ Element decision = DomXmlWriter.addElement(element.getParent(),
+ B2JMessages.Jpdl_Decision_Element_Name);
+ String name = activity.attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.Underline + B2JMessages.Loop_Decision;
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name, name);
+
+ // use the decision to replace the activity in the map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), decision);
+ // add the activity to map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Vertice_Element_Name, element);
+
+ // create a transition from element to decision
+ Element first = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_Transition_Element);
+ first.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline + name);
+ first.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create a transition from decision to element
+ Element second = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ second.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline
+ + element.attributeValue(B2JMessages.Dom_Element_Name));
+ second.addAttribute(B2JMessages.To, element
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ }
+
+ public List<Document> getProcessDefs() {
+ return processDefs;
+ }
+
+ public void setProcessDefs(List<Document> processDefs) {
+ this.processDefs = processDefs;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn_diagram to gpd of jpdl
+ */
+public class GraphicalFileGenerator extends BPMNTranslator {
+
+ Document document;
+
+ // gpd.xml documents list
+ List<Document> gpdDefs = new ArrayList<Document>();
+
+ // the pool of gpd.xml name
+ List<String> gpdPoolNames = new ArrayList<String>();
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public GraphicalFileGenerator(Document bpmnDiagramDocument,
+ Map<String, Element> map, String rootLocation, String bpmnFileName) {
+ this.rootLocation = rootLocation;
+ this.bpmnFileName = bpmnFileName;
+ this.document = bpmnDiagramDocument;
+ this.map = map;
+ }
+
+ /*
+ * translate a bpmn_diagram document to a gpd document string
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_GpdFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+ return strForProcessDefs;
+ }
+
+ /*
+ * translate every gpd document string to a gpd file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForGpdDefs = translateToStrings();
+ String[] gpdFileNames = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ gpdFileNames[i] = def.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name);
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForGpdDefs, gpdFileNames,
+ B2JMessages.Gpd_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_GpdFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * translate the graphical bpmn_diagram document
+ */
+ public void translateDiagram() {
+ Element rootElement = document.getRootElement();
+ List<Element> eleList = DomXmlWriter.getElementsByName(rootElement,
+ B2JMessages.Gpd_Element_Name);
+
+ for (String bpmnID : map.keySet()) {
+ if (bpmnID != null) {
+ // when translate bpmn loop activity, we create a mock
+ // structure and when translate bpmn transaction, we create a
+ // mock structure too. For these reason, we need to give a (x,y)
+ // increment to avoid two element overlap
+ int xIncre = 0;
+ int yIncre = 0;
+ Element bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ bpmnID, eleList);
+ if (bpmnGpdEle == null) {
+ if (bpmnID.endsWith(B2JMessages.Bpmn_Vertice_Element_Name)) {
+ bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ TranslateHelper.getPureBpmnID(bpmnID,
+ B2JMessages.Bpmn_Vertice_Element_Name),
+ eleList);
+ xIncre = 150;
+ yIncre = 50;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Decision_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Decision_Suffix),
+ eleList);
+ xIncre = 150;
+ yIncre = 100;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Complete_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Complete_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 0;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Cancel_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Cancel_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 200;
+ }
+ }
+ if (bpmnGpdEle == null) {
+ continue;
+ }
+ translateGraphicalElement(TranslateHelper.getXY(bpmnGpdEle,
+ xIncre, yIncre), map.get(bpmnID), eleList);
+ }
+ }
+
+ }
+
+ private void translateGraphicalElement(String[] xy, Element jpdlEle,
+ List<Element> eleList) {
+ if (jpdlEle == null) {
+ return;
+ }
+
+ // if not translate, then translate the pool of the element
+ if (!gpdPoolNames.contains(jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))
+ && B2JMessages.Jpdl_Process_Definition_Element_Name
+ .equals(jpdlEle.getParent().getName())) {
+ translatePool(eleList, jpdlEle);
+ }
+
+ // translate the bpmn graphical element
+ Element poolEle = null;
+ for (Document doc : gpdDefs) {
+ if (doc.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name).equals(
+ jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))) {
+ poolEle = doc.getRootElement();
+ }
+ }
+ Element pgdEle = TranslateHelper.createNode(poolEle,
+ B2JMessages.Jpdl_Node_Element_Name, jpdlEle);
+
+ TranslateHelper.mapXY(pgdEle, xy[0], xy[1]);
+
+ // translate the sequence flow of the element
+ for (Object ele : jpdlEle.elements(B2JMessages.Jpdl_Transition_Element)) {
+ TranslateHelper.createTransition(pgdEle,
+ B2JMessages.Jpdl_Transition_Element, (Element) ele);
+ }
+ }
+
+ private void translatePool(List<Element> eleList, Element jpdlEle) {
+ // get the bpmn pool id
+ String poolBpmnID = null;
+ for (String id : map.keySet()) {
+ if (map.get(id) == jpdlEle.getParent()) {
+ poolBpmnID = TranslateHelper.getPureBpmnID(id,
+ B2JMessages.Bpmn_Pool_Element_Name);
+ break;
+ }
+ }
+ // get the bpmn pool graphical element
+ if (poolBpmnID != null) {
+ Element poolBpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ poolBpmnID, eleList);
+ Document processDiagramDef = DomXmlWriter.createDomTree(false,
+ null, B2JMessages.Gpd_Process_Diagram_Name);
+ Element poolEle = processDiagramDef.getRootElement();
+ DomXmlWriter.mapAttribute(poolEle, B2JMessages.Dom_Element_Name,
+ jpdlEle.getParent());
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Width_Attribute_Name, poolBpmnGpdEle);
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Height_Attribute_Name, poolBpmnGpdEle);
+
+ gpdDefs.add(processDiagramDef);
+ gpdPoolNames.add(poolEle
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a helper class for bpmn ->jpdl
+ */
+public class TranslateHelper {
+
+ // the map for the bpmn element id : the corresponding generated element
+ static Map<String, Integer> nameMap = new HashMap<String, Integer>();
+
+ public static void setNameMap(Map<String, Integer> nameMap) {
+ TranslateHelper.nameMap = nameMap;
+ }
+
+ /*
+ * get the bpmn_diagram file name
+ */
+ public static String getBpmnDiagramName(String bpmnFileName) {
+ return bpmnFileName + B2JMessages.Bpmn_Diagram_Name_Suffix;
+ }
+
+ /*
+ * create a jpdl dom tree
+ */
+ public static Document createJpdlDomTree(boolean useNamespace) {
+ return DomXmlWriter.createDomTree(useNamespace,
+ B2JMessages.Jpdl_32_Namespace_Url,
+ B2JMessages.Jpdl_Process_Definition_Element_Name);
+
+ }
+
+ /*
+ * create translated files from dom strings
+ */
+ public static File[] createFiles(String parentFolder, String bpmnFileName,
+ String[] strsForGenerate, String[] fileFolders, String fileName,
+ boolean isOverWrite) throws IOException {
+ File jpdlFolder = BPMNToUtil.createFile(parentFolder,
+ B2JMessages.Jpdl_Suffix, null, isOverWrite);
+ File diagramFolder = BPMNToUtil.createFile(
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
+
+ File[] files = new File[strsForGenerate.length];
+ File processFolder = null;
+ int i = 0;
+ for (String str : strsForGenerate) {
+ processFolder = BPMNToUtil.createFile(diagramFolder
+ .getAbsolutePath(), fileFolders[i], null, isOverWrite);
+ files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
+ fileName, str, isOverWrite);
+ i++;
+ }
+ return files;
+ }
+
+ /*
+ * generate a process definition name. the name is composed of the names
+ * from bpmn diagram to the element
+ */
+ public static String generateProcessName(Element graph) {
+ if ("BpmnDiagram".equals(graph.getName())) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ String str = generateProcessName(graph.getParent());
+ if (str == null) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ return str + B2JMessages.Folder_Name_Separator
+ + graph.attributeValue(B2JMessages.Dom_Element_Name);
+ }
+ }
+
+ }
+
+ /*
+ * check the bpmn element name is null or "" or same to another element name
+ * and generate a different name
+ */
+ public static boolean check_mapElementName(Element graph, Element graphEle) {
+
+ boolean isOk = true;
+ String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+
+ if (name == null || "".equals(name)) {
+ name = "jboss_autogen";
+ isOk = false;
+ }
+ Integer i = nameMap.get(name);
+ if (i == null) {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name);
+ nameMap.put(name, new Integer("1"));
+ } else {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name + "_" + i);
+ nameMap.put(name, ++i);
+ isOk = false;
+ }
+
+ return isOk;
+
+ }
+
+ /*
+ * select the elements from process. These elements have no transitions sub
+ * element or have transtions to end-state.
+ */
+ public static List<Element> locateLastElements(Element processRoot) {
+ List<Element> list = new ArrayList<Element>();
+
+ if (processRoot.element(B2JMessages.Jpdl_End_Element_Name) != null) {
+ Element endState = processRoot
+ .element(B2JMessages.Jpdl_End_Element_Name);
+ for (Object ele : processRoot.elements()) {
+ Element subEle = ((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element);
+ if (subEle != null
+ && endState
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ .equals(subEle.attributeValue(B2JMessages.To))) {
+ list.add((Element) ele);
+ }
+ }
+ } else {
+ for (Object ele : processRoot.elements()) {
+ if (((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element) == null) {
+ list.add((Element) ele);
+ }
+ }
+ }
+
+ return list;
+ }
+
+ /*
+ * get the layout element from bpmn_diagram file by id
+ */
+ public static Element getDiagramLayoutElement(String bpmnID,
+ List<Element> eleList) {
+ Element element = null;
+ for (Element ele : eleList) {
+ String str = ele
+ .attributeValue(B2JMessages.Bpmn_Href_Attribute_Name);
+ if (str != null && str.contains(bpmnID)) {
+ element = ele;
+ break;
+ }
+ }
+
+ if (element != null
+ && element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name) != null) {
+ return element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name);
+ }
+
+ return null;
+ }
+
+ /*
+ * create a graphical jpdl transition
+ */
+ public static Element createTransition(Element parentEle, String name,
+ Element jpdlEle) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+
+ Element label = DomXmlWriter.addElement(ele,
+ B2JMessages.Gpd_Label_Element_Name);
+ TranslateHelper.mapXY(label, "5", "-10");
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl element
+ */
+ private static Element createElement(Element parentEle, String name,
+ String width, String height) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Width_Attribute_Name, width);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Height_Attribute_Name,
+ height);
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl node
+ */
+ public static Element createNode(Element rootEle, String name,
+ Element jpdlEle) {
+ Element ele = TranslateHelper.createElement(rootEle, name, "100", "40");
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+ return ele;
+ }
+
+ /*
+ * map bpmn x,y attribute to jpdl graphical element
+ */
+ public static void mapXY(Element pgdEle, String x, String y) {
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.X_Attribute_Name,
+ x == null ? "0" : x);
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.Y_Attribute_Name,
+ y == null ? "0" : y);
+
+ }
+
+ /*
+ * get a bpmn element id from a given string by subtract suffix for example
+ * bpmn pool has pools suffix a bpmn loop activity has vertices suffix
+ */
+ public static String getPureBpmnID(String bpmnID, String suffix) {
+ return bpmnID.substring(0, bpmnID.length() - suffix.length());
+ }
+
+ /*
+ * get (x,y) from a graphical element and add increments
+ */
+ public static String[] getXY(Element bpmnGpdEle, int xIncre, int yIncre) {
+ String xy[] = new String[2];
+ xy[0] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.X_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.X_Attribute_Name))
+ + xIncre);
+ xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.Y_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.Y_Attribute_Name))
+ + yIncre);
+ return xy;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.b2j.translate.BPMN2JPDL;
+import org.jboss.tools.jbpm.convert.b2j.translate.GraphicalFileGenerator;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn to jpdl translation
+ */
+public class B2JExportWizard extends BpmnToWizard {
+
+ private List<String> strForProcessList = new ArrayList<String>();
+ private List<String> strForGpdList = new ArrayList<String>();
+ private List<String> generatedFoldersList = new ArrayList<String>();
+
+ public void createGeneratedFile(boolean isOverWrite) {
+ String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
+
+ int i = 0;
+ for (String name : this.generatedFoldersList) {
+ jpdlFolderNames[i] = name;
+ i++;
+ }
+
+ String location = super.getContainerPath((IContainer) super
+ .getTargetLocationSelection().getFirstElement());
+
+ if (this.strForProcessList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForProcessList.size()];
+ for (String pro : this.strForProcessList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames,
+ B2JMessages.Jpdl_Process_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ if (this.strForGpdList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForGpdList.size()];
+ for (String pro : this.strForGpdList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ }
+
+ public List<String> translateBpmnToStrings() {
+ List<String> warningList = new ArrayList<String>();
+ List<String> errorList = new ArrayList<String>();
+
+ Document bpmnDocument = null;
+ try {
+ bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ }
+
+ BPMN2JPDL translator = new BPMN2JPDL(bpmnFileName, bpmnFileParentPath,
+ poolIdList, bpmnDocument);
+
+ this.setStrForProcessList(Arrays
+ .asList(translator.translateToStrings()));
+
+ for (Document def : translator.getProcessDefs()) {
+ this.generatedFoldersList.add(def.getName());
+ }
+
+ warningList.addAll(translator.getWarnings());
+ errorList.addAll(translator.getErrors());
+
+ // generate jpdl gpd file from *.bpmn_diagram
+ Document bpmnDiagramDocument = null;
+ try {
+ bpmnDiagramDocument = getDocument(bpmnFileParentPath,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName));
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName)));
+ }
+ GraphicalFileGenerator generator = new GraphicalFileGenerator(
+ bpmnDiagramDocument, translator.getMap(), bpmnFileParentPath,
+ bpmnFileName);
+
+ this.setStrForGpdList(Arrays.asList(generator.translateToStrings()));
+
+ warningList.addAll(generator.getWarnings());
+ errorList.addAll(generator.getErrors());
+
+ List<String> list = new ArrayList<String>();
+ list.addAll(errorList);
+ list.addAll(warningList);
+
+ return list;
+ }
+
+ public List<String> getStrForProcessList() {
+ return strForProcessList;
+ }
+
+ public void setStrForProcessList(List<String> strForProcessList) {
+ this.strForProcessList = strForProcessList;
+ }
+
+ public List<String> getStrForGpdList() {
+ return strForGpdList;
+ }
+
+ public void setStrForGpdList(List<String> strForGpdList) {
+ this.strForGpdList = strForGpdList;
+ }
+
+ public List<String> getGeneratedFoldersList() {
+ return generatedFoldersList;
+ }
+
+ public void setGeneratedFoldersList(List<String> generatedFoldersList) {
+ this.generatedFoldersList = generatedFoldersList;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto;
+
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Grid Qian
+ *
+ * this a plugin class
+ */
+public class BpmnToPlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jbpm.convert.bpmnto";
+
+ // The shared instance
+ private static BpmnToPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public BpmnToPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static BpmnToPlugin getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.translate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a root translator. You should extend it and realize the
+ * method: translateDiagram.
+ */
+public abstract class BPMNTranslator {
+
+ // the bpmn file name
+ public String bpmnFileName;
+
+ //the location of the folder containing the bpmn file
+ public String rootLocation;
+
+ // the bpmn pool's id list that are translated
+ public List<String> poolIDList;
+
+
+ // the warning messages when translate
+ public List<String> warnings = new ArrayList<String>();
+
+ // the error messages when translate
+ public List<String> errors = new ArrayList<String>();
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<String> errors) {
+ this.errors = errors;
+ }
+
+ public List<String> getWarnings() {
+ return warnings;
+ }
+
+ public void setWarnings(List<String> warnings) {
+ this.warnings = warnings;
+ }
+
+ public BPMNTranslator() {
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath) {
+ this(bpmnFileName, bpmnFilePath, null);
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList) {
+ this.bpmnFileName = bpmnFileName;
+ this.rootLocation = bpmnFilePath;
+ this.poolIDList = poolIDList;
+ }
+
+ /*
+ * Translate a bpmn diagram to anything
+ */
+ public abstract void translateDiagram();
+}
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+
+/**
+ * @author Grid Qian
+ *
+ * this a util class
+ */
+public class BPMNToUtil {
+
+ /*
+ * create a file
+ */
+ public static File createFile(String parentFolder, String fileName,
+ String inputStr, boolean isOverWrite) throws IOException {
+ File child = new File(parentFolder, fileName);
+ if (inputStr == null) {
+ if (!child.exists() || isOverWrite) {
+ child.mkdir();
+ }
+ } else {
+ if (!child.exists() || isOverWrite) {
+ child.createNewFile();
+ }
+ FileWriter childWriter = new FileWriter(child);
+ PrintWriter printFile = new PrintWriter(childWriter);
+ printFile.println(inputStr);
+ printFile.close();
+ childWriter.close();
+
+ }
+ return child;
+ }
+
+ /*
+ * get a sax input source
+ */
+ public static InputSource getInputSource(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ return new InputSource(BPMNToUtil
+ .getInputStream(parentFolder, fileName));
+
+ }
+
+ /*
+ * get a input stream
+ */
+ public static InputStream getInputStream(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ File file = new File(parentFolder, fileName);
+ InputStream input = new FileInputStream(file);
+ return input;
+
+ }
+
+ /*
+ * parse a file to a dom document
+ */
+ public static Document parse(String parentFolder, String fileName)
+ throws Exception {
+ Document document = null;
+ SAXReader saxReader = createSaxReader();
+ document = saxReader.read(BPMNToUtil.getInputSource(parentFolder,
+ fileName));
+ return document;
+ }
+
+ /*
+ * create a sax reader
+ */
+ public static SAXReader createSaxReader() throws Exception {
+ XMLReader xmlReader = createXmlReader();
+ SAXReader saxReader = new SAXReader(xmlReader);
+ return saxReader;
+ }
+
+ /*
+ * create a sax xml reader
+ */
+ public static XMLReader createXmlReader() throws Exception {
+
+ SAXParser saxParser = createSaxParserFactory().newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ saxParser.setProperty(
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+ "http://www.w3.org/2001/XMLSchema");
+
+ xmlReader.setFeature(
+ "http://apache.org/xml/features/validation/dynamic", true);
+
+ return xmlReader;
+ }
+
+ /*
+ * create a sax parser factory
+ */
+ private static SAXParserFactory createSaxParserFactory() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
+ return saxParserFactory;
+ }
+
+ /*
+ * get bpmn pool id list from a dom document
+ */
+ public static Map<String, String> getPoolIDsFromDocument(Document document) {
+ Map<String, String> poolIDMap = new HashMap<String, String>();
+ Element diagram = document.getRootElement();
+ for (Object pool : diagram.elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (((Element) pool).attributeValue(B2JMessages.Bpmn_Element_ID) != null) {
+ poolIDMap.put(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID),
+ ((Element) pool)
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+ }
+ return poolIDMap;
+ }
+
+ public static Composite createComposite(Composite parent, int numColumns) {
+ Composite composite = new Composite(parent, SWT.NULL);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return composite;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static boolean checkSelectedResources(ISelection selectedResources) {
+ boolean res = true;
+ if (selectedResources instanceof IStructuredSelection
+ && !selectedResources.isEmpty()) {
+ IStructuredSelection ss = (IStructuredSelection) selectedResources;
+ for (Iterator it = ss.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof IFile) {
+ if (!((IFile) o).getFileExtension()
+ .equalsIgnoreCase("bpmn")) {
+ res = false;
+ break;
+ }
+ } else {
+ res = false;
+ break;
+ }
+ }
+ } else {
+ res = false;
+ }
+ return res;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dom4j.*;
+import org.dom4j.io.*;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is for generating dom element or attribute
+ */
+public class DomXmlWriter {
+
+ /*
+ * map a dom document to a string
+ */
+ public static String toString(Document document) throws IOException {
+ OutputFormat outputFormat = new OutputFormat(" ", true);
+ Writer writer = new StringWriter();
+ XMLWriter xmlWriter = new XMLWriter(writer, outputFormat);
+ xmlWriter.write(document);
+ xmlWriter.flush();
+ writer.flush();
+ return writer.toString();
+ }
+
+ /*
+ * create a dom tree
+ */
+ public static Document createDomTree(boolean useNamespace, String url,
+ String rootElementName) {
+ Document document = DocumentHelper.createDocument();
+ Element root = null;
+
+ if (useNamespace) {
+ Namespace jbpmNamespace = new Namespace(null, url);
+ root = document.addElement(rootElementName, jbpmNamespace.getURI());
+ } else {
+ root = document.addElement(rootElementName);
+ }
+ root.addText(System.getProperty("line.separator"));
+
+ return document;
+ }
+
+ /*
+ * add a new element to a dom element
+ */
+ public static Element addElement(Element element, String elementName) {
+ Element newElement = element.addElement(elementName);
+ return newElement;
+ }
+
+ /*
+ * add a new element to the location of a dom element
+ */
+ @SuppressWarnings("unchecked")
+ public static Element addElement(Element element, String elementName,
+ int location) {
+ Element newElement = null;
+ if (element.elements(elementName) != null
+ && element.elements(elementName).size() > location
+ && location >= 0) {
+ newElement = DocumentHelper.createElement(elementName);
+ element.elements(elementName).add(location, newElement);
+ }
+ return newElement;
+ }
+
+ /*
+ * add a attribute to a dom element
+ */
+ public static void addAttribute(Element e, String attributeName,
+ String value) {
+ if (value != null) {
+ e.addAttribute(attributeName, value);
+ }
+ }
+
+ /*
+ * get a named element from a element (any depth)
+ */
+ public static List<Element> getElementsByName(Element element, String name) {
+ List<Element> list = new ArrayList<Element>();
+ for (Object ele : element.elements()) {
+ if (name.equals(((Element) ele).getName())) {
+ list.add((Element) ele);
+ }
+ list.addAll(getElementsByName((Element) ele, name));
+ }
+ return list;
+ }
+
+ /*
+ * set a element attribute using a same name attribute of other element
+ */
+ public static void mapAttribute(Element ele, String attrName, Element sourceEle){
+ DomXmlWriter.addAttribute(ele, attrName,sourceEle.attributeValue(attrName));
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProjectFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn file
+ */
+public class BPMNResourcesChoicePage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private IWizard wizard;
+
+ public BPMNResourcesChoicePage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setTitle(title);
+ this.setDescription(description);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ super.setControl(composite);
+
+ initializePage();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(B2JMessages.Bpmn_File_Choose_WizardPage_ViewerTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProjectFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ viewer.setSelection(currentSelection, true);
+ }
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (viewer != null) {
+ return BPMNToUtil.checkSelectedResources(viewer.getSelection());
+ }
+ return super.isPageComplete();
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void setSelection(ISelection selection) {
+ this.currentSelection = selection;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+}
+
+class ProjectFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ boolean res = false;
+ if (element instanceof IFile) {
+ IFile file = (IFile) element;
+ if (file.getFileExtension().equalsIgnoreCase("bpmn")) {
+ res = true;
+ }
+ }
+ if (element instanceof IContainer) {
+ res = true;
+ }
+ return res;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn pool from a bpmn diagram
+ */
+public class BpmnPoolsChoicePage extends WizardPage {
+
+ CheckboxTableViewer listViewer;
+ String listTitle;
+ private Map<String, String> idMap;
+
+ private IWizard wizard;
+
+ public BpmnPoolsChoicePage(String pageName, String title, String listTitle) {
+ super(pageName);
+ this.listTitle = listTitle;
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ addSelectionButtons(composite);
+ setControl(composite);
+
+ initializePage();
+ initializeViewer();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(listTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ listViewer.addCheckStateListener(new ICheckStateListener() {
+ @SuppressWarnings("unchecked")
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked()) {
+ (((BpmnToWizard) wizard)).getPoolIdList().add(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ } else {
+ (((BpmnToWizard) wizard)).getPoolIdList().remove(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ }
+ changeComplete();
+ }
+ });
+ }
+
+ private void addSelectionButtons(Composite composite) {
+ Composite buttonComposite = new Composite(composite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = 4;
+ buttonComposite.setLayout(layout);
+ buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true,
+ false));
+
+ Button selectButton = createButton(buttonComposite,
+ B2JMessages.Label_Select_All, false);
+
+ SelectionListener listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(true);
+ (((BpmnToWizard) wizard)).getPoolIdList()
+ .addAll(idMap.keySet());
+ changeComplete();
+ }
+ };
+ selectButton.addSelectionListener(listener);
+
+ Button deselectButton = createButton(buttonComposite,
+ B2JMessages.Label_Deselect_All, false);
+
+ listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(false);
+ (((BpmnToWizard) wizard)).getPoolIdList().clear();
+ changeComplete();
+ }
+ };
+ deselectButton.addSelectionListener(listener);
+ }
+
+ private Button createButton(Composite parent, String label,
+ boolean defaultButton) {
+ // increment the number of columns in the button bar
+ ((GridLayout) parent.getLayout()).numColumns++;
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(label);
+ if (defaultButton) {
+ Shell shell = parent.getShell();
+ if (shell != null) {
+ shell.setDefaultButton(button);
+ }
+ }
+ setButtonLayoutData(button);
+ return button;
+ }
+
+ private void initializePage() {
+ setPageComplete(false);
+ }
+
+ private void initializeViewer() {
+ if (listViewer == null) {
+ return;
+ }
+ listViewer.setInput(idMap.entrySet());
+ wizard = this.getWizard();
+ List<String> poolIdList = ((BpmnToWizard) wizard).getPoolIdList();
+ if (poolIdList.size() == 0) {
+ listViewer.setAllChecked(false);
+ } else {
+ for (String id : poolIdList) {
+ Set<Entry<String, String>> set = idMap.entrySet();
+ Entry<String, String> selectedEntry = null;
+ for (Entry<String, String> entry : set) {
+ if (entry.getKey().equals(id)) {
+ selectedEntry = entry;
+ break;
+ }
+ }
+ listViewer.setChecked(selectedEntry, true);
+ }
+ }
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void changeComplete() {
+ if (listViewer.getCheckedElements().length != 0) {
+ setPageComplete(true);
+ } else {
+ setPageComplete(false);
+ }
+ }
+
+ public Map<String, String> getIdMap() {
+ return idMap;
+ }
+
+ public void setIdMap(Map<String, String> idMap) {
+ this.idMap = idMap;
+ initializeViewer();
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnPoolsChoicePage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ErrorMessagesPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.GeneratedFileLocationPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BPMNResourcesChoicePage;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn translation
+ */
+public abstract class BpmnToWizard extends Wizard implements IExportWizard {
+
+ private BPMNResourcesChoicePage bpmnResPage;
+ private BpmnPoolsChoicePage poolsPage;
+ private GeneratedFileLocationPage locationPage;
+ private ErrorMessagesPage errorPage;
+
+ // the selected *.bpmn file
+ private IStructuredSelection selection;
+ // the selected folder to save these generated files
+ private IStructuredSelection targetLocationSelection;
+ // bpmn pool id:name map
+ private Map<String, String> idMap;
+
+ protected String bpmnFileName;
+ protected String bpmnFileParentPath;
+ protected List<String> poolIdList = new ArrayList<String>();
+ // the list contains errors or warnings when generating
+ protected List<String> errorList = new ArrayList<String>();
+
+ public BpmnToWizard() {
+ super();
+ super.setWindowTitle(B2JMessages.Bpmn_Wizard_Title);
+ }
+
+ public void addPages() {
+ super.addPages();
+
+ bpmnResPage = new BPMNResourcesChoicePage(
+ B2JMessages.Bpmn_File_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Message);
+ bpmnResPage.setSelection(selection);
+ poolsPage = new BpmnPoolsChoicePage(
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Message);
+ errorPage = new ErrorMessagesPage(
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Name,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Title,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Message);
+ locationPage = new GeneratedFileLocationPage(
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Name,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Title,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Message);
+ locationPage.setSelection(selection);
+ addPage(bpmnResPage);
+ addPage(poolsPage);
+ addPage(errorPage);
+ addPage(locationPage);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ /*
+ * do some initial tasks
+ */
+ private void initialize() {
+ if (selection.getFirstElement() instanceof IFile) {
+ IFile bpmnFile = (IFile) selection.getFirstElement();
+ bpmnFileName = bpmnFile.getName();
+ bpmnFileParentPath = bpmnFile.getParent().getLocation()
+ .toOSString();
+ try {
+ idMap = BPMNToUtil.getPoolIDsFromDocument(getDocument(
+ bpmnFileParentPath, bpmnFileName));
+ poolIdList.clear();
+ } catch (Exception e) {
+ errorList.add(0, NLS.bind(
+ B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ e.printStackTrace();
+ }
+ }
+ if (poolsPage != null) {
+ poolsPage.setIdMap(idMap);
+ }
+ }
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page.getName()
+ .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ errorList = translateBpmnToStrings();
+ if (errorList.size() == 0) {
+ return locationPage;
+ }
+ errorPage.getListViewer().setInput(errorList);
+ return super.getNextPage(page);
+ } else {
+ return super.getNextPage(page);
+ }
+
+ }
+
+ public boolean performFinish() {
+
+ createGeneratedFile(locationPage.isOverWrite());
+ refreshWorkspace();
+ return true;
+ }
+
+ /*
+ * do the translation from bpmn to string list the sub class need to create
+ * a string list to reserve these strings
+ * the return list is error or warning messages
+ */
+ public abstract List<String> translateBpmnToStrings();
+
+ /*
+ * write the generated strings to the files
+ */
+ public abstract void createGeneratedFile(boolean b);
+
+ /*
+ * get the path of the eclipse workspace container
+ */
+ protected String getContainerPath(IContainer container) {
+ return container.getLocation().toOSString();
+ }
+
+ /*
+ * get the dom document from a given path and file name
+ */
+ public Document getDocument(String bpmnFileParentPath, String bpmnFileName)
+ throws Exception {
+ Document bpmnDocument = null;
+ bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
+ return bpmnDocument;
+ }
+
+ /*
+ * refresh eclipse workspace
+ */
+ public void refreshWorkspace() {
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
+ IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public List<String> getPoolIdList() {
+ return poolIdList;
+ }
+
+ public void setPoolIdList(List<String> poolIdList) {
+ this.poolIdList = poolIdList;
+ }
+
+ public List<String> getErrorList() {
+ return errorList;
+ }
+
+ public void setErrorList(List<String> errorList) {
+ this.errorList = errorList;
+ }
+
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ public String getBpmnFileName() {
+ return bpmnFileName;
+ }
+
+ public void setBpmnFileName(String bpmnFileName) {
+ this.bpmnFileName = bpmnFileName;
+ }
+
+ public String getBpmnFileParentPath() {
+ return bpmnFileParentPath;
+ }
+
+ public void setBpmnFileParentPath(String bpmnFileParentPath) {
+ this.bpmnFileParentPath = bpmnFileParentPath;
+ }
+
+ public IStructuredSelection getTargetLocationSelection() {
+ return targetLocationSelection;
+ }
+
+ public void setTargetLocationSelection(
+ IStructuredSelection targetLocationSelection) {
+ this.targetLocationSelection = targetLocationSelection;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for showing the error and warning messages from translating
+ */
+public class ErrorMessagesPage extends WizardPage {
+
+ private TableViewer listViewer;
+
+ protected ErrorMessagesPage(String pageName, String title, String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ setControl(composite);
+
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_Translate_Message_WizardpageViewer_Title);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = new TableViewer(composite, SWT.SINGLE | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ return true;
+ }
+
+
+ public TableViewer getListViewer() {
+ return listViewer;
+ }
+
+ public void setListViewer(TableViewer listViewer) {
+ this.listViewer = listViewer;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for the generated file location
+ */
+public class GeneratedFileLocationPage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private Button button;
+ private IWizard wizard;
+ private boolean isOverWrite;
+
+
+ protected GeneratedFileLocationPage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ createCheckbox(composite);
+ super.setControl(composite);
+
+ initializePage();
+
+ }
+
+ private Label createListTitleArea(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle);
+ label.setFont(parent.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setTargetLocationSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private Button createCheckbox(Composite parent) {
+ button = new Button(parent, SWT.CHECK | SWT.NONE);
+ button
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_CheckBox);
+ button.setFont(parent.getFont());
+ button.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ isOverWrite = button.getSelection();
+ }});
+ return button;
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ if (currentSelection != null
+ && currentSelection instanceof ITreeSelection) {
+ // Select the parent project of this first bpmn file chosen
+ ITreeSelection node = (ITreeSelection) currentSelection;
+ TreePath[] paths = node.getPaths();
+ TreePath projPath = new TreePath(new Object[] { paths[0]
+ .getFirstSegment() });
+ TreeSelection projSel = new TreeSelection(projPath);
+ viewer.setSelection(projSel, true);
+ }
+ }
+ button.setSelection(true);
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ if (viewer != null && viewer.getSelection() == null) {
+ return false;
+ }
+ return true;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+
+ public void setSelection(ISelection currentSelection) {
+ this.currentSelection = currentSelection;
+ }
+
+
+ public boolean isOverWrite() {
+ return isOverWrite;
+ }
+
+ public void setOverWrite(boolean isOverWrite) {
+ this.isOverWrite = isOverWrite;
+ }
+
+}
+
+class ProFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ return element instanceof IContainer;
+ }
+}
17 years, 6 months
JBoss Tools SVN: r10770 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-10 04:07:44 -0400 (Fri, 10 Oct 2008)
New Revision: 10770
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-2880:ESB project creation wizard can not continue when choose server supplied ESB runtime without specifying a user supplied esb runtime
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-10 05:43:16 UTC (rev 10769)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-10 08:07:44 UTC (rev 10770)
@@ -361,6 +361,9 @@
} catch (CoreException e) {
ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
}
+ hasRuntime = true;
+ setPageComplete(isPageComplete());
+ setErrorMessage(null);
}
17 years, 6 months
JBoss Tools SVN: r10769 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-10 01:43:16 -0400 (Fri, 10 Oct 2008)
New Revision: 10769
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
Log:
JBIDE-2847
fix the bug.
because some object will be NULL if the smooks file can't be parsed , so when user click the "AddButton" there will happen NPE.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -59,6 +59,7 @@
if(true){
Shell shell = context.getShell();
MessageDialog.openWarning(shell, "Warning", "The java2xml can't be generate to config file currently.");
+ return;
}
GraphRootModel rootModel = context.getDataMappingRootModel();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -35,8 +35,11 @@
import org.jboss.tools.smooks.analyzer.NormalSmooksModelBuilder;
import org.jboss.tools.smooks.analyzer.NormalSmooksModelPackage;
import org.jboss.tools.smooks.model.DocumentRoot;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.model.provider.SmooksItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.util.SmooksResourceFactoryImpl;
+import org.jboss.tools.smooks.utils.UIUtils;
/**
* @author Dart Peng
@@ -51,7 +54,7 @@
private ComposedAdapterFactory adapterFactory;
private AdapterFactoryEditingDomain editingDomain;
private Resource smooksResource;
-
+
private boolean forceDirty = false;
public SmooksFormEditor() {
@@ -69,8 +72,6 @@
protected CommandStack createCommandStack() {
return new BasicCommandStack();
}
-
-
@Override
public boolean isDirty() {
@@ -79,16 +80,20 @@
@Override
protected void addPages() {
- graphicalPage = new SmooksGraphicalFormPage(this, "graph", "Mapping");
try {
+ graphicalPage = new SmooksGraphicalFormPage(this, "graph",
+ "Mapping");
int index = this.addPage(this.graphicalPage);
this.setPageText(index, "Graph");
normalPage = new SmooksNormalContentEditFormPage(this, "normal",
- "Normal Edition",null);
+ "Normal Edition", null);
index = this.addPage(normalPage);
setPageText(index, "Normal");
- } catch (PartInitException e) {
- e.printStackTrace();
+ // Set a default NormalPacakge to Normal Page
+ this.refreshNormalPage(Collections.EMPTY_LIST);
+ } catch (Exception e) {
+ UIUtils.showErrorDialog(getSite().getShell(), UIUtils
+ .createErrorStatus(e));
}
}
@@ -103,7 +108,7 @@
throws PartInitException {
super.init(site, input);
IFile file = ((IFileEditorInput) input).getFile();
- String path =file.getLocation().toOSString();
+ String path = file.getLocation().toOSString();
if (this.getEditingDomain() != null && smooksResource == null) {
smooksResource = new SmooksResourceFactoryImpl().createResource(URI
.createFileURI(path));
@@ -114,13 +119,29 @@
e.printStackTrace();
}
}
+ DocumentRoot documentRoot = null;
+ if(smooksResource.getContents().isEmpty()){
+ documentRoot = SmooksFactory.eINSTANCE.createDocumentRoot();
+ smooksResource.getContents().add(documentRoot);
+ }else{
+ documentRoot = (DocumentRoot) smooksResource.getContents().get(0);
+ }
+
+ SmooksResourceListType resourceList = documentRoot.getSmooksResourceList();
+ if(resourceList == null){
+ resourceList = SmooksFactory.eINSTANCE.createSmooksResourceListType();
+ documentRoot.setSmooksResourceList(resourceList);
+ }
+
}
}
public void refreshNormalPage(List resourceHidenConfigs) {
NormalSmooksModelPackage modelPackage = createSmooksModelPackage();
+ if (modelPackage != null){
+ modelPackage.setHidenSmooksElements(resourceHidenConfigs);
+ }
if (this.normalPage != null) {
- modelPackage.setHidenSmooksElements(resourceHidenConfigs);
normalPage.setModelPackage(modelPackage);
}
}
@@ -142,8 +163,8 @@
graphicalPage.doSave(monitor);
fireEditorDirty(false);
}
-
- public void fireEditorDirty(boolean dirty){
+
+ public void fireEditorDirty(boolean dirty) {
this.forceDirty = dirty;
this.firePropertyChange(PROP_DIRTY);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -13,22 +13,31 @@
/**
* @author dart
- *
+ *
*/
public class XML2XMLAnalyzer extends AbstractAnalyzer {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
*/
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
- Shell shell = context.getShell();
- MessageDialog.openWarning(shell, "Warning", "The xml2xml can't be generate to config file currently.");
+ if (true) {
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning",
+ "The xml2xml can't be generate to config file currently.");
+ return;
+ }
}
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType, java.lang.Object, java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType,
+ * java.lang.Object, java.lang.Object)
*/
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
17 years, 6 months
JBoss Tools SVN: r10768 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-09 10:43:49 -0400 (Thu, 09 Oct 2008)
New Revision: 10768
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
trunk/birt/docs/en/modules/birt_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-388 - links adjusted, BIRT Designer chapter updated
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-09 13:35:22 UTC (rev 10767)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-09 14:43:49 UTC (rev 10768)
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
-<chapter id="birt_designer" xreflabel="birt_designer">
+<chapter id="Birt_Designer" xreflabel="Birt_Designer">
<?dbhtml filename="birtDesigner.html"?>
<chapterinfo>
<keywordset>
@@ -10,30 +10,26 @@
</keywordset>
</chapterinfo>
- <title>BIRT Designer</title>
-
-
+ <title>BIRT Report Designer</title>
-
-
-
- <section id="birt_designer_introduction">
-
- <title>BIRT Report Designer</title>
- <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will pass you through all its features.</para>
-
- </section>
-
-
-
+ <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will describe all its features to you.</para>
+
<section id="birt_designer_features">
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
- <itemizedlist><listitem><para><emphasis role="bold"></emphasis>Palette - Contains the standard BIRT report elements such as labels, tables, and charts and is used in conjunction with the Layout View to design reports.</para></listitem>
+ <itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
+ <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
+ <listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
+ <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT reports are organized as a tree structure with the overall report as the root, and separate categories for styles, report content, data sources, data sets, report parameters and more. The Outline view provides a compact overview of your entire report structure.</para></listitem>
+ <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Learning a new tool is always a challenge, but Eclipse offers an innovative solution: cheat sheets. These are short bits of documentation that walk you through new tasks.</para></listitem>
+ <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
+ <listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
+ <listitem><para><emphasis role="bold">Expression Builder </emphasis> - BIRT expressions are really just simple scripts that return a value. Expressions are used for assigning data values to report elements, building image locations, hyperlinks, parameter default values and many other places. Expressions are constructed within BIRT using the Expression Builder.</para></listitem>
-
-
</itemizedlist>
@@ -41,16 +37,14 @@
<para>There are a number of ways we can improve the report's appearance: </para>
- <itemizedlist><listitem><para>Add a title to the top of the report;</para></listitem>
-
-
-
- Add a title to the top of the report.
- Add some color to enhance the column headings.
- Shrink the size of the city and state columns.
- Add some color to make the state and city group headers stand out.
- Format the phone numbers.
- Sort customers by name.
- </itemizedlist>
+ <itemizedlist>
+ <listitem><para>Add a title to the top of the report;</para></listitem>
+ <listitem><para> Add a title to the top of the report. </para></listitem>
+ <listitem><para> Add some color to enhance the column headings. </para></listitem>
+ <listitem><para> Shrink the size of the city and state columns. </para></listitem>
+ <listitem><para>Add some color to make the state and city group headers stand out. </para></listitem>
+ <listitem><para>Format the phone numbers. </para></listitem>
+ <listitem><para>Sort customers by name.</para></listitem>
+ </itemizedlist>
</section>
</chapter>
Modified: trunk/birt/docs/en/modules/birt_support.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_support.xml 2008-10-09 13:35:22 UTC (rev 10767)
+++ trunk/birt/docs/en/modules/birt_support.xml 2008-10-09 14:43:49 UTC (rev 10768)
@@ -255,7 +255,7 @@
<section><title>Create Report Layout</title>
- <para>After the Data source and Data set are specified you can continue with the report layout. Please see the <xref linkend="birt_designer"/> chapter to learn more about BIRT Report Designer.</para>
+ <para>After the Data source and Data set are specified you can continue with the report layout. Please see the <xref linkend="Birt_Designer"/> chapter to learn more about BIRT Report Designer.</para>
</section>
17 years, 6 months
JBoss Tools SVN: r10767 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 09:35:22 -0400 (Thu, 09 Oct 2008)
New Revision: 10767
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
Log:
Check the object if it's NULL
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-10-09 13:33:58 UTC (rev 10766)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-10-09 13:35:22 UTC (rev 10767)
@@ -189,12 +189,13 @@
Object element) {
if (element == transformType)
return false;
- if(modelPackage != null){
+ if (modelPackage != null) {
List hidenList = modelPackage.getHidenSmooksElements();
for (Iterator iterator = hidenList.iterator(); iterator
.hasNext();) {
Object object = (Object) iterator.next();
- if(object == element) return false;
+ if (object == element)
+ return false;
}
}
return true;
@@ -298,6 +299,8 @@
}
protected void downButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
Object object = selection.getFirstElement();
@@ -316,6 +319,8 @@
}
protected void upButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
Object object = selection.getFirstElement();
@@ -333,6 +338,8 @@
}
protected void removeButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
List selections = selection.toList();
@@ -354,6 +361,8 @@
}
protected void addButtonSelected() {
+ if (modelPackage == null)
+ return;
NewResourceConfigWizard wizard = new NewResourceConfigWizard();
WizardDialog dialog = new WizardDialog(parentEditor.getSite()
.getShell(), wizard);
17 years, 6 months
JBoss Tools SVN: r10766 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 09:33:58 -0400 (Thu, 09 Oct 2008)
New Revision: 10766
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java
Log:
disable the id browse button
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java 2008-10-09 12:19:45 UTC (rev 10765)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java 2008-10-09 13:33:58 UTC (rev 10766)
@@ -101,25 +101,33 @@
formToolKit.paintBordersFor(beanClassComposite);
this.formToolKit.createLabel(parent, "Bean ID : ");
- Composite beanIDComposite = formToolKit.createComposite(parent);
- GridLayout bilg = new GridLayout();
- bilg.numColumns = 2;
- bilg.marginHeight = 0;
- bilg.marginWidth = 1;
- beanIDComposite.setLayout(bilg);
-
- beanIDText = formToolKit.createText(beanIDComposite, "");
+ beanIDText = formToolKit.createText(parent, "");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
beanIDText.setLayoutData(gd);
-
- idBrowseButton = formToolKit.createButton(beanIDComposite, "Browse",
- SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- beanIDComposite.setLayoutData(gd);
- formToolKit.paintBordersFor(beanIDComposite);
+
+// Composite beanIDComposite = formToolKit.createComposite(parent);
+// GridLayout bilg = new GridLayout();
+// bilg.numColumns = 1;
+// bilg.marginHeight = 1;
+// bilg.marginWidth = 1;
+// beanIDComposite.setLayout(bilg);
+//
+// beanIDText = formToolKit.createText(beanIDComposite, "");
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// gd.grabExcessHorizontalSpace = true;
+// beanIDText.setLayoutData(gd);
+//
+// idBrowseButton = formToolKit.createButton(beanIDComposite, "Browse",
+// SWT.NONE);
+// idBrowseButton.setEnabled(false);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// gd.grabExcessHorizontalSpace = true;
+// beanIDComposite.setLayoutData(gd);
+// formToolKit.paintBordersFor(beanIDComposite);
formToolKit.paintBordersFor(parent);
+
+
configControls();
hookContorls();
}
@@ -199,13 +207,13 @@
}
});
- idBrowseButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- idBrowseButtonSelected();
- }
-
- });
+// idBrowseButton.addSelectionListener(new SelectionAdapter() {
+//
+// public void widgetSelected(SelectionEvent e) {
+// idBrowseButtonSelected();
+// }
+//
+// });
}
private void configControls() {
17 years, 6 months
JBoss Tools SVN: r10765 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test: jbide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-09 08:19:45 -0400 (Thu, 09 Oct 2008)
New Revision: 10765
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
=junit test for JBIDE-2828
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-09 10:28:48 UTC (rev 10764)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-09 12:19:45 UTC (rev 10765)
@@ -38,6 +38,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2594Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2624Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2774Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2828Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -64,7 +65,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$ //$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(Jsf20ComponentContentTest.class);
@@ -101,6 +102,7 @@
suite.addTestSuite(JBIDE1805Test.class);
suite.addTestSuite(JsfComponentContentTest.class);
suite.addTestSuite(JBIDE2774Test.class);
+ suite.addTestSuite(JBIDE2828Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-09 12:19:45 UTC (rev 10765)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test case for jbide-2828
+ *
+ * @author mareshkau
+ *
+ */
+public class JBIDE2828Test extends VpeTest {
+ /**
+ *
+ * @param name
+ */
+ public JBIDE2828Test(String name) {
+ super(name);
+ }
+ public void testJBIDE2828JbossELParser() {
+
+ ELParserFactory jbossParserFactory = ELParserUtil.getJbossFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", jbossParserFactory); //$NON-NLS-1$
+
+ ELParser elParser = jbossParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+ /**
+ * Test for default parser
+ */
+ public void testJBIDE2828DefaultELParser() {
+
+ ELParserFactory defaultParserFactory = ELParserUtil.getDefaultFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", defaultParserFactory); //$NON-NLS-1$
+
+ ELParser elParser = defaultParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+
+}
17 years, 6 months
JBoss Tools SVN: r10764 - in trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core: module and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-09 06:28:48 -0400 (Thu, 09 Oct 2008)
New Revision: 10764
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
Log:
JBIDE-2875: Pick up jboss-esb.xml and deployment.xml files to the correct path when packaging a deployable archives
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-09 10:27:52 UTC (rev 10763)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-09 10:28:48 UTC (rev 10764)
@@ -7,7 +7,10 @@
public final static String BUILD_CLASSES = "build/classes";
public final static String META_INF = "META-INF";
- public final static String ESB_DEPLOYMENT_FILE_NAME = "META-INF/deployment.xml";
+ public final static String ESB_CONFIG_JBOSSESB = "jboss-esb.xml";
+ public final static String ESB_CONFIG_DEPLOYMENT = "deployment.xml";
+ public final static String ESB_CONFIG_QUEUE_SERVICE_JBM = "jbm-queue-service.xml";
+ public final static String ESB_CONFIG_QUEUE_SERVICE_JBMQ = "jbmq-queue-service.xml";
public final static String ESB_PROJECT_NATURE = "org.jboss.tools.esb.project.ESBNature";
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-09 10:27:52 UTC (rev 10763)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-09 10:28:48 UTC (rev 10764)
@@ -15,10 +15,12 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.util.ModuleFile;
import org.eclipse.wst.server.core.util.ModuleFolder;
import org.eclipse.wst.server.core.util.ProjectModule;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
public class JBossESBModuleDelegate extends ProjectModule {
@@ -37,11 +39,38 @@
IFolder configFolder = project.getFolder(esbFolder);
IJavaProject javaPrj = JavaCore.create(project);
IPath output = javaPrj.getOutputLocation();
+ // if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder of the project
+ List<IModuleResource> mrs = new ArrayList<IModuleResource>();
+ IFolder metainf = configFolder.getFolder(ESBProjectConstant.META_INF);
+ IResource res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_JBOSSESB));
+ }
+
+ //check the deployment.xml just like jboss-esb.xml
+ res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT));
+ }
+
+ res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM));
+ }
+ res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ));
+ }
+
IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
- IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length];
+ IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
+ if(mrs.size() > 0){
+ IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
+ System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
+ }
return allResource;
}
@@ -78,5 +107,30 @@
return new IModuleResource[0];
}
-
+ // create moduleresource for a name specified resource
+ protected IModuleFile getModuleResourcesOutofESBContent(IPath path, IContainer container, String fileName) throws CoreException {
+
+ IResource file = container.findMember(fileName, false);
+ if(file != null){
+ return new ModuleFile((IFile)file, file.getName(), path);
+ }
+
+ IResource[] resources = container.members();
+ if (resources != null) {
+ int size = resources.length;
+ for (int i = 0; i < size; i++) {
+ IResource resource = resources[i];
+ if (resource != null && resource.exists()) {
+ if (resource instanceof IContainer) {
+ IModuleFile mf = getModuleResourcesOutofESBContent(path, (IContainer)resource, fileName);
+
+ if(mf != null) return mf;
+ }
+ }
+ }
+
+ }
+
+ return null;
+ }
}
17 years, 6 months