atg.svc.repository.beans.methods
Class SolutionMethods

java.lang.Object
  extended by atg.svc.repository.beans.methods.BaseMethods
      extended by atg.svc.repository.beans.methods.SolutionMethods

public class SolutionMethods
extends BaseMethods

Defines extension methods for the Solution object.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
SolutionMethods()
           
 
Method Summary
 void addTopic(java.lang.String pTopicId, atg.svc.repository.beans.Solution pSolution)
          Adds a topic to a solution given the id of a topic.
 java.lang.String getDisplayId(atg.svc.repository.beans.Solution pSolution)
          Gets the display id of the solution.
 java.lang.String getDisplayTitle(atg.svc.repository.beans.Solution pSolution)
          Gets the title for the solution for display.
 java.util.List getExternallyVisiblePropertyFields(atg.svc.repository.beans.Solution pSolution)
          Gets the solution property fields that are visible to everyone external.
 java.util.List getExternallyVisibleStatementFields(atg.svc.repository.beans.Solution pSolution)
          Gets the solution statement fields that are visible to everyone external.
 java.lang.Object getFieldValue(java.lang.String pPropertyName, atg.svc.repository.beans.Solution pSolution)
          Gets the value of a Solution property.
 boolean getIsEditable(atg.svc.repository.beans.Solution pSolution)
          Returns true if this solution is editable for the current user.
 boolean getIsExternallyVisibleToEveryone(atg.svc.repository.beans.Solution pSolution)
          Returns true if this solution is visible for everyone external.
 boolean getIsExternallyVisibleToSegment(java.lang.String pSegmentName, atg.svc.repository.beans.Solution pSolution)
          Returns true if this solution is visible for the given external segment.
 boolean getIsVisible(atg.svc.repository.beans.Solution pSolution)
          Returns true if this solution is visible for the current user.
 java.lang.String getTitle(atg.svc.repository.beans.Solution pSolution)
          Gets the computed title for the given Solution.
 java.util.Set getTopics(atg.svc.repository.beans.Solution pSolution)
          Gets a set of Topic based on the Solution topicIds property.
 java.lang.Integer getVersion(atg.svc.repository.beans.Solution pSolution)
          Gets the version number of the last checked-in version for the solution.
 java.util.List getVisibleFields(atg.svc.repository.beans.Solution pSolution)
          Gets the list of SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.
 java.util.List getVisiblePropertyFields(atg.svc.repository.beans.Solution pSolution)
          Gets the list of property SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.
 java.util.List getVisibleStatementFields(atg.svc.repository.beans.Solution pSolution)
          Gets the list of content SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.
 void setFieldValue(java.lang.String pPropertyName, java.lang.Object pValue, atg.svc.repository.beans.Solution pSolution)
          Sets a value on the given property for the solution.
 void setInternalAudience(java.lang.String[] pOrgValueIds, atg.svc.repository.beans.Solution pSolution)
          Sets the value of the solution internal audience property given an array or OrganizationValue repository ids.
 void setOwningGroup(java.lang.String pOrgValueId, atg.svc.repository.beans.Solution pSolution)
          Sets the Owning Group on the solution given the id of the Organization.
 void setSolutionClass(java.lang.String pSolutionClassId, atg.svc.repository.beans.Solution pSolution)
          Sets the solution class on the solution given the id of the solution class.
 void setTitle(java.lang.String pTitle, atg.svc.repository.beans.Solution pSolution)
          Sets the title for the given Solution.
 void setTopics(java.util.Set pTopics, atg.svc.repository.beans.Solution pSolution)
          Sets the topis for the given Solution.
 void updateTopicIds(java.util.Set pTopicIds, atg.svc.repository.beans.Solution pSolution)
          Adds/Removes topics to/from a solution given an array of topic ids.
 void validate(atg.svc.repository.beans.Solution pSolution)
          Validates the fields on a Solution.
 
Methods inherited from class atg.svc.repository.beans.methods.BaseMethods
getServiceFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

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

SolutionMethods

public SolutionMethods()
Method Detail

getIsVisible

