za.org.coefficient.modules.vote
Class VoteAdmin

java.lang.Object
  extended by za.org.coefficient.modules.BaseModule
      extended by za.org.coefficient.modules.BaseProjectModule
          extended by za.org.coefficient.modules.vote.VoteAdmin
All Implemented Interfaces:
CoefficientEventPublisher, ModuleLocal

public class VoteAdmin
extends BaseProjectModule


Field Summary
static java.lang.String ADD
           
static java.lang.String ADDMSG
           
static java.lang.String ADMINPAGE
           
static java.lang.String BUTTON
           
static java.lang.String CHOICE
           
static java.lang.String CHOICE1
           
static java.lang.String CHOICE2
           
static java.lang.String CLOSE
           
(package private)  java.lang.String[] commandRoles
           
static java.lang.String COMPLETEDMSG
           
static java.lang.String DATEUTIL
           
static java.lang.String DEFAULTUSER
           
 long defSpread
           
static java.lang.String DELETE
           
static java.lang.String EDIT
           
static java.lang.String ENDDAY
           
static java.lang.String ENDMONTH
           
static java.lang.String ENDYEAR
           
static java.lang.String ERROR
           
static java.lang.String ERRORPAGE
           
static java.lang.String FINISHED
           
static java.lang.String ID
           
static java.lang.String INDEXPAGE
           
static java.lang.String LISTPAGE
           
(package private)  java.lang.String[] memberRoles
           
static java.lang.String MINIMUMROLE
           
static java.lang.String MISSINGDATA
           
static java.lang.String MODULE
           
static java.lang.String MORE
           
static java.lang.String NAME
           
static java.lang.String NOPROJECT
           
static java.lang.String ON
           
static java.lang.String OP
           
static java.lang.String PERSON
           
static java.lang.String PROJECT
           
static java.lang.String QUESTION
           
static java.lang.String REOPEN
           
static java.lang.String RESET
           
static java.lang.String RESULTS
           
static java.lang.String RESULTSPAGE
           
static java.lang.String ROLES
           
static java.lang.String SEQUENCE
           
static java.lang.String STARTDAY
           
static java.lang.String STARTMONTH
           
static java.lang.String STARTYEAR
           
static java.lang.String UPDATE
           
static java.lang.String VOTE
           
static java.lang.String VOTES
           
 
Constructor Summary
VoteAdmin()
           
 
Method Summary
private  java.lang.String baseCommand(CoefficientContext ctx)
          returns null if ok otherwise it returns an error message
 java.lang.String canExecuteForRole(CoefficientContext ctx, java.lang.String methodName, Role usersHighestRole)
          This is a base implementation that will allow all methods to be invoked without regard to roles
 CoefficientContext command(CoefficientContext ctx)
          executed by the project champion.
 CoefficientContext delete(CoefficientContext ctx)
          executed by the project champion.
 CoefficientContext deleteAllForProject(CoefficientContext ctx)
           
 CoefficientContext doInitialWork(CoefficientContext ctx)
           
 java.util.List getExistingOpenPolls(Project project)
          get only open polls (where people can still vote) for this project
private  java.util.List getExistingPolls(Project project)
          get all polss for this project
 java.lang.String getFinishDay()
           
 java.lang.String getFinishMonth()
           
 java.lang.String getFinishYear()
           
 java.lang.String getMainMethod()
          This method is used to determine which method should be invoked when the module is requested without an operation.
 java.lang.String getModuleDescription()
          This method is used to find the description of the module
 java.lang.String getModuleDisplayName()
          This method is used to find the display name of the module
 java.lang.String getOp(CoefficientContext ctx)
           
 CoefficientContext list(CoefficientContext ctx)
          executed by the site members.
 CoefficientContext member(CoefficientContext ctx)
          executed by the project members
