LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behaviorinterface
Interface LyApplicationBehaviorInterface

All Superinterfaces:
LySessionListenerInterface
All Known Implementing Classes:
LyApplicationBehavior, LyDataApplicationBehavior

public interface LyApplicationBehaviorInterface
extends LySessionListenerInterface

This interface defines methods to implement in order to create a specific behavior for an application.

See Also:
LyApplication

Field Summary
static java.lang.String __VERSION
          File version
 
Method Summary
 void addSpecificEncoders(LyApplication application, LyDataProvider provider)
          Adds specific encoders for new providers if needed.
 void afterCommit(LyApplication application, java.lang.String idTransaction, java.lang.String locationId)
          Method called after a transaction has been committed on a location.
 void afterRollback(LyApplication application, java.lang.String idTransaction, java.lang.String locationId)
          Method called after a transaction has been rollbacked on a location.
 void beforeCommit(LyApplication application, java.lang.String idTransaction, java.lang.String locationId)
          Method called before a transaction should be committed on a location.
 void beforeRollback(LyApplication application, java.lang.String idTransaction, java.lang.String locationId)
          Method called before a transaction should be rollbacked on a location.
 void begin(LyApplication application, java.lang.String idTransaction, java.lang.String locationId)
          Method called when a transaction begins on a location.
 void close(LyApplication application)
          Method called when an application is closed.
 void connectionLost(LyApplication application, LyInfo server)
          Method called when a connection with a server (LyLocation or LyNotifier) is lost.
 void createDaemons(LyApplication application)
          Creates daemons to manage relations within an application.
 boolean deleteExtraInfo(LyApplication application, LyExtraInfoInterface info)
          Delete given extra info like preferences, charts or treemap configurations.
 boolean enableLoadUnloadData(LyClassInfo classInfo)
          Indicates whether data may be loaded / unloaded for given class info.
 void free()
          Free this behavior.
 LyEventManager getEventManager(LyApplication application)
          Get the event manager for the given application.
 LyInfoList<LyClassInfo> getLogicalClasses(LyApplication application, LyObjectId objectId, LyValueSet values)
          Method used to find logical classes of a peer object identifier.
 double getNextDouble(LyApplication application, LyClass objectClass)
          Method used to get an unique double value for the specified application.
 float getNextFloat(LyApplication application, LyClass objectClass)
          Method used to get an unique float value for the specified application.
 int getNextInt(LyApplication application, LyClass objectClass)
          Method used to get an unique int value for the specified application.
 long getNextLong(LyApplication application, LyClass objectClass)
          Method used to get an unique long value for the specified application.
 short getNextShort(LyApplication application, LyClass objectClass)
          Method used to get an unique short value for the specified application.
 int getPriorityLevel(LyApplication application, LyObject object)
          Gets the control priority level of the application.
 LyInfoList<LyClassInfo> getSubClasses(LyApplication application, LyObjectId objectId, LyValueSet values)
          Method used by abstract classes to define which subclass has to be loaded.
 java.lang.String[][] getSupportedLanguages(LyApplication application)
          Gets all languages that the given application supports.
 java.lang.String[] getSupportedTimeZones(LyApplication application)
          Get all timezone supported by this application.
 void loadData(LyApplication application)
          Method called when datas are loaded for an application.
 void loadData(LyApplication application, LyInfoList<LyClassInfo> classes)
          Load data for given classes.
 LyInfoList<LyInfo> loadExtraInfos(LyApplication application)
          Load extra infos.
 java.util.Vector<LyExtraInfoInterface> loadExtraInfosFromDB(LyApplication application, java.lang.String type, java.lang.String userId)
          Load extra info like preferences, charts, treemap configurations or form saves.
 LyInfoList<LyInfo> loadPreferences(LyApplication application)
          Load application preferences.
 LyInfoList<LyInfo> parseExtraFromDB(LyApplication application, java.lang.String prefType, java.lang.String userId)
          Method for parsing extra information such as charts or preferences.
 void saveData(LyApplication application)
          Method called when datas are saved for an application.
 boolean saveExtraInfo(LyApplication application, LyExtraInfoInterface info)
          Save given extra info like preferences, charts or treemap configurations.
 boolean saveExtraInfo(LyApplication application, LyExtraInfoInterface info, LyXmlWriterInterface writer)
          Save given extra info like preferences, charts or treemap configurations.
 void sessionAdded(LyApplication application, LyDataSession session)
          Method called when a session is added to the application.
 void sessionRemoved(LyApplication application, LyDataSession session)
          Method called when a session is removed from the application.
 void sleep(LyApplication application)
          Method called when an application falls in sleeping mode.
 boolean start(LyApplication application)
          Method called when an application is starting.
 boolean started(LyApplication application)
          Method called when an application is started.
 void transactionCompleted(LyApplication application, java.util.Vector<java.lang.String> idTransactions, java.util.Vector<java.lang.String> locationIds)
          Method called after a transaction was successfully completed (commit and notification done).
 void unloadData(LyApplication application)
          Method called when datas are unloaded for an application.
 void update(LyApplication application, java.lang.String idTransaction, java.lang.String locationId, java.lang.String request)
          Method called when a request is sent in a transaction for a location.
 void wakeUp(LyApplication application)
          Method called when an application is awake from sleeping mode.
 