public boolean getIsVisible(atg.svc.repository.beans.Solution pSolution)
Returns true if this solution is visible for the current user.

Parameters:
pSolution - The solution to check.
Returns:
True if this solution is visible for the current user.

getIsExternallyVisibleToEveryone

public boolean getIsExternallyVisibleToEveryone(atg.svc.repository.beans.Solution pSolution)
Returns true if this solution is visible for everyone external.

Parameters:
pSolution - The solution to check.
Returns:
True if this solution is visible for everyone external.

getIsExternallyVisibleToSegment

public boolean getIsExternallyVisibleToSegment(java.lang.String pSegmentName,
                                               atg.svc.repository.beans.Solution pSolution)
Returns true if this solution is visible for the given external segment.

Parameters:
pSegmentName - The name of the segment.
pSolution - The solution to check.
Returns:
True if this solution is visible for everyone external.

getIsEditable

public boolean getIsEditable(atg.svc.repository.beans.Solution pSolution)
Returns true if this solution is editable for the current user.

Parameters:
pSolution - The solution to check.
Returns:
True if this solution is editable for the current user.

getVersion

public java.lang.Integer getVersion(atg.svc.repository.beans.Solution pSolution)
Gets the version number of the last checked-in version for the solution.

Parameters:
pSolution -
Returns:
The version id of the version checked into the mainline. If no solution version, returns null

setFieldValue

public void setFieldValue(java.lang.String pPropertyName,
                          java.lang.Object pValue,
                          atg.svc.repository.beans.Solution pSolution)
                   throws atg.beans.PropertyNotFoundException
Sets a value on the given property for the solution.

Parameters:
pPropertyName - The name of the property to set.
pValue - The value of the property to set.
pSolution - The solution to set the value on.
Throws:
atg.beans.PropertyNotFoundException
See Also:
DynamicBeans

getFieldValue

public java.lang.Object getFieldValue(java.lang.String pPropertyName,
                                      atg.svc.repository.beans.Solution pSolution)
                               throws atg.beans.PropertyNotFoundException
Gets the value of a Solution property.

Parameters:
pPropertyName - The name of the property.
pSolution - The Solution to get the property from.
Returns:
The value of the property.
Throws:
atg.beans.PropertyNotFoundException - If the property is not found for the given name.

getTitle

public java.lang.String getTitle(atg.svc.repository.beans.Solution pSolution)
Gets the computed title for the given Solution.

Parameters:
pSolution - The Solution to get the title for.
Returns:
The computed title.

setTitle

public void setTitle(java.lang.String pTitle,
                     atg.svc.repository.beans.Solution pSolution)
Sets the title for the given Solution. All leading/trailing/repetitive whitespace will be removed.

Parameters:
pTitle - The title to set.
pSolution - The Solution to set the title on.

getDisplayTitle

public java.lang.String getDisplayTitle(atg.svc.repository.beans.Solution pSolution)
Gets the title for the solution for display. If the title is longer than the configured maximum display length the title is truncated and an ellipsis (or other configured string) is appended to the title.

Parameters:
pSolution - The Solution to get the title for.
Returns:
The title string.

getTopics

public java.util.Set getTopics(atg.svc.repository.beans.Solution pSolution)
Gets a set of Topic based on the Solution topicIds property. If a topic lookup fails, the topic is omitted from the returned topics.

Parameters:
pSolution - The Solution to get the topics for.
Returns:
The set of topics

setTopics

public void setTopics(java.util.Set pTopics,
                      atg.svc.repository.beans.Solution pSolution)
Sets the topis for the given Solution. Topics are stored in the solution by topic id (property 'topicIds'). This method converts Topic r2j objects to topic ids and sets the topicIds property.

Parameters:
pTopics - Set of Topic. The title to set.
pSolution - The Solution to set the topics on.

setSolutionClass

public void setSolutionClass(java.lang.String pSolutionClassId,
                             atg.svc.repository.beans.Solution pSolution)
                      throws ObjectNotFoundException
Sets the solution class on the solution given the id of the solution class.