private  java.lang.Long nextSequence(java.util.List polls)
           
 java.lang.Long percent(CoefficientContext ctx)
          workflow evaluation method
 java.lang.Long percent(Project project, java.lang.String voteName, java.lang.String choice)
          workflow evaluation method
 java.util.List removePollsAlreadyVoted(java.util.List polls, java.lang.String user)
           
 java.util.List removePollsNotAllowed(CoefficientContext ctx, java.util.List polls)
           
private  void transferChoices(CoefficientContext ctx, VoteData data)
           
 CoefficientContext viewVoteSummaries(CoefficientContext ctx)
           
 
Methods inherited from class za.org.coefficient.modules.BaseProjectModule
getSummaryForProject, showSummaryForProject
 
Methods inherited from class za.org.coefficient.modules.BaseModule
createRSSItem, displayUsersData, getCoefficientContext, getModuleName, isProjectRequired, publishEvent, setCoefficientContext, showHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD

public static final java.lang.String ADD
See Also:
Constant Field Values

CLOSE

public static final java.lang.String CLOSE
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

REOPEN

public static final java.lang.String REOPEN
See Also:
Constant Field Values

RESET

public static final java.lang.String RESET
See Also:
Constant Field Values

EDIT

public static final java.lang.String EDIT
See Also:
Constant Field Values

UPDATE

public static final java.lang.String UPDATE
See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values

MODULE

public static final java.lang.String MODULE
See Also:
Constant Field Values

PROJECT

public static final java.lang.String PROJECT
See Also:
Constant Field Values

OP

public static final java.lang.String OP
See Also:
Constant Field Values

BUTTON

public static final java.lang.String BUTTON
See Also:
Constant Field Values

DATEUTIL

public static final java.lang.String DATEUTIL
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

PERSON

public static final java.lang.String PERSON
See Also:
Constant Field Values

QUESTION

public static final java.lang.String QUESTION
See Also:
Constant Field Values

SEQUENCE

public static final java.lang.String SEQUENCE
See Also:
Constant Field Values

CHOICE

public static final java.lang.String CHOICE
See Also:
Constant Field Values

CHOICE1

public static final java.lang.String CHOICE1
See Also:
Constant Field Values

CHOICE2

public static final java.lang.String CHOICE2
See Also:
Constant Field Values

STARTYEAR

public static final java.lang.String STARTYEAR
See Also:
Constant Field Values

STARTMONTH

public static final java.lang.String STARTMONTH
See Also:
Constant Field Values

STARTDAY

public static final java.lang.String STARTDAY
See Also:
Constant Field Values

ENDYEAR

public static final java.lang.String ENDYEAR
See Also:
Constant Field Values

ENDMONTH

public static final java.lang.String ENDMONTH
See Also:
Constant Field Values

ENDDAY

public static final java.lang.String ENDDAY
See Also:
Constant Field Values

ROLES

public static final java.lang.String ROLES
See Also:
Constant Field Values

MINIMUMROLE

public static final java.lang.String MINIMUMROLE
See Also:
Constant Field Values

VOTE

public static final java.lang.String VOTE
See Also:
Constant Field Values

VOTES

public static final java.lang.String VOTES
See Also:
Constant Field Values

MORE

public static final java.lang.String MORE
See Also:
Constant Field Values

ON

public static final java.lang.String ON
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values

RESULTS

public static final java.lang.String RESULTS
See Also:
Constant Field Values

DEFAULTUSER

public static final java.lang.String DEFAULTUSER
See Also:
Constant Field Values

ERRORPAGE

public static final java.lang.String ERRORPAGE
See Also:
Constant Field Values

ADMINPAGE

public static final java.lang.String ADMINPAGE
See Also:
Constant Field Values

LISTPAGE

public static final java.lang.String LISTPAGE
See Also:
Constant Field Values

INDEXPAGE

public static final java.lang.String INDEXPAGE
See Also:
Constant Field Values

RESULTSPAGE

public static final java.lang.String RESULTSPAGE
See Also:
Constant Field Values

ADDMSG

public static final java.lang.String ADDMSG
See Also:
Constant Field Values