Methods inherited from interface leon.app.behaviorinterface.LySessionListenerInterface
sessionLoggedIn
 

Field Detail

__VERSION

static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Method Detail

start

boolean start(LyApplication application)
Method called when an application is starting. This method is called before loading project and creating providers see started(LyApplication) to be notified after generic staring process.

Parameters:
application - Application that is starting.
Returns:
True if the application is correctly started, false otherwise.
See Also:
started(LyApplication)

started

boolean started(LyApplication application)
Method called when an application is started. This method is called after loading project and creating providers see start(LyApplication) to be notified before generic staring process.

Parameters:
application - Application that is started.
Returns:
True if the application is correctly started, false otherwise to stop starting process.
See Also:
start(LyApplication)

loadPreferences

LyInfoList<LyInfo> loadPreferences(LyApplication application)
Load application preferences.

Parameters:
application - Application on which preferences are loaded.
Returns:
List of preferences of the application.

loadExtraInfos

LyInfoList<LyInfo> loadExtraInfos(LyApplication application)
Load extra infos.

Parameters:
application - Application on which extra infos (like charts or treemap configurations) are loaded.
Returns:
List of extra infos for the application.

loadExtraInfosFromDB

java.util.Vector<LyExtraInfoInterface> loadExtraInfosFromDB(LyApplication application,
                                                            java.lang.String type,
                                                            java.lang.String userId)
Load extra info like preferences, charts, treemap configurations or form saves.

Parameters:
application - Application on which extra info is saved.
type - Type of the extra info.
id - Id of extra info.
Returns:
Info that was saved if found, null otherwise.

saveExtraInfo

boolean saveExtraInfo(LyApplication application,
                      LyExtraInfoInterface info)
Save given extra info like preferences, charts or treemap configurations.

Parameters:
application - Application on which extra info is saved.
info - Info to be saved.
Returns:
True if extra info was sucessfully saved.

saveExtraInfo

boolean saveExtraInfo(LyApplication application,
                      LyExtraInfoInterface info,
                      LyXmlWriterInterface writer)
Save given extra info like preferences, charts or treemap configurations.

Parameters:
application - Application on which extra info is saved.
info - Info to be saved.
writer - Writer interface.
Returns:
True if extra info was sucessfully saved.

deleteExtraInfo

boolean deleteExtraInfo(LyApplication application,
                        LyExtraInfoInterface info)
Delete given extra info like preferences, charts or treemap configurations.

Parameters:
application - Application on which extra info is deleted.
info - Info to be deleted.
Returns:
True if extra info was sucessfully deleted.

createDaemons

void createDaemons(LyApplication application)
Creates daemons to manage relations within an application.

Parameters:
application - Current application.

sessionAdded

void sessionAdded(LyApplication application,
                  LyDataSession session)
