public class Module extends Named
DataObjectDefinition
)
tightly linked together.Constructor and Description |
---|
Module(java.lang.String name,
java.lang.String code,
java.lang.String label,
java.lang.String path,
java.lang.String author,
java.lang.String versionid,
java.lang.String frontpagemessage)
Creates a new module in the application
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(ActionDefinition thisaction)
registers the action in the package
|
boolean |
addActionIfNotExists(ActionDefinition thisaction)
registers an action if it does not exist yet
|
void |
addAdvancedFeature(AdvancedDesignFeature advancedfeature)
adds an advanced feature.
|
void |
addAsDefaultPageAction(StaticActionDefinition actionfordefaultpage)
allows to specify the action launching a default page for the application.
|
void |
addasMenuAction(StaticActionDefinition thisaction)
registers the action in the package and adds a link from the menu of the
module to the action.
|
void |
addAuthority(TotalAuthority authority) |
void |
addChoiceCategory(ChoiceCategory choice)
registers a choice category with the module.
|
void |
addGroup(Group group) |
void |
addMigrator(DataMigrator datamigrator)
adds a data migrator to the module.
|
void |
addModuleDomain(ModuleDomain thisdomain)
Defines a domain for the module.
|
void |
addModuleDomainAuthority(ModuleDomainAuthority moduledomainauthority)
Define a similar authority for each module domain
|
void |
addModuleDomainGroup(ModuleDomainGroup thismoduledomaingroup)
creates a set of groups having similar roles on all the domains of the module
|
void |
addMultiFieldConstraint(MultiFieldConstraint constraint)
registers with the module a multi-field constraint for an object.
|
void |
addObject(DataObjectDefinition object)
registers the object in the package.
|
void |
AddPage(PageDefinition thispage)
adds a page to the module
|
void |
addPrivilege(Privilege privilege)
registers the privilege with the module
|
void |
addSequenceDefinition(SequenceDefinition sequence)
The sequence is a counter incremented in the database, typically used to
generate numbers for objects.
|
void |
addSystemAttribute(SystemAttributeInit thisattribute)
adds a system attribute to this module
|
void |
addTrigger(Trigger trigger)
adds a trigger to the module
|
void |
addUser(User user) |
void |
CleanDirectoryOfJavaFiles(java.lang.String path)
during code generation, this method will clear all folders that should have
only automatically generated files
|
void |
generateSources()
generates all the sources for the module
|
void |
generateToFile(SourceGenerator sg)
generates the module to file
|
ActionDefinition |
getAction(int index)
gets action at the given index in the module
|
int |
getActionNumber() |
java.lang.String |
getAuthor() |
ChoiceCategory |
getChoice(int i)
gets the choice category at the given index
|
int |
getChoiceNumber() |
java.lang.String |
getCode() |
AddonPageDefinition |
getDefaultaddon() |
TotalAuthority |
getModuleOverlord() |
DataObjectDefinition |
getObject(int index)
returns the data object at the given index
|
int |
getObjectNumber() |
PageDefinition |
getPage(int i)
gets the page at the given index in the module
|
int |
getPageNumber() |
java.lang.String |
getPath() |
Privilege[] |
getPrivilegesForAction(ActionDefinition thisaction)
gets all the privileges defined for an action
|
SequenceDefinition |
getSequence(int i)
get the definition of the sequence at the given index
|
static SystemModule |
getSystemModule()
gets the system module
|
java.lang.String |
getVersionid() |
boolean |
hasDataInitialization() |
void |
initStandardAuthoritiesAndGroup()
inits the administrator user of the module and the related group and
authority
|
ActionDefinition |
lookupActionDefinition(java.lang.String name)
returns the action for the given name
|
static void |
main(java.lang.String[] args)
This allows to launch from command line the generation of an application
|
void |
setDataInitializationFlag(boolean hasdatainitialization)
allows to define that there should be a data initialization class defined by
the user.
|
void |
setDefaultAddonPageDefinition(AddonPageDefinition defaultaddon)
Allows to specify an alternative to the default Open Lowcode add-on page.
|
void |
setEmailMessage(java.lang.String emailmessage)
sets a specific e-mail message for workflow notifications
|
static void |
setSystemModule(SystemModule systemmodulefromconstructor)
sets the system module.
|
void |
validateProductCode(java.lang.String code)
validate the product code is valid (2 digits, starting by upper case letter,
second digit can be number or upper case letter)
|
changeName, cleanName, equals, getName
public Module(java.lang.String name, java.lang.String code, java.lang.String label, java.lang.String path, java.lang.String author, java.lang.String versionid, java.lang.String frontpagemessage)
name
- technical name of the module (e.g. 'BUGMGT' ), only
upper-case letters and numbers (do not start by
number)code
- a 2 letters and digit code that should be unique for
the serverlabel
- the plain English name of the module (e.g. 'Bug
Management')path
- a valid java path (e.g. 'com.maboite.monapp')author
- the name of author that will be put in auto-generated
codeversionid
- the version of application that will be put in
auto-generated codefrontpagemessage
- allows to set a specific message on the default front
page of the applicationpublic SequenceDefinition getSequence(int i)
i
- index between 0 (included) and getSequenceNumber (excluded)public void addAsDefaultPageAction(StaticActionDefinition actionfordefaultpage)
actionfordefaultpage
- a static action to launch the default pagepublic void addChoiceCategory(ChoiceCategory choice)
choice
- the choicecategory to addpublic ActionDefinition lookupActionDefinition(java.lang.String name)
name
- name of the actionpublic void addSequenceDefinition(SequenceDefinition sequence)
sequence
- sequence to add in the modulepublic void validateProductCode(java.lang.String code)
code
- code of the modulepublic void addSystemAttribute(SystemAttributeInit thisattribute)
thisattribute
- public void addMultiFieldConstraint(MultiFieldConstraint constraint)
constraint
- the multifield constraintpublic void addUser(User user)
user
- adds a hardcoded user to the modulepublic void addAuthority(TotalAuthority authority)
authority
- adds a total authority for the module.public void addGroup(Group group)
group
- adds a group to the modulepublic void setDataInitializationFlag(boolean hasdatainitialization)
hasdatainitialization
- true if the user should define a class to init
datapublic boolean hasDataInitialization()
public AddonPageDefinition getDefaultaddon()
public java.lang.String getAuthor()
public void addMigrator(DataMigrator datamigrator)
datamigrator
- data migratorpublic void setDefaultAddonPageDefinition(AddonPageDefinition defaultaddon)
defaultaddon
- an addon pagepublic int getPageNumber()
public int getChoiceNumber()
public ChoiceCategory getChoice(int i)
i
- a number between 0 (included) and getChoiceNumber (excluded)public PageDefinition getPage(int i)
i
- a number bebtween 0 (included) and getPageNumber (excluded)public java.lang.String getVersionid()
public void setEmailMessage(java.lang.String emailmessage)
emailmessage
- e-mail message for workflow notificationspublic void addModuleDomain(ModuleDomain thisdomain)
thisdomain
- public void addModuleDomainGroup(ModuleDomainGroup thismoduledomaingroup)
thismoduledomaingroup
- the module domain grouppublic void addModuleDomainAuthority(ModuleDomainAuthority moduledomainauthority)
moduledomainauthority
- public void addPrivilege(Privilege privilege)
privilege
- the privilege to addpublic java.lang.String getCode()
public Privilege[] getPrivilegesForAction(ActionDefinition thisaction)
thisaction
- an action of the modulepublic void initStandardAuthoritiesAndGroup()
public TotalAuthority getModuleOverlord()
public int getObjectNumber()
public DataObjectDefinition getObject(int index)
index
- a number between 0 (included) and getObjectNumber (excluded)public void AddPage(PageDefinition thispage)
thispage
- the page to addpublic void addAction(ActionDefinition thisaction)
thisaction
- action to addpublic boolean addActionIfNotExists(ActionDefinition thisaction)
thisaction
- action to addpublic void addasMenuAction(StaticActionDefinition thisaction)
thisaction
- public void addObject(DataObjectDefinition object)
object
- data objectpublic void addAdvancedFeature(AdvancedDesignFeature advancedfeature)
advancedfeature
- the advanced feature to be addedpublic java.lang.String getPath()
public int getActionNumber()
public ActionDefinition getAction(int index)
index
- a number between 0 (included) and getActionNumber() (excluded)public void CleanDirectoryOfJavaFiles(java.lang.String path) throws java.io.IOException
path
- the path to clean (a folder)java.io.IOException
- if anything bad happens while clearing the filepublic void generateToFile(SourceGenerator sg) throws java.io.IOException
sg
- source generatorjava.io.IOException
- if anything bad happens while writing the filepublic void generateSources() throws java.io.IOException
java.io.IOException
- if anything bad happens while writing the filespublic static void main(java.lang.String[] args)
args
- an aray of strings with one element indicating the full path of
the main module of the application (e.g.
com.mycompany.myapp.Mymodule )public static void setSystemModule(SystemModule systemmodulefromconstructor)
systemmodulefromconstructor
- the System Module (itself)public static SystemModule getSystemModule()
public void addTrigger(Trigger trigger)
trigger
- trigger to add