Parameters:
pSolutionClassId - The id of the solution class.
pSolution - The solution bean.
Throws:
ObjectNotFoundException - If the solution class is not found in the repository by the given id.

setOwningGroup

public void setOwningGroup(java.lang.String pOrgValueId,
                           atg.svc.repository.beans.Solution pSolution)
                    throws ObjectNotFoundException
Sets the Owning Group on the solution given the id of the Organization.

Parameters:
pOrgValueId - The id of the organization to set as the owning group.
pSolution - The solution bean.
Throws:
ObjectNotFoundException - If the OrganizationValue is not found.

setInternalAudience

public void setInternalAudience(java.lang.String[] pOrgValueIds,
                                atg.svc.repository.beans.Solution pSolution)
                         throws ObjectNotFoundException
Sets the value of the solution internal audience property given an array or OrganizationValue repository ids. If the given array is null or empty the internal audience property will be cleared.

Parameters:
pSolution - The solution to set the internal audience property on.
pOrgValueIds - The String array of OrganizationValue repository ids.
Throws:
ObjectNotFoundException - If an OrganizationValue cannot be found by id.

addTopic

public void addTopic(java.lang.String pTopicId,
                     atg.svc.repository.beans.Solution pSolution)
              throws ObjectNotFoundException
Adds a topic to a solution given the id of a topic.

Parameters:
pTopicId - The repository id of the topic to add.
pSolution - The Solution to add the topic to.
Throws:
ObjectNotFoundException - If the topic could not be found.

updateTopicIds

public void updateTopicIds(java.util.Set pTopicIds,
                           atg.svc.repository.beans.Solution pSolution)
                    throws ObjectNotFoundException
Adds/Removes topics to/from a solution given an array of topic ids. Removes all topics if pTopicIds is null or empty.

Parameters:
pTopicIds - An array of the repository id of the topics.
pSolution - The Solution to add the topic to.
Throws:
ObjectNotFoundException - If the topic could not be found.

getVisibleFields

public java.util.List getVisibleFields(atg.svc.repository.beans.Solution pSolution)
Gets the list of SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.

Parameters:
pSolution - The solution to get the fields from.
Returns:
The List of SolutionField objects ordered according to the SolutionClass.

getVisibleStatementFields

public java.util.List getVisibleStatementFields(atg.svc.repository.beans.Solution pSolution)
Gets the list of content SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.

Parameters:
pSolution - The Solution to get the content fields from.
Returns:
The ordered list of content SolutionField objects.

getVisiblePropertyFields

public java.util.List getVisiblePropertyFields(atg.svc.repository.beans.Solution pSolution)
Gets the list of property SolutionField objects that belong to the solution ordered by the fields in the SolutionClass that are visible to the current user.

Parameters:
pSolution - The Solution to get the property fields from.
Returns:
The ordered list of property SolutionField objects.

getExternallyVisibleStatementFields

public java.util.List getExternallyVisibleStatementFields(atg.svc.repository.beans.Solution pSolution)
Gets the solution statement fields that are visible to everyone external.

Parameters:
pSolution - The Solution to get the statement fields from.
Returns:
The List of SolutionField objects that are viewable for all external users.

getExternallyVisiblePropertyFields

public java.util.List getExternallyVisiblePropertyFields(atg.svc.repository.beans.Solution pSolution)
Gets the solution property fields that are visible to everyone external.

Parameters:
pSolution - The SolutionClass to get the property fields from.
Returns:
The List of SolutionField objects that are viewable for all external users.

validate

public void validate(atg.svc.repository.beans.Solution pSolution)
              throws atg.svc.validation.ValidationException
Validates the fields on a Solution.

Parameters:
pSolution - The Solution to validate the fields on.
Throws:
atg.svc.validation.ValidationException - If any of the fields fail the validation tests.

getDisplayId

public java.lang.String getDisplayId(atg.svc.repository.beans.Solution pSolution)
Gets the display id of the solution. The display id is the legacy id unless it is empty else it's the repository id.

Parameters:
pSolution - The solution to get the id from.
Returns:
The display id string.