Method called when a session is added to the application.

Specified by:
sessionAdded in interface LySessionListenerInterface
Parameters:
application - Application in which a session is added.
session - Session added to the application.

sessionRemoved

void sessionRemoved(LyApplication application,
                    LyDataSession session)
Method called when a session is removed from the application.

Specified by:
sessionRemoved in interface LySessionListenerInterface
Parameters:
application - Application in which a session is removed.
session - Session removed from the application.

loadData

void loadData(LyApplication application)
Method called when datas are loaded for an application.

Parameters:
application - Application for which datas are loaded.

unloadData

void unloadData(LyApplication application)
Method called when datas are unloaded for an application.

Parameters:
application - Application for which datas are unloaded.

enableLoadUnloadData

boolean enableLoadUnloadData(LyClassInfo classInfo)
Indicates whether data may be loaded / unloaded for given class info.

Parameters:
classInfo - class info for which data may be loaded / unloaded
Returns:
true if data may be loaded / unloaded

saveData

void saveData(LyApplication application)
Method called when datas are saved for an application.

Parameters:
application - Application for which datas are saved.

close

void close(LyApplication application)
Method called when an application is closed.

Parameters:
application - Application that is closed.

sleep

void sleep(LyApplication application)
Method called when an application falls in sleeping mode.

Parameters:
application - Application for which datas are saved.

wakeUp

void wakeUp(LyApplication application)
Method called when an application is awake from sleeping mode.

Parameters:
application - Application that is awake.

getSupportedLanguages

java.lang.String[][] getSupportedLanguages(LyApplication application)
Gets all languages that the given application supports.

Parameters:
application - Application that is awake.
Returns:
Array of couple of strings that represents supported languages. Each couple of string is the code of the country for the language as defined in Locale for the first string, and the display name of the language or a key to the dictionary of this string for the second.

getSupportedTimeZones

java.lang.String[] getSupportedTimeZones(LyApplication application)
Get all timezone supported by this application.

Parameters:
application - the current application
Returns:
a list of supported timezones.

addSpecificEncoders

void addSpecificEncoders(LyApplication application,
                         LyDataProvider provider)
Adds specific encoders for new providers if needed. An encoder is used to encode a request made on a data source and decode results to give a response. For instance, the LySqlRequestEncoder encodes and decodes SQL queries to a RDBMS.

Parameters:
application - Current application.
provider - provider which may need an encoder

connectionLost

void connectionLost(LyApplication application,
                    LyInfo server)
Method called when a connection with a server (LyLocation or LyNotifier) is lost.

Parameters:
application - Current application.
server - Logical server definition

getPriorityLevel

int getPriorityLevel(LyApplication application,
                     LyObject object)
Gets the control priority level of the application. This level is used to enable/disable controls.

Parameters:
application - Current application.
object - the object on which the control is applied.
Returns:
the priority level of the application.

begin

void begin(LyApplication application,
           java.lang.String idTransaction,
           java.lang.String locationId)
Method called when a transaction begins on a location.

Parameters:
application - Current application
idTransaction - Id of the begin transaction
locationId - Id of the location

update

void update(LyApplication application,
            java.lang.String idTransaction,
            java.lang.String locationId,
            java.lang.String request)
Method called when a request is sent in a transaction for a location.

Parameters:
application - Current application
idTransaction - Id of the transaction
locationId - Id of the location
request - Sent request if the request has a string representation

beforeCommit

void beforeCommit(LyApplication application,
                  java.lang.String idTransaction,
                  java.lang.String locationId)
Method called before a transaction should be committed on a location.

Parameters:
application - Current application
idTransaction - Id of the transaction
locationId - Id of the location

afterCommit

void afterCommit(LyApplication application,
                 java.lang.String idTransaction,
                 java.lang.String locationId)
Method called after a transaction has been committed on a location.

Parameters:
application - Current application
idTransaction - Id of the transaction
locationId - Id of the location

beforeRollback

void beforeRollback(LyApplication application,
                    java.lang.String idTransaction,
                    java.lang.String locationId)
