public class PSGroup extends Object implements PSEntity
The public ID of a group is its name.
Modifier and Type | Field and Description |
---|---|
static Collection<String> |
RESERVED_GROUP_NAMES
An unmodifiable list of names which cannot be used as group names.
|
Constructor and Description |
---|
PSGroup()
Create a new group without any identifier.
|
PSGroup(Long id)
Create a new group from the specified ID.
|
PSGroup(String name)
Create a new group with a public identifier.
|
Modifier and Type | Method and Description |
---|---|
EntityValidity |
checkValid()
Known constraints on Member are based on SQL definition:
|
PSNotification |
getDefaultNotification()
Returns the default notification assigned to members when they join the group.
|
PSRole |
getDefaultRole()
Returns the default role assigned to members when they join the group.
|
String |
getDescription()
Returns the description of this group.
|
String |
getDetailsType()
Returns the type of membership details for this group.
|
Long |
getId() |
String |
getIdentifier()
Returns the identifier to use when connecting to PageSeeder based on the ID available.
|
String |
getKey() |
String |
getName()
Returns the full name of the group.
|
String |
getOwner()
Returns the owner of the group.
|
String |
getParentName()
Returns the name of the parent project based on the name of this group.
|
String |
getShortName()
Returns the short name of this group.
|
String |
getTemplate()
Return the template folder for customizations (aka style owner).
|
boolean |
isIdentifiable()
Determines whether the entity can be identified in PageSeeder.
|
boolean |
isValid()
Determines whether the entity is valid based on known PageSeeder constraints.
|
static boolean |
isValidGroupName(String name)
Checks if given String is a valid group name.
|
void |
setDefaultNotification(PSNotification notification)
Returns the default notification assigned to members when they join the group.
|
void |
setDefaultRole(PSRole role)
Set the default role assigned to members when they join the group.
|
void |
setDescription(String description)
Sets the descriptions of this group.
|
void |
setDetailsType(String type)
Sets type of membership details for this group.
|
void |
setId(Long id)
Sets the PageSeeder ID of this group.
|
void |
setName(String name)
Sets the full name of this group.
|
void |
setOwner(String owner)
Sets the owner of the group.
|
void |
setTemplate(String template)
Set the style owner for this group.
|
String |
toString() |
public static final Collection<String> RESERVED_GROUP_NAMES
public PSGroup()
public PSGroup(Long id)
id
- The name of the group.public PSGroup(String name)
Note: the constructor does not check that the name is valid.
name
- The name of the group.public Long getId()
public String getKey()
public boolean isIdentifiable()
PSEntity
To be identifiable, the entity must have either a private id or a public id.
If the public ID does not correspond to a single attribute in PageSeeder, then a combination of attributes may be used to determine whether it is possible to identify the entity.
isIdentifiable
in interface PSEntity
true
if the object can be identified in PageSeeder;
false
if it is not possible to identify the entity form its attributes or keys.public String getIdentifier()
PSEntity
When both the private and public identifier are available, the private identifier takes precedence over the public one.
When the public identifier cannot be used on its own, then only the private ID is returned.
In general, if the PSEntity.isIdentifiable()
method return true
, this
method should return a value. When it is not the case, it should be clearly documented.
getIdentifier
in interface PSEntity
public String getName()
public String getParentName()
The name of the parent is the part of the name that is before the last dash.
null
if the name is null
or does not include a dash.public String getShortName()
The short name is the part of the name that is after the last dash.
null
if the name is null
.public void setId(Long id)
id
- the id to setpublic void setName(String name)
name
- the name to setpublic final String getDescription()
public final void setDescription(String description)
description
- the description to setpublic final PSRole getDefaultRole()
public final PSNotification getDefaultNotification()
public final void setDefaultRole(PSRole role)
role
- the default role assigned to members when they join the group.public final void setDefaultNotification(PSNotification notification)
notification
- the default notification assigned to members when they join the group.public String getDetailsType()
public String getTemplate()
public void setDetailsType(String type)
The details type is the name of the configuration file defining the details to
use in the group. For example, account.xml
.
type
- the type of membership details for this group.public void setTemplate(String template)
The style owner is the template folder for customizations
template
- the style owner for this group.public String getOwner()
public void setOwner(String owner)
owner
- the owner to setpublic EntityValidity checkValid()
GroupName VARCHAR(60) NULL GroupDesc VARCHAR(250) NULL DetailsForm VARCHAR(150) NULL Owner VARCHAR(100) NULLDetermines whether this object is valid based on known PageSeeder constraints.
checkValid
in interface PSEntity
true
if the object is intrinsically valid based on its internal values;
false
if any of its attributes violates a PageSeeder constraint.public boolean isValid()
PSEntity
public static boolean isValidGroupName(String name)
name
- the group name to check.true
if the group name is valid;
false
otherwise.Copyright © 2016 Allette Systems. All rights reserved.