pt.digitalis.dif.controller.objects
Class DIFContext

java.lang.Object
  extended by pt.digitalis.dif.controller.objects.DIFContext
All Implemented Interfaces:
IDIFContext

public class DIFContext
extends Object
implements IDIFContext

This class is the base class for the DIF execution context.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
2007/03/16

Field Summary
protected  ViewObject theView
          The ViewObject.
 
Constructor Summary
DIFContext()
           
 
Method Summary
 void addResultMessage(String type, String title, String description)
          Adds a result message to the stage result
 void addResultMessage(String type, String title, String description, boolean popupMode)
          Adds a result message to the stage result
 void addResultMessage(String type, String title, String description, String mode)
          Adds a result message to the stage result.
 void addStageResult(String resultName, Object resultValue)
          Add a new result to the stage results.
 String getLanguage()
           
 IDIFRequest getRequest()
          Inspector for the DIFRequest object
 ResultMessage getResultMessage()
          Inspector for the 'resultMessage' attribute.
 IDIFSession getSession()
          Inspector for the session object.
 String getStage()
          Inspector for the current stage
 Map<String,Object> getStageResults()
          Inspector for the stage results.
 Map<String,Object> getTemporaryAttributes()
          Inspector for the 'temporaryAttributes' attribute.
 ViewObject getView()
          Inspector for the view.
 void handleRedirection()
          This method sets the current stage equal to the redirection stage.
 boolean hasRedirection()
          Inspector for the redirection flag.
 void redirectTo(String newStage)
          Sets the redirection stage.
 void redirectTo(String newStage, boolean allowRedirectToSameStage)
          Sets the redirection stage.
 void redirectTo(String newStage, Map<String,Object> redirectionParameters)
          Sets the redirection stage.
 void redirectTo(String newStage, Map<String,Object> redirectionParameters, boolean allowRedirectToSameStage)
          Sets the redirection stage.
 void redirectTo(String newStage, String redirectionParameters)
          Sets the redirection stage.
 void redirectTo(String newStage, String redirectionParameters, boolean allowRedirectToSameStage)
          Sets the redirection stage.
 void reportIssue(String uID, IssueType type, String issueDescription)
          Report an issue to the IUsageIssuesManager
 void reportIssue(String uID, IssueType type, String issueDescription, Exception exception)
          Report an issue to the IUsageIssuesManager
 void reportIssue(String uID, IssueType type, String issueDescription, Exception exception, boolean showStackTrace)
          Report an issue to the IUsageIssuesManager
 void reportIssue(UsageIssue issue)
          Report an issue to the IUsageIssuesManager
 void setRequest(IDIFRequest difRequest)
          Modifier for the DIFRequest Object
 void setSession(IDIFSession session)
          Modifier for the session object.
 void setStage(String stage)
          Modifier for the current stage
 void setStageResults(Map<String,Object> results)
          Modifier for the stage results.
 void setTemporaryAttributes(Map<String,Object> temporaryAttributes)
          Modifier for the 'temporaryAttributes' attribute.
 void setView(ViewObject newView)
          Modifier for the view.
 String toString()
          Prints the context information on an human-readable form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theView

protected ViewObject theView
The ViewObject.

Constructor Detail

DIFContext

public DIFContext()
Method Detail

addResultMessage

public void addResultMessage(String type,
                             String title,
                             String description)
Description copied from interface: IDIFContext
Adds a result message to the stage result

Specified by:
addResultMessage in interface IDIFContext
Parameters:
type - the message type
title - the title of the message
description - the description of the message
See Also:
IDIFContext.addResultMessage(java.lang.String, java.lang.String, java.lang.String)

addResultMessage

public void addResultMessage(String type,
                             String title,
                             String description,
                             boolean popupMode)
Description copied from interface: IDIFContext
Adds a result message to the stage result

Specified by:
addResultMessage in interface IDIFContext
Parameters:
type - the message type
title - the title of the message
description - the description of the message
popupMode - if the message should be showed in popup mode (in a dialog)
See Also:
IDIFContext.addResultMessage(java.lang.String, java.lang.String, java.lang.String, boolean)

addResultMessage

public void addResultMessage(String type,
                             String title,
                             String description,
                             String mode)
Description copied from interface: IDIFContext
Adds a result message to the stage result.

