LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LySocialBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyPanelBehavior
              extended by leon.app.behavior.LyTableBehavior
                  extended by leon.app.behavior.LySocialBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyPanelBehaviorInterface, LySessionListenerInterface, LyTableBehaviorInterface, LyGetSessionInterface, LyAnswerInterface, LyQuestionAnswerInterface

public class LySocialBehavior
extends LyTableBehavior
implements LySessionListenerInterface, LyQuestionAnswerInterface

This class implements the default behavior for a social controller.


Field Summary
static java.lang.String PHOTO
           
 
Fields inherited from class leon.app.behavior.LyTableBehavior
__VERSION, MAX_ROW_HEIGHT
 
Fields inherited from interface leon.view.setinterface.LyQuestionAnswerInterface
__VERSION
 
Constructor Summary
LySocialBehavior()
          Default constructor.
 
Method Summary
 void free()
          Free this behavior.
 LyWorkSpace getContent(LyTableController tableController, LyWorkSpace context)
          Gets the content of the table corresponding of the given context.
 LyInfoDataList<LyAction,LyClassInfo> getPopupMenuActions(LyPanelController panelController, LyInfoDataList<LyAction,LyClassInfo> actions, boolean selection)
          Gets the ordered list of pairs of (action, classInfo) to display in a popup menu.
 java.lang.String getRowImage(LySimpleTableController tableController, LyObject user)
          Gets the row image of the given table object used on display list mode.
 java.lang.String getRowImage(LySimpleTableController tableController, LyObject user, boolean withDownload)
          Gets the row image of the given table object used on display list mode.
 boolean handleDemand(LyController controller, LyDemand demand)
          Method invoked when a demand is sent to this listener.
 void init(LyController controller)
          Initializes information used within this behavior and is called immediately after its construction.
static java.lang.String loadImage(LyApplication application, java.lang.String userId)
          Load images from database.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Answer to a askQuestion request.
static void saveImage(LyApplication application, java.lang.String userId, java.lang.String imageFilePath)
          Save images from database.
 void sessionAdded(LyApplication application, LyDataSession session)
          Method called when a session is added to the application.
 void sessionLoggedIn(LyApplication application, LyDataSession session, LyObject user)
          Method called when a user logged in a session.
 void sessionRemoved(LyApplication application, LyDataSession session)
          Method called when a session is removed from the application.
 boolean startAction(LyAreaController areaController, LyAction action)
          Starts an action for the given controller.
 
Methods inherited from class leon.app.behavior.LyTableBehavior
buildRowItem, completeRow, dragFinished, dragStart, drop, enableGroupBy, getCellImage, getCellLabel, getCellLabel, getCellObjectId, getChooseColumnsFieldInfos, getColumnWidth, getDefaultCriterion, getDependsFieldInfos, getDisplayListFirstImage, getFields, getFooterLabel, getGroupColor, getGroupLabel, getHeaderLabel, getHeaderTooltip, getIndex, getLabel, getLoadedFieldInfos, getRowColor, getShortLabel, getStatusImage, getStatusTooltip, selectionChanged, updateCell, updateRowItem, validateSort
 
Methods inherited from class leon.app.behavior.LyPanelBehavior
completePopupMenu, getTitle, needRefresh, validateFilter
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, reset
 
Methods inherited from class leon.app.behavior.LyBehavior
getSession
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyPanelBehaviorInterface
completePopupMenu, needRefresh, validateFilter
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset
 

Field Detail

PHOTO

public static final java.lang.String PHOTO
See Also:
Constant Field Values
Constructor Detail

LySocialBehavior

public LySocialBehavior()
Default constructor.

Method Detail

getContent

public LyWorkSpace getContent(LyTableController tableController,
                              LyWorkSpace context)
Gets the content of the table corresponding of the given context.
The workspace must be dynamic for dynamic table updates.
If the returned workspace is null, the controller computes the content itself.
The default implementation does nothing and returns null.

Specified by:
getContent in interface LyTableBehaviorInterface
Overrides:
getContent in class LyTableBehavior
Parameters:
tableController - Table controller that requires the content.
context - Context for which the content is required.
Returns:
the table content.

startAction

public boolean startAction(LyAreaController areaController,
                           LyAction action)
Description copied from class: LyActionBehavior
Starts an action for the given controller. This method is the right place to allocate specific resources requiered for the given action. The default implementation does nothing and returns true.

