|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Session
| Method Summary | |
|---|---|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
Changes the current users password. |
void |
clear()
When data is laoded from the DB, it is cached to prevent loading the same object repeately. |
void |
close()
Closes the session. |
User |
confirmUserAccount(java.lang.String confirmationCode)
Confirms a user account. |
double |
convert(double num,
Unit fromUnit,
Unit toUnit)
Converts a number from one unit to another unit of the same dimension. |
WorksheetAnswersUpdater |
createAnswers(Worksheet domain,
java.lang.String objectKey)
Creates a new WorksheetAnswersUpater for building a new WorksheetAnswers. |
Dimension |
createDimension(java.lang.String key,
java.lang.String displayName,
java.lang.String description,
java.lang.String referenceUnitKey,
java.lang.String referenceUnitSymbol,
java.lang.String referenceUnitDisplayName,
java.lang.String referenceUnitDescription,
Units baseUnits)
Creates a new Dimension and reference unit. |
Domain |
createDomain(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
Creates a new domain. |
EnumType |
createEnumType(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
Creates a new EnumType. |
EnumValue |
createEnumValue(EnumType enumType,
java.lang.String key,
java.lang.String displayName,
java.lang.String description)
Creates a new EnumValue for the specified EnumType. |
DomainObjectUpdater |
createObject(Domain domain,
java.lang.String objectKey)
Creates a new DomainObjectUpater for building a new DomainObject. |
PropertyUpdater |
createProperty(Domain domain,
java.lang.String key)
Gets a PropertyUpdater to create a new property. |
PropertyUpdater |
createProperty(Worksheet worksheet,
java.lang.String key)
Gets a PropertyUpdater to create a new property. |
Quantity |
createQuantity(double magnitude,
Units units)
Creates a Quantity object. |
Question |
createQuestion(Worksheet worksheet,
java.lang.String key,
java.lang.String text)
Creates a new Question on the specified worksheet. |
RoleUpdater |
createRole(java.lang.String roleName)
create a new role |
UnitUpdater |
createUnit(Dimension dim,
java.lang.String key)
Gets a UnitUpdater to create a new unit. |
UserUpdater |
createUser(java.lang.String username)
create a new user |
Worksheet |
createWorksheet(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
Creates a new worksheet. |
void |
deleteAnswers(WorksheetAnswers object)
Deletes the specified object. |
void |
deleteObject(DomainObject object)
Deletes the specified object. |
boolean |
deleteRole(Role role)
delete a role |
WorksheetAnswersUpdater |
editAnswers(WorksheetAnswers object)
Creates a new WorksheetAnswersUpater for editing an existing WorksheetAnswers. |
DimensionUpdater |
editDimension(Dimension dimension)
Gets a DimensionUpdater to edit a dimension. |
DomainUpdater |
editDomain(Domain domain)
Gets a DomainUpdater to edit a domain. |
EnumTypeUpdater |
editEnumType(EnumType enumType)
Creates an EnumTypeUpdater to edit the given EnumType |
EnumValueUpdater |
editEnumValue(EnumValue enumValue)
Creates an EnumValueUpdater to edit the given EnumValue |
DomainObjectUpdater |
editObject(DomainObject object)
Creates a new DomainObjectUpater for editing an existing DomainObject. |
PropertyUpdater |
editProperty(Property property)
Gets a PropertyUpdater to edit a property. |
QuestionUpdater |
editQuestion(Question question)
Gets a QuestionUpdater to edit a question. |
RoleUpdater |
editRole(Role role)
get the role updater for a given role |
UnitUpdater |
editUnit(Unit unit)
Gets a UnitUpdater to edit the given unit. |
UserUpdater |
editUser(User user)
get the user updater for a user |
WorksheetUpdater |
editWorksheet(Worksheet worksheet)
Gets a WorksheetUpdater to edit a worksheet. |
java.lang.Object |
evaluate(Formula formula)
Evaluates the given formula in the root environment. |
java.lang.Object |
evaluate(Formula formula,
Environment environment)
Evaluates the given formula in the given environment. |
java.lang.String |
generateUserConfirmationCode(User user)
Generates a user confirmation code that can be emailed to a user to confirm their account. |
PropertyType |
getBooleanPropertyType()
|
User |
getCurrentUser()
Gets the user with which this session is associated. |
Dimension |
getDimension(java.lang.String key)
Gets a Dimension via its unique key. |
java.util.List<Dimension> |
getDimensions()
Gets all defined quantities. |
Domain |
getDomain(java.lang.String key)
Gets a domain using its unique key. |
java.util.List<Domain> |
getDomains()
Gets a list of all the domains in the database. |
Units |
getEmptyUnits()
Gets a Units object that contains no units. |
PropertyType |
getEnumPropertyType(EnumType enumType)
|
EnumType |
getEnumType(java.lang.String key)
Looks up the EnumType with the specified key. |
java.util.List<EnumType> |
getEnumTypes()
Gets a list of all the EnumTypes in the database. |
PropertyType |
getMultivaluePropertyType(PropertyType baseType,
int minSize,
int maxSize)
|
PropertyType |
getNumberPropertyType()
|
PropertyType |
getObjectPropertyType(DomainObject root)
|
Role |
getRole(java.lang.String roleName)
Gets a role by name. |
java.util.List<Role> |
getRoles()
Gets a list of all the roles in the system. |
Environment |
getRootEnvironment()
Gets the root environment for evaluating formulas. |
PropertyType |
getStringPropertyType()
|
PropertyType |
getTimestampPropertyType()
|
Unit |
getUnit(java.lang.String key)
Gets a Unit via its unique key -- this will first look up the unit by its key, and then will look it up by its symbol second. |
java.util.List<Unit> |
getUnits(Dimension dimension)
Gets the units for the given dimension. |
User |
getUser(java.lang.String username)
get a user |
java.util.List<User> |
getUsers()
get all the users |
Worksheet |
getWorksheet(java.lang.String key)
Gets a worksheet using its unique key. |
java.util.List<Worksheet> |
getWorksheets()
Gets a list of all the worksheets in the database. |
Formula |
parseFormula(java.lang.String expression)
Parses the given expression into a formula. |
PropertyType |
parsePropertyType(java.lang.String typeDescriptor)
Parses a typeDescriptor into a PropertyType. |
Units |
parseUnits(java.lang.String units)
Parses a units expression, such as "meter^2" or "miles/gallon" |
| Method Detail |
|---|
void clear()
void close()
User getCurrentUser()
void changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
throws ValidationException
ValidationExceptionjava.util.List<Role> getRoles()
Role getRole(java.lang.String roleName)
RoleUpdater createRole(java.lang.String roleName)
throws PermissionException
PermissionException
RoleUpdater editRole(Role role)
throws PermissionException
PermissionException
boolean deleteRole(Role role)
throws PermissionException
PermissionExceptionjava.util.List<User> getUsers()
User getUser(java.lang.String username)
UserUpdater createUser(java.lang.String username)
throws PermissionException
PermissionException
UserUpdater editUser(User user)
throws PermissionException
PermissionException
java.lang.String generateUserConfirmationCode(User user)
throws PermissionException
PermissionException
User confirmUserAccount(java.lang.String confirmationCode)
throws PermissionException
PermissionExceptionjava.util.List<Dimension> getDimensions()
Dimension getDimension(java.lang.String key)
Unit getUnit(java.lang.String key)
java.util.List<Unit> getUnits(Dimension dimension)
Dimension createDimension(java.lang.String key,
java.lang.String displayName,
java.lang.String description,
java.lang.String referenceUnitKey,
java.lang.String referenceUnitSymbol,
java.lang.String referenceUnitDisplayName,
java.lang.String referenceUnitDescription,
Units baseUnits)
throws PermissionException,
ValidationException
key - The unique key that identifies this dimension, such as "length", "weight".displayName - The display name for this dimension, such as "Length", "Weight".description - A human readable description of this dimension.referenceUnitKey - The unique key that identifies the reference unit, such as "meter".referenceUnitSymbol - The short symbol for the unit, such as "m", or "s".referenceUnitDisplayName - The singular name for the reference unit, such as "Meter".referenceUnitDescription - A human readable description of the reference unit.baseUnits - If this unit can be defined in terms of other units, those units
can be specified here. For example, if defining "Enerty" and "Joule", base units
could be specified as "kg*m^2/s^2"
PermissionException - if the current user can't create dimensions
InvalidKeyException - if key or referenceUnitKey is invalid
NonUniqueKeyexception - if key or referenceUnitKey are not sufficiently unique.
InvalidDisplayNameException - if a displayName is invalid
ValidationExceptionDimensionUpdater editDimension(Dimension dimension)
UnitUpdater createUnit(Dimension dim,
java.lang.String key)
throws PermissionException
InvalidKeyException - if key is invalid
NonUniqueKeyexception - if key is not unique.
PermissionException
UnitUpdater editUnit(Unit unit)
throws PermissionException
PermissionException
double convert(double num,
Unit fromUnit,
Unit toUnit)
Units parseUnits(java.lang.String units)
Units getEmptyUnits()
Quantity createQuantity(double magnitude,
Units units)
java.util.List<EnumType> getEnumTypes()
EnumType getEnumType(java.lang.String key)
EnumType createEnumType(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
throws PermissionException,
InvalidKeyException,
NonUniqueKeyException,
InvalidDisplayNameException
PermissionException
InvalidKeyException
NonUniqueKeyException
InvalidDisplayNameException
EnumTypeUpdater editEnumType(EnumType enumType)
throws PermissionException
PermissionException
EnumValue createEnumValue(EnumType enumType,
java.lang.String key,
java.lang.String displayName,
java.lang.String description)
throws PermissionException,
InvalidKeyException,
NonUniqueKeyException,
InvalidDisplayNameException
PermissionException
InvalidKeyException
NonUniqueKeyException
InvalidDisplayNameException
EnumValueUpdater editEnumValue(EnumValue enumValue)
throws PermissionException
PermissionExceptionPropertyType getStringPropertyType()
PropertyType getNumberPropertyType()
PropertyType getBooleanPropertyType()
PropertyType getTimestampPropertyType()
PropertyType getObjectPropertyType(DomainObject root)
PropertyType getEnumPropertyType(EnumType enumType)
PropertyType getMultivaluePropertyType(PropertyType baseType,
int minSize,
int maxSize)
PropertyType parsePropertyType(java.lang.String typeDescriptor)
throws InvalidTypeDescriptorException
InvalidTypeDescriptorExceptionjava.util.List<Domain> getDomains()
Domain getDomain(java.lang.String key)
Domain createDomain(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
throws PermissionException,
ValidationException
PermissionException
ValidationException
DomainUpdater editDomain(Domain domain)
throws PermissionException
PermissionExceptionjava.util.List<Worksheet> getWorksheets()
Worksheet getWorksheet(java.lang.String key)
Worksheet createWorksheet(java.lang.String key,
java.lang.String displayName,
java.lang.String description)
throws PermissionException,
ValidationException
PermissionException
ValidationException
WorksheetUpdater editWorksheet(Worksheet worksheet)
throws PermissionException
PermissionException
PropertyUpdater createProperty(Domain domain,
java.lang.String key)
throws PermissionException,
InvalidKeyException,
NonUniqueKeyException
PermissionException
InvalidKeyException
NonUniqueKeyException
PropertyUpdater createProperty(Worksheet worksheet,
java.lang.String key)
throws PermissionException,
InvalidKeyException,
NonUniqueKeyException
PermissionException
InvalidKeyException
NonUniqueKeyException
PropertyUpdater editProperty(Property property)
throws PermissionException
PermissionException
Question createQuestion(Worksheet worksheet,
java.lang.String key,
java.lang.String text)
throws PermissionException,
InvalidKeyException
PermissionException
InvalidKeyException
QuestionUpdater editQuestion(Question question)
throws PermissionException
PermissionException
DomainObjectUpdater createObject(Domain domain,
java.lang.String objectKey)
throws PermissionException,
ValidationException
NonUniqueKeyException
InvalidKeyException
PermissionException
ValidationException
DomainObjectUpdater editObject(DomainObject object)
throws PermissionException
PermissionException
void deleteObject(DomainObject object)
throws PermissionException,
ValidationException
ValidationException - if the object has children that would be left orphaned.
PermissionException
WorksheetAnswersUpdater createAnswers(Worksheet domain,
java.lang.String objectKey)
throws PermissionException,
ValidationException
NonUniqueKeyException
InvalidKeyException
PermissionException
ValidationException
WorksheetAnswersUpdater editAnswers(WorksheetAnswers object)
throws PermissionException
PermissionException
void deleteAnswers(WorksheetAnswers object)
throws PermissionException,
ValidationException
ValidationException - if the object has children that would be left orphaned.
PermissionException
Formula parseFormula(java.lang.String expression)
throws FormulaParseException
FormulaParseExceptionEnvironment getRootEnvironment()
java.lang.Object evaluate(Formula formula,
Environment environment)
throws EvaluationException
EvaluationException
java.lang.Object evaluate(Formula formula)
throws EvaluationException
EvaluationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||