COMPLETEDMSG

public static final java.lang.String COMPLETEDMSG
See Also:
Constant Field Values

FINISHED

public static final java.lang.String FINISHED
See Also:
Constant Field Values

NOPROJECT

public static final java.lang.String NOPROJECT
See Also:
Constant Field Values

MISSINGDATA

public static final java.lang.String MISSINGDATA
See Also:
Constant Field Values

defSpread

public final long defSpread
See Also:
Constant Field Values

commandRoles

java.lang.String[] commandRoles

memberRoles

java.lang.String[] memberRoles
Constructor Detail

VoteAdmin

public VoteAdmin()
Method Detail

getMainMethod

public java.lang.String getMainMethod()
Description copied from interface: ModuleLocal
This method is used to determine which method should be invoked when the module is requested without an operation.

Specified by:
getMainMethod in interface ModuleLocal
Specified by:
getMainMethod in class BaseModule
Returns:
name of the method that should be invoked

getModuleDescription

public java.lang.String getModuleDescription()
Description copied from interface: ModuleLocal
This method is used to find the description of the module

Specified by:
getModuleDescription in interface ModuleLocal
Specified by:
getModuleDescription in class BaseModule
Returns:
the description of the module

getModuleDisplayName

public java.lang.String getModuleDisplayName()
Description copied from interface: ModuleLocal
This method is used to find the display name of the module

Specified by:
getModuleDisplayName in interface ModuleLocal
Specified by:
getModuleDisplayName in class BaseModule
Returns:
the display name of the module

getOp

public java.lang.String getOp(CoefficientContext ctx)

getFinishDay

public java.lang.String getFinishDay()

getFinishMonth

public java.lang.String getFinishMonth()

getFinishYear

public java.lang.String getFinishYear()

canExecuteForRole

public java.lang.String canExecuteForRole(CoefficientContext ctx,
                                          java.lang.String methodName,
                                          Role usersHighestRole)
Description copied from class: BaseModule
This is a base implementation that will allow all methods to be invoked without regard to roles

Specified by:
canExecuteForRole in interface ModuleLocal
Overrides:
canExecuteForRole in class BaseModule
Returns:
null if we can execute the method an error message if not

command

public CoefficientContext command(CoefficientContext ctx)
executed by the project champion. gives full access to the poll/vote data


delete

public CoefficientContext delete(CoefficientContext ctx)
executed by the project champion.


deleteAllForProject

public CoefficientContext deleteAllForProject(CoefficientContext ctx)
Specified by:
deleteAllForProject in class BaseProjectModule

removePollsAlreadyVoted

public java.util.List removePollsAlreadyVoted(java.util.List polls,
                                              java.lang.String user)

removePollsNotAllowed

public java.util.List removePollsNotAllowed(CoefficientContext ctx,
                                            java.util.List polls)

doInitialWork

public CoefficientContext doInitialWork(CoefficientContext ctx)

list

public CoefficientContext list(CoefficientContext ctx)
executed by the site members.


member

public CoefficientContext member(CoefficientContext ctx)
executed by the project members


percent

public java.lang.Long percent(Project project,
                              java.lang.String voteName,
                              java.lang.String choice)
workflow evaluation method


percent

public java.lang.Long percent(CoefficientContext ctx)
workflow evaluation method


nextSequence

private java.lang.Long nextSequence(java.util.List polls)

getExistingOpenPolls

public java.util.List getExistingOpenPolls(Project project)
get only open polls (where people can still vote) for this project


viewVoteSummaries

public CoefficientContext viewVoteSummaries(CoefficientContext ctx)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

transferChoices

private void transferChoices(CoefficientContext ctx,
                             VoteData data)

getExistingPolls

private java.util.List getExistingPolls(Project project)
get all polss for this project


baseCommand

private java.lang.String baseCommand(CoefficientContext ctx)
returns null if ok otherwise it returns an error message



Copyright CSIR. All Rights Reserved.