Specified by:
startAction in interface LyActionBehaviorInterface
Overrides:
startAction in class LyActionBehavior
Parameters:
areaController - the current LyAreaController instance
action - the action that will be executed
Returns:
true

handleDemand

public boolean handleDemand(LyController controller,
                            LyDemand demand)
Description copied from class: LyBehavior
Method invoked when a demand is sent to this listener.
The default implementation does nothing and return false.

Specified by:
handleDemand in interface LyBehaviorInterface
Overrides:
handleDemand in class LyBehavior
Parameters:
controller - controller that routed the demand.
demand - demand parameters sent by the view component.
Returns:
Return true if the demand was handled, false otherwise. If false, the demand is transmitted to the controller to try to handle it.

init

public void init(LyController controller)
Initializes information used within this behavior and is called immediately after its construction.
The default implementation does nothing.

Specified by:
init in interface LyBehaviorInterface
Overrides:
init in class LyBehavior
Parameters:
controller - The controller that requested the creation of this behavior.

free

public 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.
The default implementation does nothing.

Specified by:
free in interface LyBehaviorInterface
Overrides:
free in class LyBehavior

sessionAdded

public void sessionAdded(LyApplication application,
                         LyDataSession session)
Method called when a session is added to the application.
This implementation does nothing.

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

sessionLoggedIn

public void sessionLoggedIn(LyApplication application,
                            LyDataSession session,
                            LyObject user)
Method called when a user logged in a session.

Specified by:
sessionLoggedIn in interface LySessionListenerInterface
Parameters:
application - Application in which a session is added.
session - Session added to the application.
user - User that logged in.

sessionRemoved

public void sessionRemoved(LyApplication application,
                           LyDataSession session)
Method called when a session is removed from the application.
This implementation does nothing.

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

getPopupMenuActions

public LyInfoDataList<LyAction,LyClassInfo> getPopupMenuActions(LyPanelController panelController,
                                                                LyInfoDataList<LyAction,LyClassInfo> actions,
                                                                boolean selection)
Gets the ordered list of pairs of (action, classInfo) to display in a popup menu.
The default implementation does nothing and returns the given actions data list.

Specified by:
getPopupMenuActions in interface LyPanelBehaviorInterface
Overrides:
getPopupMenuActions in class LyPanelBehavior
Parameters:
panelController - Panel controller that displays the menu.
actions - List of pairs (action, classInfo) that the controller is about to present in popup menu on current selection.
selection - Boolean indicating if popup menu is asked or not on selection.
Returns:
List of pairs (action, classInfo) that the controller will display in menu.

getRowImage

public java.lang.String getRowImage(LySimpleTableController tableController,
                                    LyObject user)
Gets the row image of the given table object used on display list mode.

Specified by:
getRowImage in interface LyTableBehaviorInterface
Overrides:
getRowImage in class LyTableBehavior
Parameters:
tableController - Table controller that requires the row image.
object - Object to which the row image is associated.
Returns:
Path to the image file or the name of an image resource if found, null otherwise.

getRowImage

public java.lang.String getRowImage(LySimpleTableController tableController,
                                    LyObject user,
                                    boolean withDownload)
Gets the row image of the given table object used on display list mode.

Parameters:
tableController - Table controller that requires the row image.
object - Object to which the row image is associated.
Returns:
Path to the image file or the name of an image resource if found, null otherwise.

saveImage

public static void saveImage(LyApplication application,
                             java.lang.String userId,
                             java.lang.String imageFilePath)
Save images from database.

Parameters:
application - Application on which extra info is saved.
type - Extra info type.
id - Id of saved info.

loadImage

public static java.lang.String loadImage(LyApplication application,
                                         java.lang.String userId)
Load images from database.

Parameters:
application - Application on which extra info is saved.
type - Extra info type.
id - Id of saved info.
Returns:
Info that was saved.

questionAnswer

public void questionAnswer(boolean result,
                           java.lang.Object clientData)
Description copied from interface: LyQuestionAnswerInterface
Answer to a askQuestion request.

Specified by:
questionAnswer in interface LyQuestionAnswerInterface
Parameters:
result - true if the user has clicked on Yes or Ok
See Also:
LyQuestionAnswerInterface.questionAnswer(boolean, Object)

(c) January 2013 - W4 S.A.

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