Specified by:
addResultMessage in interface IDIFContext
Parameters:
type - the message type
title - the title of the message
description - the description of the message
mode - the mode
See Also:
IDIFContext.addResultMessage(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

addStageResult

public void addStageResult(String resultName,
                           Object resultValue)
Description copied from interface: IDIFContext
Add a new result to the stage results.

Specified by:
addStageResult in interface IDIFContext
Parameters:
resultName - the name of the result
resultValue - the result value
See Also:
IDIFContext.addStageResult(String, Object)

getLanguage

public String getLanguage()
Specified by:
getLanguage in interface IDIFContext
Returns:
the language of the current context
See Also:
IDIFContext.getLanguage()

getRequest

public IDIFRequest getRequest()
Description copied from interface: IDIFContext
Inspector for the DIFRequest object

Specified by:
getRequest in interface IDIFContext
Returns:
the IDIFRequest
See Also:
IDIFContext.getRequest()

getResultMessage

public ResultMessage getResultMessage()
Description copied from interface: IDIFContext
Inspector for the 'resultMessage' attribute.

Specified by:
getResultMessage in interface IDIFContext
Returns:
the resultMessage value
See Also:
IDIFContext.getResultMessage()

getSession

public IDIFSession getSession()
Description copied from interface: IDIFContext
Inspector for the session object.

Specified by:
getSession in interface IDIFContext
Returns:
the session
See Also:
IDIFContext.getSession()

getStage

public String getStage()
Description copied from interface: IDIFContext
Inspector for the current stage

Specified by:
getStage in interface IDIFContext
Returns:
the current stage
See Also:
IDIFContext.getStage()

getStageResults

public final Map<String,Object> getStageResults()
Description copied from interface: IDIFContext
Inspector for the stage results.

Specified by:
getStageResults in interface IDIFContext
Returns:
the stage results map
See Also:
IDIFContext.getStageResults()

getTemporaryAttributes

public Map<String,Object> getTemporaryAttributes()
Description copied from interface: IDIFContext
Inspector for the 'temporaryAttributes' attribute.

Specified by:
getTemporaryAttributes in interface IDIFContext
Returns:
the temporaryAttributes value
See Also:
IDIFContext.getTemporaryAttributes()

getView

public ViewObject getView()
Description copied from interface: IDIFContext
Inspector for the view.

Specified by:
getView in interface IDIFContext
Returns:
the ViewObject.
See Also:
IDIFContext.getView()

handleRedirection

public void handleRedirection()
This method sets the current stage equal to the redirection stage. The redirection stage is set to null and a the redirection flag is set to T. The stage results are reset.

Specified by:
handleRedirection in interface IDIFContext
See Also:
IDIFContext.handleRedirection()

hasRedirection

public boolean hasRedirection()
Description copied from interface: IDIFContext
Inspector for the redirection flag.

Specified by:
hasRedirection in interface IDIFContext
Returns:
T if redirection is scheduled, F otherwise
See Also:
IDIFContext.hasRedirection()

redirectTo

public void redirectTo(String newStage)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
See Also:
IDIFContext.redirectTo(java.lang.String)

redirectTo

public void redirectTo(String newStage,
                       boolean allowRedirectToSameStage)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
allowRedirectToSameStage - if T allows redirect to same stage to be set
See Also:
IDIFContext.redirectTo(java.lang.String, boolean)

redirectTo

public void redirectTo(String newStage,
                       Map<String,Object> redirectionParameters)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
redirectionParameters - the redirection parameters
See Also:
IDIFContext.redirectTo(java.lang.String, java.util.Map)

redirectTo

public void redirectTo(String newStage,
                       Map<String,Object> redirectionParameters,
                       boolean allowRedirectToSameStage)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
redirectionParameters - the redirection parameters
allowRedirectToSameStage - if T allows redirect to same stage to be set
See Also:
IDIFContext.redirectTo(java.lang.String, java.util.Map, boolean)

redirectTo

public void redirectTo(String newStage,
                       String redirectionParameters)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
redirectionParameters - the redirection parameters
See Also:
IDIFContext.redirectTo(java.lang.String, java.lang.String)

redirectTo

public void redirectTo(String newStage,
                       String redirectionParameters,
                       boolean allowRedirectToSameStage)
Description copied from interface: IDIFContext
Sets the redirection stage.

Specified by:
redirectTo in interface IDIFContext
Parameters:
newStage - the stage to redirect to
redirectionParameters - the redirection parameters
allowRedirectToSameStage - if T allows redirect to same stage to be set
See Also:
IDIFContext.redirectTo(java.lang.String, java.lang.String, boolean)

reportIssue

public void reportIssue(String uID,
                        IssueType type,
                        String issueDescription)
Description copied from interface: IDIFContext
Report an issue to the IUsageIssuesManager

Specified by:
reportIssue in interface IDIFContext
Parameters:
uID - the unique identifier for this contribution. for recurring errors not to be added repeatedly
type - the issue type
See Also:
IDIFContext.reportIssue(java.lang.String, pt.digitalis.dif.dem.objects.issues.IssueType, java.lang.String)

reportIssue

public void reportIssue(String uID,
                        IssueType type,
                        String issueDescription,
                        Exception exception)
Description copied from interface: IDIFContext
Report an issue to the IUsageIssuesManager

Specified by:
reportIssue in interface IDIFContext
Parameters:
uID - the unique identifier for this contribution. for recurring errors not to be added repeatedly
type - the issue type
exception - the raised exception
See Also:
IDIFContext.reportIssue(java.lang.String, pt.digitalis.dif.dem.objects.issues.IssueType, java.lang.String, java.lang.Exception)

reportIssue

public void reportIssue(String uID,
                        IssueType type,
                        String issueDescription,
                        Exception exception,
                        boolean showStackTrace)
Description copied from interface: IDIFContext
Report an issue to the IUsageIssuesManager

Specified by:
reportIssue in interface IDIFContext
Parameters:
uID - the unique identifier for this contribution. for recurring errors not to be added repeatedly
type - the issue type
exception - the raised exception
showStackTrace - if the stack trace should be generated and attached to the issue description
See Also:
IDIFContext.reportIssue(java.lang.String, pt.digitalis.dif.dem.objects.issues.IssueType, java.lang.String, java.lang.Exception, boolean)

reportIssue

public void reportIssue(UsageIssue issue)
Description copied from interface: IDIFContext
Report an issue to the IUsageIssuesManager

Specified by:
reportIssue in interface IDIFContext
Parameters:
issue - the issue descriptor
See Also:
IDIFContext.reportIssue(pt.digitalis.dif.dem.objects.issues.UsageIssue)

setRequest

public void setRequest(IDIFRequest difRequest)
Description copied from interface: IDIFContext
Modifier for the DIFRequest Object

Specified by:
setRequest in interface IDIFContext
Parameters:
difRequest - the Original DifRequest
See Also:
IDIFContext.setRequest(pt.digitalis.dif.controller.interfaces.IDIFRequest)

setSession

public void setSession(IDIFSession session)
Description copied from interface: IDIFContext
Modifier for the session object.

Specified by:
setSession in interface IDIFContext
Parameters:
session - the session to set
See Also:
IDIFContext.setSession(IDIFSession)

setStage

public void setStage(String stage)
Description copied from interface: IDIFContext
Modifier for the current stage

Specified by:
setStage in interface IDIFContext
Parameters:
stage - the stage to set
See Also:
IDIFContext.setStage(String)

setStageResults

public final void setStageResults(Map<String,Object> results)
Description copied from interface: IDIFContext
Modifier for the stage results.

Specified by:
setStageResults in interface IDIFContext
Parameters:
results - the results to set
See Also:
IDIFContext.setStageResults(Map)

setTemporaryAttributes

public void setTemporaryAttributes(Map<String,Object> temporaryAttributes)
Description copied from interface: IDIFContext
Modifier for the 'temporaryAttributes' attribute.

Specified by:
setTemporaryAttributes in interface IDIFContext
Parameters:
temporaryAttributes - the new temporaryAttributes value to set
See Also:
IDIFContext.setTemporaryAttributes(java.util.Map)

setView

public void setView(ViewObject newView)
Description copied from interface: IDIFContext
Modifier for the view.

Specified by:
setView in interface IDIFContext
Parameters:
newView - the ViewObject to set
See Also:
IDIFContext.setView(ViewObject)

toString

public String toString()
Prints the context information on an human-readable form. Overrides java.lang.Object#toString().

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.