Method called before a transaction should be rollbacked on a location.

Parameters:
application - Current application
idTransaction - Id of the transaction
locationId - Id of the location

afterRollback

void afterRollback(LyApplication application,
                   java.lang.String idTransaction,
                   java.lang.String locationId)
Method called after a transaction has been rollbacked on a location.

Parameters:
application - Current application
idTransaction - Id of the transaction
locationId - Id of the location

getSubClasses

LyInfoList<LyClassInfo> getSubClasses(LyApplication application,
                                      LyObjectId objectId,
                                      LyValueSet values)
Method used by abstract classes to define which subclass has to be loaded.

Parameters:
application - current application.
objectId - the object identifier to be loaded
values - optional additional values we might know about the object : this parameter is usually null.
Returns:
the list of classes if found or null to use generic processing. Note : an empty list aborts generic processing (not found in any subclass)

getLogicalClasses

LyInfoList<LyClassInfo> getLogicalClasses(LyApplication application,
                                          LyObjectId objectId,
                                          LyValueSet values)
Method used to find logical classes of a peer object identifier.
This implementation does nothing and return null.

Parameters:
application - current application.
objectId - an object identifier of a peer object (use LyClassInfo.getObjectClass() to get the peer class : instance of LyClass)
values - optional additional values we might know about the object : this parameter is usually null.
Returns:
the list of classes if found or null to use generic processing. Note : an empty lists aborts generic processing (not found in any subclass)

getNextShort

short getNextShort(LyApplication application,
                   LyClass objectClass)
Method used to get an unique short value for the specified application.

Parameters:
application - current application
objectClass - the class for which a new object is created.
Returns:
An unique value as short for the specified application.

getNextInt

int getNextInt(LyApplication application,
               LyClass objectClass)
Method used to get an unique int value for the specified application.

Parameters:
application - current application
objectClass - the class for which a new object is created.
Returns:
An unique value as int for the specified application.

getNextLong

long getNextLong(LyApplication application,
                 LyClass objectClass)
Method used to get an unique long value for the specified application.

Parameters:
application - current application
objectClass - the class for which a new object is created.
Returns:
An unique value as long for the specified application.

getNextFloat

float getNextFloat(LyApplication application,
                   LyClass objectClass)
Method used to get an unique float value for the specified application.

Parameters:
application - current application
objectClass - the class for which a new object is created.
Returns:
An unique value as float for the specified application.

getNextDouble

double getNextDouble(LyApplication application,
                     LyClass objectClass)
Method used to get an unique double value for the specified application.

Parameters:
application - current application
objectClass - the class for which a new object is created.
Returns:
An unique value as double for the specified application.

transactionCompleted

void transactionCompleted(LyApplication application,
                          java.util.Vector<java.lang.String> idTransactions,
                          java.util.Vector<java.lang.String> locationIds)
Method called after a transaction was successfully completed (commit and notification done).

Parameters:
application - the current application
idTransactions - List of involved transaction ids
locationIds - list of involved locations ids

free

void free()
Free this behavior.
This method is provided to allow behavior to unregister itself from object sources or workspaces if needed.
It should be called only by the controller that built this behavior.


loadData

void loadData(LyApplication application,
              LyInfoList<LyClassInfo> classes)
Load data for given classes.

Parameters:
application - Application for which classes are loaded.
classes - List of classes to load.
See Also:
LyApplication.loadData(), LyClassInfo

parseExtraFromDB

LyInfoList<LyInfo> parseExtraFromDB(LyApplication application,
                                    java.lang.String prefType,
                                    java.lang.String userId)
Method for parsing extra information such as charts or preferences.

Parameters:
application - Application for which classes are loaded.
prefType - identifies the preference type : "preference", "chart" or "treemap_configuration"
userId - User id (may be null when info is shared).
Returns:
List of loaded infos.

getEventManager

LyEventManager getEventManager(LyApplication application)
Get the event manager for the given application.

Parameters:
application - the current application
Returns:
an event manager. If null is returned, default event manager will be instanciated.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com