|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.studio.res.generator.IlrFileGenerator
public abstract class IlrFileGenerator
Defines a generator for the list in the new client project for the RuleApps wizard.
Nested Class Summary | |
---|---|
class |
IlrFileGenerator.Parameter
Stores a ruleset parameter name and type. |
class |
IlrFileGenerator.RuleApp
Provides some useful methods on a RuleApp project. |
class |
IlrFileGenerator.RulesetArchive
Stores a ruleset archive name and version with two lists of ruleset parameters: a list of input parameters (the IN and INOUT parameters) and a list of output parameters (the INOUT and OUT parameters). |
Field Summary | |
---|---|
protected boolean |
contentCreated
|
Constructor Summary | |
---|---|
protected |
IlrFileGenerator()
Constructs a new generator. |
Method Summary | |
---|---|
protected void |
addContainerEntryInClasspath(String container)
Adds to the Java project build path the specified container. |
protected void |
addLibraryEntryInClasspath(String path)
Adds to the Java project build path the path specified as an absolute path. |
protected void |
addProjectEntryInClasspath(String path)
Adds to the Java project build path the path specified as <projectName>. |
protected void |
addVariableEntryInClasspath(String path)
Adds to the Java project build path the path specified as <EclipseVariable>/<relativePath>. |
protected String |
changeInClassName(String name)
Gets the name specified, with a capital letter as the first letter. |
protected String |
changeInMethodName(String name)
Gets the name specified, with a lower case letter as the first letter. |
org.eclipse.core.resources.IProject |
completeProjectFromTemplate(org.eclipse.core.resources.IProject iproject,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Completes the specified project with the required files by calling the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor) method. |
protected void |
copyFile(String source,
String destination)
Copies a file from a location (absolute path) in the generated Java project to a destination directory with a specific file name. |
protected String |
createPackage(org.eclipse.core.resources.IProject project,
String root,
String name)
Creates a package in the root directory (relative to the project) of the destination project. |
org.eclipse.core.resources.IProject |
createProjectFromTemplate(String projectname,
org.eclipse.core.runtime.IPath location,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates the destination project and calls the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method on the new project. |
String |
generateLaunchConfigurationFile(String main)
Generates and saves a launch configuration file with the references to the Rule Project from the RuleApp project. |
void |
generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
Generates the content of the Java project. |
void |
generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Generates the content of the Java project. |
void |
generateProjectContent(org.eclipse.core.resources.IProject project)
Generates the content of the simple project. |
void |
generateProjectContent(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Generates the content of the simple project. |
org.eclipse.jface.wizard.IWizard |
getCompletionWizard()
Returns the completion wizard. |
org.eclipse.jface.wizard.IWizard |
getCreationWizard()
Returns the creation wizard. |
protected String |
getExecutionServerHome()
Gets the location of the ILOG_EXECUTION_SERVER_HOME Eclipse variable. |
protected List<IlrFileGenerator.Parameter> |
getInParameters()
Gets a list of the in/inout ruleset parameters for the RuleApp project. |
protected List<IlrFileGenerator.Parameter> |
getInParameters(Collection<IlrRulesetParameter> rulesetParameters)
Returns a list of input ruleset parameters as IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objects |
protected List<IlrFileGenerator.Parameter> |
getInParameters(IlrRulesetArchiveDescriptor desc)
Gets a list of the in/inout ruleset parameters for a ruleset archive of the RuleApp project. |
protected List<IlrFileGenerator.Parameter> |
getInParameters(IlrRulesetParameter[] params)
Deprecated. As of ODM 8.5.1, replaced by getInParameters(Collection rulesetParameters) . |
protected Set<String> |
getInParametersImports()
Deprecated. As of ODM 8.5.1. |
protected Set<String> |
getInParametersImports(IlrRulesetArchiveDescriptor archive)
Deprecated. As of ODM 8.5.1. |
protected org.eclipse.jdt.core.IJavaProject |
getJavaProject()
Gets the generated destination Java project. |
protected String |
getJavaProjectNameAsClassName()
Gets the Java project name as a valid Java class name, with a capital letter as the first letter. |
protected String |
getLaunchConfigurationName()
Gets the launch configuration name that was set during the execution of the generateLaunchConfigurationFile(String) method. |
protected IlrFileGenerator.Parameter |
getNewParameter(String name,
String type)
Returns a new object of type Parameter. |
protected IlrFileGenerator.RulesetArchive |
getNewRulesetArchive()
Returns a new object of type RulesetArchive . |
String |
getNotAllowedDescription()
Returns the message to display in the 'Client Project for RuleApps' wizard if the generator is not allowed to run to return the reason why. |
protected List<IlrFileGenerator.Parameter> |
getOutParameters(Collection<IlrRulesetParameter> rulesetParameters)
Returns a list of output ruleset parameters as IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objects. |
protected List<IlrFileGenerator.Parameter> |
getOutParameters(IlrRulesetParameter[] params)
Deprecated. As of ODM 8.5.1, replaced by getInParameters(Collection rulesetParameters) . |
protected Set<String> |
getOutParametersImports()
Deprecated. As of ODM 8.5.1. |
protected List<IlrFileGenerator.Parameter> |
getParameters(Collection<IlrRulesetParameter> rulesetParameters)
Transforms a collection of ilog.rules.res.model.IlrRulesetParameter objects into a list of IlrFileGenerator.Parameter instances. |
protected List<IlrFileGenerator.Parameter> |
getParameters(IlrRulesetParameter[] params)
Deprecated. As of ODM 8.5.1, replaced by getParameters(Collection rulesetParameters) . |
protected Set<String> |
getParametersImports()
Deprecated. As of ODM 8.5.1. |
protected org.eclipse.core.resources.IProject |
getProject()
Gets the generated destination project if the destination project is not a Java project. |
IlrRuleAppProject |
getRuleAppProject()
Gets the RuleApp project selected in the wizard. |
protected List<IlrFileGenerator.RulesetArchive> |
getRulesetArchives()
Gets a list of ruleset archives. |
protected List<IlrFileGenerator.RulesetArchive> |
getRulesetArchives(IlrRulesetArchiveDescriptor archive)
Gets a list of ruleset archives. |
protected String |
getRuleStudioHome()
Gets the location of the ILOG_BR_STUDIO_HOME Eclipse variable. |
IlrSignature[] |
getSignatures()
Gets the in and inout ruleset parameter names and values set
in the wizard. |
protected String |
getUTF8CharsetAsString()
|
org.eclipse.jface.wizard.IWizard |
getWizard()
Returns the wizard that this node stands for. |
protected List<String> |
getXOMPath()
Gets a list of paths (String) for all the necessary XOMs, for all rulesets in the RuleApp. |
void |
initialize(IlrRuleAppProject ruleappProject)
Initializes the generator with the data specified in the wizard. |
boolean |
isAllowed()
Returns true if the environment is correctly set to allow the generator to be run correctly. |
boolean |
isJavaProject()
Tests if the project is a Java or a simple project. |
protected void |
setJavaNature(org.eclipse.core.resources.IProject ijProject)
|
void |
setSignatures(IlrSignature[] signatures)
Sets the in and inout ruleset parameter names and values
in the wizard. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.wizard.IWizardNode |
---|
dispose, getExtent, isContentCreated |
Field Detail |
---|
protected boolean contentCreated
Constructor Detail |
---|
protected IlrFileGenerator()
Method Detail |
---|
public boolean isAllowed()
true
if the environment is correctly set to allow the generator to be run correctly.
Return false
otherwise. If false
is returned, the getNotAllowedDescription()
method
is called to get the description to display instead of the generator's description. The default
returned value is true
.
true
if the generator is allowed to run, otherwise return false
.public String getNotAllowedDescription()
isAllowed()
is used to control whether or not this message is
displayed. The message will be displayed instead of the generator description.
public void initialize(IlrRuleAppProject ruleappProject)
ruleappProject
- The RuleApp project selected in the wizard.public IlrRuleAppProject getRuleAppProject()
public void setSignatures(IlrSignature[] signatures)
in
and inout
ruleset parameter names and values
in the wizard.
signatures
- The in
parameter names and values.public IlrSignature[] getSignatures()
in
and inout
ruleset parameter names and values set
in the wizard.
public boolean isJavaProject()
true
, the new project will be a Java project and
src and bin directories will be created. The JRE and
Rule Execution Server JARs will be included in the classpath.
The method called is generateProjectContent(IJavaProject)
.
If the method returns false
, a simple project is created without
anything else.
The method called is generateProjectContent(IProject)
.
true
is returned.protected org.eclipse.jdt.core.IJavaProject getJavaProject()
protected String getLaunchConfigurationName()
generateLaunchConfigurationFile(String)
method.
protected String getJavaProjectNameAsClassName()
protected org.eclipse.core.resources.IProject getProject()
protected String changeInClassName(String name)
name
- The name to change.
protected String changeInMethodName(String name)
name
- The name to change.
public void generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject, org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(IJavaProject)
method for compatibility reasons.
javaProject
- The destination of the Java project files.monitor
- The progress monitor.public void generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
getJavaProject()
method.
javaProject
- The destination of the Java project files.public void generateProjectContent(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(IProject)
method for compatibility reasons.
project
- The destination of the project files.monitor
- The progress monitor.public void generateProjectContent(org.eclipse.core.resources.IProject project)
project
- The destination of the project files.protected String getRuleStudioHome()
protected String getExecutionServerHome()
protected void addVariableEntryInClasspath(String path)
protected void addLibraryEntryInClasspath(String path)
protected void addProjectEntryInClasspath(String path)
protected void addContainerEntryInClasspath(String container)
protected Set<String> getParametersImports()
protected Set<String> getInParametersImports()
protected Set<String> getInParametersImports(IlrRulesetArchiveDescriptor archive)
archive
input ruleset parameters that require import statements to be added in the generated code.
protected Set<String> getOutParametersImports()
protected List<IlrFileGenerator.Parameter> getParameters(Collection<IlrRulesetParameter> rulesetParameters)
ilog.rules.res.model.IlrRulesetParameter
objects into a list of IlrFileGenerator.Parameter
instances.
protected List<IlrFileGenerator.Parameter> getParameters(IlrRulesetParameter[] params)
getParameters(Collection rulesetParameters)
.
ilog.rules.engine.IlrRulesetParameter
objects into a list of IlrFileGenerator.Parameter
instances.
protected List<IlrFileGenerator.Parameter> getInParameters(Collection<IlrRulesetParameter> rulesetParameters)
IlrFileGenerator.Parameter
instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter
objects
protected List<IlrFileGenerator.Parameter> getInParameters(IlrRulesetParameter[] params)
getInParameters(Collection rulesetParameters)
.
IlrFileGenerator.Parameter
instances extracted from an array of ilog.rules.engine.IlrRulesetParameter
objects.
protected List<IlrFileGenerator.Parameter> getInParameters()
protected List<IlrFileGenerator.Parameter> getInParameters(IlrRulesetArchiveDescriptor desc)
protected List<IlrFileGenerator.Parameter> getOutParameters(Collection<IlrRulesetParameter> rulesetParameters)
IlrFileGenerator.Parameter
instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter
objects.
protected List<IlrFileGenerator.Parameter> getOutParameters(IlrRulesetParameter[] params)
getInParameters(Collection rulesetParameters)
.
IlrFileGenerator.Parameter
instances extracted from an array of ilog.rules.engine.IlrRulesetParameter
objects.
protected List<String> getXOMPath()
protected List<IlrFileGenerator.RulesetArchive> getRulesetArchives()
protected List<IlrFileGenerator.RulesetArchive> getRulesetArchives(IlrRulesetArchiveDescriptor archive)
protected void copyFile(String source, String destination)
source
- The location of the file to copy.destination
- The full path in the generated Java project.public String generateLaunchConfigurationFile(String main)
main
- The main class to execute.
protected String createPackage(org.eclipse.core.resources.IProject project, String root, String name)
project
- The project where the package is created.root
- The relative path where the package is created.name
- The new package name.
protected IlrFileGenerator.RulesetArchive getNewRulesetArchive()
RulesetArchive
. Redefine this method if you
extend the RulesetArchive
class and you want your class to be created instead
of IlrFileGenerator.RulesetArchive
.
protected IlrFileGenerator.Parameter getNewParameter(String name, String type)
IlrFileGenerator.Parameter
.
public org.eclipse.jface.wizard.IWizard getWizard()
If no wizard is specified in the extension, this method returns null
.
getWizard
in interface org.eclipse.jface.wizard.IWizardNode
public org.eclipse.jface.wizard.IWizard getCompletionWizard()
If no wizard is specified in the extension, this method returns the
IlrDefaultCompletionWizard
class.
public org.eclipse.jface.wizard.IWizard getCreationWizard()
If no wizard is specified in the extension, this method will return the
IlrDefaultCreationWizard
class.
public org.eclipse.core.resources.IProject createProjectFromTemplate(String projectname, org.eclipse.core.runtime.IPath location, IlrRuleAppProject sourceRuleAppProject, org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method on the new project.
Before the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method is called, the class path is completed
and the RuleApp archive is generated.
projectname
- The name of the new project.location
- The location of the new project.sourceRuleAppProject
- The RuleApp project used to generate the files.monitor
- The progress monitor.
public org.eclipse.core.resources.IProject completeProjectFromTemplate(org.eclipse.core.resources.IProject iproject, IlrRuleAppProject sourceRuleAppProject, org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method.
If the project does not exist on disk, it is created.
Before the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method is called, the class path is completed
and the RuleApp archive is generated.
iproject
- The project to complete.sourceRuleAppProject
- The RuleApp project used to generate the files.monitor
- The progress monitor.
protected void setJavaNature(org.eclipse.core.resources.IProject ijProject) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected String getUTF8CharsetAsString()
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |