atg.svc.repository.service
Class SolutionService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.repository.service.BaseService
              extended by atg.svc.repository.service.KnowledgeBaseService
                  extended by atg.svc.repository.service.SolutionService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

@Service(requiredProperties={"attachmentUtils","segmentService","siteConfiguration","solutionMetadataService","solutionRedirectService","solutionScoringService","solutionScoringUtils","solutionValidationUtils","topicService","transactionalFragmentService","userOptionService","versionedKnowledgeHomesFactory","viewedAnswerService"})
public class SolutionService
extends KnowledgeBaseService

Business methods for the Solution object.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String EMPTY_STRING
           
static java.lang.String[] EMPTY_STRING_ARRAY
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SolutionService()
           
 
Method Summary
 void addTopic(java.lang.String pTopicId, atg.svc.repository.beans.Solution pSolution)
          Adds a topic to a solution.
 void clearSolutionExternalAudience(atg.svc.repository.beans.Solution pSolution)
          Clears the all of the segments from the Solution's external audience property.
 java.lang.String computeTitle(atg.svc.repository.beans.Solution pSolution)
          Computes the title for the given Solution.
 atg.svc.repository.beans.Solution copySolution(atg.svc.repository.beans.Solution pSrcSolution)
          Copies the data from the given Solution into a brand new Solution.
 atg.svc.repository.beans.Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Creates a new solution repository bean object from the given solution class.
 atg.svc.repository.beans.Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass, SolutionHomes pHomes)
          Creates a new Solution object from the given SolutionClass object from the given SolutionHomes.
 atg.svc.repository.beans.Solution createSolution(java.lang.String pSolutionClassId)
          Creates a new solution repository bean object from the given solution class id.
 atg.svc.repository.beans.Solution createSolution(java.lang.String pSolutionClassId, SolutionHomes pHomes)
          Creates a new Solution object from the given SolutionClass object from the given SolutionHomes.
 atg.svc.repository.beans.Solution createSolutionBean(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Creates a Solution in-memory bean that is not connected to the repository.
 atg.svc.repository.beans.Solution createSolutionBean(java.lang.String pSolutionClassId)
          Creates a Solution in-memory bean that is not connected to the repository.
 SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Creates a new SolutionFieldValue repository impl.
 SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinitionType pType)
          Creates a new SolutionFieldValue repository impl with the given field type..
 SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinitionType pType, SolutionHomes pHomes)
          Creates a new SolutionFieldValue impl from the given SolutionHomes (bean or repository).
 SolutionFieldValue createSolutionFieldValue(SolutionField pField)
          Creates a SolutionFieldValue for the given SolutionField.
protected  java.util.List createSolutionReferences(atg.svc.repository.beans.Solution pSolution)
          Create the initial Solution references.
 SolutionStatus createSolutionStatus()
          Creates a new solution status bean.
 void deleteSolution(java.lang.String pSolutionId)
          Deletes a solution and all of its fields given the solution id.
 void deleteSolutionStatus(java.lang.String pSolutionStatusId)
          Deletes a solution status given it's solution status id.
 atg.svc.repository.beans.Solution editSolution(java.lang.String pSolutionId)
          Gets an editable Solution bean given its repository id.
 SolutionStatus editSolutionStatus(java.lang.String pSolutionStatusId)
          Gets an editable version of a solution status given the solution status' id.
 atg.svc.repository.service.util.AttachmentUtils getAttachmentUtils()
           
 atg.svc.agent.events.EventTools getEventTools()
           
 java.util.List getExternallyVisibleContentFields(atg.svc.repository.beans.Solution pSolution)
          Gets the solution content fields that are visible to everyone external.
 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.
 FavoritesService getFavoritesService()
           
 SolutionHomes getHomes(java.lang.Object pObject)
          Gets the SolutionHomes for the given repository object.
 atg.userprofiling.email.HtmlToTextConverter getHtmlToTextConverter()
           
 java.lang.String getInitialSolutionStatus()
           
 java.lang.String[] getInternalAndExternalSegmentsByValueMatch(java.lang.String pSolutionId, java.lang.String pFieldName, java.lang.Object pFieldValue)
          Gets the internal and external segments for a given property name and value.
 java.lang.String[] getInternalOnlyFields()
          Gets the list of field definition types that are internal only.
 java.lang.String getLanguage()
          Gets the language (locale) code to use when creating solution and solution events.
 int getMaxComputedTitleLength()
          Gets the maximum length allowed when computing the solution title.
 int getMaxDisplayedTitleLength()
          Gets the maximum length to display the solution title.
 atg.svc.repository.beans.Solution getPublishedSolutionById(java.lang.String pSolutionId)
          Finds the published solution by it's repository id.
 QOAAService getQOAAService()
           
 RecommendedAnswerService getRecommendedAnswerService()
           
 RecommendedReadingService getRecommendedReadingService()
           
 java.lang.String[] getSegmentsByValueMatch(java.lang.String pSolutionId, java.lang.String pFieldName, java.lang.Object pFieldValue)
          Gets the segments for a given property name and value.
 SegmentService getSegmentService()
           
 SiteConfiguration getSiteConfiguration()
           
 atg.svc.repository.beans.Solution getSolutionByDisplayId(java.lang.String pDisplayId)
          Finds a solution by it's display id.
 atg.svc.repository.beans.Solution getSolutionById(java.lang.String pId)
          Finds a solution by it's repository id or legacy id.
 atg.svc.repository.beans.Solution getSolutionByPrimaryKey(java.lang.String pId)
          Finds a solution by it's repository id only.
 atg.svc.repository.beans.Solution getSolutionBySolutionField(SolutionField pSolutionField)
          Gets the Solution that contains the given SolutionField.
 SolutionField getSolutionFieldByValue(SolutionFieldValue pSolutionFieldValue)
          Gets the SolutionField that contains the given SolutionFieldValue.
 SolutionFieldValue getSolutionFieldValueBean(SolutionField pField, SolutionFieldValue pSolutionFieldValue)
          Gets an editable SolutionFieldValue object given the SolutionField and SolutionFieldValue object.
 SolutionFieldValue getSolutionFieldValueById(java.lang.String pId)
          Finds a SolutionFieldValue given its repository id.
 SolutionMetadataService getSolutionMetadataService()
           
 SolutionRedirectService getSolutionRedirectService()
           
 java.util.List getSolutionReferences(java.lang.String pSolutionId)
          Gets the list of items that refer to a given solution.
 java.util.Collection getSolutionsByOwningGroupOrgId(java.lang.String organizationId)
          Gets Solutions with the given Owning Group.
 SolutionScoringService getSolutionScoringService()
           
 atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
           
 SolutionStatus getSolutionStatusById(java.lang.String pSolutionStatusId)
          Finds a solution status by it's repository id.
 java.util.Set getSolutionTopics(atg.svc.repository.beans.Solution pSolution)
          Gets a set of Topic based on the Solution topicIds property.
 atg.svc.repository.service.util.SolutionValidationUtils getSolutionValidationUtils()
           
 java.lang.Integer getSolutionVersion(atg.svc.repository.beans.Solution pSolution)
          Gets the version number of the solution.
 atg.searchadmin.repository.service.TopicService getTopicService()
           
 TransactionalFragmentService getTransactionalFragmentService()
           
 java.lang.String getTruncatedTitleSuffix()
          Gets the string that will be appended to any titles that have been truncated.
 UserOptionsService getUserOptionsService()
           
 atg.svc.repository.homes.KnowledgeHomesFactory getVersionedKnowledgeHomesFactory()
          Gets the versioned KnowledgeHomesFactory.
 ViewedAnswerService getViewedAnswerService()
           
 boolean isCheckoutAttachmentsOnSave()
          Returns true if attachments should be checked-out on save.
 boolean isFieldEditableForCurrentUser(SolutionField pField)
          Returns true if the given property is editable by the current user.
 boolean isFieldValueEditableForCurrentUser(SolutionFieldValue pFieldValue)
          Returns true if the given property is editable by the current user.
 boolean isFieldValueInternallyVisible(SolutionFieldValue pFieldValue, java.lang.String pSegment)
          Returns true if the given segment is found on the internalAudience field of the field value.
 boolean isFieldValueVisibleForCurrentUser(SolutionFieldValue pFieldValue)
          Returns true if the given property is visible to the current user.
 boolean isIgnoreSecurityWhenComputingTitle()
           
 boolean isRemoveSolutionReferencesOnDelete()
          Returns true if the QOAA, SolutionRelevance, Favorites and Recommended Readings should be deleted when the assoc.
 boolean isSolutionEditableForCurrentUser(atg.svc.repository.beans.Solution pSolution)
          Returns true if the given solution is editable for the current user.
 boolean isSolutionVisibleForCurrentUser(atg.svc.repository.beans.Solution pSolution)
          Returns true if the given solution is visible for the current user.
 boolean isValidateOnSaveSolution()
          Returns true if validation of the solution should be performed on save.
 void mergeTicketHistory(java.lang.String pSourceSolutionId, java.lang.String pTargetSolutionId)
          Merge ticket history for duplicate solutions, removing the history from the "source" solution into the "target" solution.
 java.lang.String normalize(java.lang.String pStr)
          Removes newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters.
 java.lang.String normalizeAndTruncate(java.lang.String pStr)
          Removes newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters then truncates the resulting string if the string exceeds the configured maxComputedTitleLength property.
 java.lang.String removeFormatting(java.lang.String pFormattedStr)
          Removes HTML formatting, newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters.
 java.lang.String removeFormattingAndTruncate(java.lang.String pFormattedStr)
          Removes HTML formatting, newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters then truncates the resulting string if the string exceeds the configured maxComputedTitleLength property.
 void saveSolution(atg.svc.repository.beans.Solution pSolution)
          Saves the solution.
 void saveSolutionStatus(SolutionStatus pSolutionStatus)
          Saves a solution status to the repository.
 void setAttachmentUtils(atg.svc.repository.service.util.AttachmentUtils pAttachmentUtils)
           
 void setCheckoutAttachmentsOnSave(boolean pCheckoutAttachmentsOnSave)
          Sets true if attachments should be checked-out on save.
 void setEventTools(atg.svc.agent.events.EventTools pEventTools)
           
 void setFavoritesService(FavoritesService pFavoritesService)
           
 void setHtmlToTextConverter(atg.userprofiling.email.HtmlToTextConverter pHtmlToTextConverter)
           
 void setIgnoreSecurityWhenComputingTitle(boolean pIgnoreSecurityWhenComputingTitle)
           
 void setInitialSolutionStatus(java.lang.String pStartingSolutionStatus)
           
 void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)
          Sets the list of field definition types that are internal only.
 void setLanguage(java.lang.String pLanguage)
          Sets the language (locale) code to use when creating solution and solution events.
 void setMaxComputedTitleLength(int pMaxComputedTitleLength)
          Sets the maximum length allowed when computing the solution title.
 void setMaxDisplayedTitleLength(int pMaxDisplayedTitleLength)
          Sets the maximum length to display the solution title.
 void setQOAAService(QOAAService pQOAAService)
           
 void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)
           
 void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)
           
 void setRemoveSolutionReferencesOnDelete(boolean pRemoveSolutionReferencesOnDelete)
          Returns true if the QOAA, SolutionRelevance, Favorites and Recommended Readings should be deleted when the assoc.
 void setSegmentService(SegmentService pSegmentService)
           
 void setSiteConfiguration(SiteConfiguration pSiteConfiguration)
           
 void setSolutionFieldValue(atg.svc.repository.beans.Solution pSolution, java.lang.String pFieldName, java.lang.String[] pSolutionFieldValueIds)
          Given a set of SolutionFieldValue ids, copy the values from those SolutionFieldValue objects and set them as the new value on the given field.
 void setSolutionMetadataService(SolutionMetadataService pSolutionMetadataService)
           
 void setSolutionRedirectService(SolutionRedirectService pSolutionRedirectService)
           
 void setSolutionScoringService(SolutionScoringService pSolutionScoringService)
           
 void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
           
 void setSolutionValidationUtils(atg.svc.repository.service.util.SolutionValidationUtils pSolutionValidationUtils)
           
 void setTopicService(atg.searchadmin.repository.service.TopicService pTopicService)
           
 void setTransactionalFragmentService(TransactionalFragmentService pTransactionalFragmentService)
           
 void setTruncatedTitleSuffix(java.lang.String pTruncatedTitleSuffix)
          Sets the string that will be appended to any titles that have been truncated.
 void setUserOptionsService(UserOptionsService pUserOptionsService)
           
 void setValidateOnSaveSolution(boolean pValidateOnSaveSolution)
          Set to true if validation of the solution should be performed on save.
 void setVersionedKnowledgeHomesFactory(atg.svc.repository.homes.KnowledgeHomesFactory pVersionedKnowledgeHomesFactory)
          Sets the versioned KnowledgeHomesFactory.
 void setViewedAnswerService(ViewedAnswerService pViewedAnswerService)
           
 void switchSolutionClass(java.lang.String pSolutionClassId, atg.svc.repository.beans.Solution pSolution)
          Changes the solution class on a solution.
 java.lang.String truncateTitleForCompute(java.lang.String pTitle)
          Truncates the given title string to the configured number of maximum bytes.
 java.lang.String truncateTitleForDisplay(java.lang.String pTitle)
          Truncates the given title string to the configured number of maximum characters.
 void updateTopicIds(java.util.Set pTopicIds, atg.svc.repository.beans.Solution pSolution)
          Adds/Removes topic(s) to/from a solution.
 atg.svc.repository.beans.Solution wrapSolutionRepositoryItem(atg.repository.RepositoryItem pItem)
          Wraps a solution repository item in a Solution java bean repository implementation.
 java.util.Collection<atg.svc.repository.beans.Solution> wrapSolutionRepositoryItems(java.util.Collection<atg.repository.RepositoryItem> pColl)
          Wraps a collection of solution repository item in a collection of Solution java bean repository implementation.
 
Methods inherited from class atg.svc.repository.service.KnowledgeBaseService
getKnowledgeHomesFactory, getOptionBeanHomes, getOptionRepositoryHomes, getServiceSegmentBeanHomes, getServiceSegmentRepositoryHomes, getSolutionBeanHomes, getSolutionRepositoryHomes, getUserOptionBeanHomes, getUserOptionRepositoryHomes, setKnowledgeHomesFactory
 
Methods inherited from class atg.svc.repository.service.BaseService
getRepositoryService, getToday, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
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
Class version string

See Also:
Constant Field Values

EMPTY_STRING_ARRAY

public static final java.lang.String[] EMPTY_STRING_ARRAY

EMPTY_STRING

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

SolutionService

public SolutionService()
Method Detail

getSolutionRedirectService

public SolutionRedirectService getSolutionRedirectService()

setSolutionRedirectService

public void setSolutionRedirectService(SolutionRedirectService pSolutionRedirectService)

getHtmlToTextConverter

public atg.userprofiling.email.HtmlToTextConverter getHtmlToTextConverter()

setHtmlToTextConverter

public void setHtmlToTextConverter(atg.userprofiling.email.HtmlToTextConverter pHtmlToTextConverter)

getSolutionMetadataService

public SolutionMetadataService getSolutionMetadataService()

setSolutionMetadataService

public void setSolutionMetadataService(SolutionMetadataService pSolutionMetadataService)

getSegmentService

public SegmentService getSegmentService()

setSegmentService

public void setSegmentService(SegmentService pSegmentService)

getTopicService

public atg.searchadmin.repository.service.TopicService getTopicService()

setTopicService

public void setTopicService(atg.searchadmin.repository.service.TopicService pTopicService)

getEventTools

public atg.svc.agent.events.EventTools getEventTools()

setEventTools

public void setEventTools(atg.svc.agent.events.EventTools pEventTools)

getSolutionSecurityUtils

public atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()

setSolutionSecurityUtils

public void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)

getSolutionValidationUtils

public atg.svc.repository.service.util.SolutionValidationUtils getSolutionValidationUtils()

setSolutionValidationUtils

public void setSolutionValidationUtils(atg.svc.repository.service.util.SolutionValidationUtils pSolutionValidationUtils)

getQOAAService

public QOAAService getQOAAService()

setQOAAService

public void setQOAAService(QOAAService pQOAAService)

getFavoritesService

public FavoritesService getFavoritesService()

setFavoritesService

public void setFavoritesService(FavoritesService pFavoritesService)

getRecommendedReadingService

public RecommendedReadingService getRecommendedReadingService()

setRecommendedReadingService

public void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)

getSolutionScoringService

public SolutionScoringService getSolutionScoringService()

setSolutionScoringService

public void setSolutionScoringService(SolutionScoringService pSolutionScoringService)

getTransactionalFragmentService

public TransactionalFragmentService getTransactionalFragmentService()

setTransactionalFragmentService

public void setTransactionalFragmentService(TransactionalFragmentService pTransactionalFragmentService)

getUserOptionsService

public UserOptionsService getUserOptionsService()

setUserOptionsService

public void setUserOptionsService(UserOptionsService pUserOptionsService)

getSiteConfiguration

public SiteConfiguration getSiteConfiguration()

setSiteConfiguration

public void setSiteConfiguration(SiteConfiguration pSiteConfiguration)

getInitialSolutionStatus

public java.lang.String getInitialSolutionStatus()

setInitialSolutionStatus

public void setInitialSolutionStatus(java.lang.String pStartingSolutionStatus)

isCheckoutAttachmentsOnSave

public boolean isCheckoutAttachmentsOnSave()
Returns true if attachments should be checked-out on save.

Returns:
True if attachments should be checked-out on save.

setCheckoutAttachmentsOnSave

public void setCheckoutAttachmentsOnSave(boolean pCheckoutAttachmentsOnSave)
Sets true if attachments should be checked-out on save.

Parameters:
pCheckoutAttachmentsOnSave - True if attachments should be checked-out on save.

getInternalOnlyFields

public java.lang.String[] getInternalOnlyFields()
Gets the list of field definition types that are internal only. This means they will their external audience defaulted to none.

Returns:
The String array of field definition types by name.

setInternalOnlyFields

public void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)
Sets the list of field definition types that are internal only. This means they will their external audience defaulted to none.

Parameters:
pInternalOnlyFields - The String array of field definition types by name.

getLanguage

public java.lang.String getLanguage()
Gets the language (locale) code to use when creating solution and solution events.

Returns:
The language (locale) code (like "en")

setLanguage

public void setLanguage(java.lang.String pLanguage)
Sets the language (locale) code to use when creating solution and solution events.

Parameters:
pLanguage - The language (locale) code (like "en_US")

isValidateOnSaveSolution

public boolean isValidateOnSaveSolution()
Returns true if validation of the solution should be performed on save.

Returns:
True if validation of the solution should be performed on save.

setValidateOnSaveSolution

public void setValidateOnSaveSolution(boolean pValidateOnSaveSolution)
Set to true if validation of the solution should be performed on save.

Parameters:
pValidateOnSaveSolution - True if validation of the solution should be performed on save.

isRemoveSolutionReferencesOnDelete

public boolean isRemoveSolutionReferencesOnDelete()
Returns true if the QOAA, SolutionRelevance, Favorites and Recommended Readings should be deleted when the assoc. solution is deleted.

Returns:
True if delete references.

setRemoveSolutionReferencesOnDelete

public void setRemoveSolutionReferencesOnDelete(boolean pRemoveSolutionReferencesOnDelete)
Returns true if the QOAA, SolutionRelevance, Favorites and Recommended Readings should be deleted when the assoc. solution is deleted.

Parameters:
pRemoveSolutionReferencesOnDelete - True if delete references.

isIgnoreSecurityWhenComputingTitle

public boolean isIgnoreSecurityWhenComputingTitle()

setIgnoreSecurityWhenComputingTitle

public void setIgnoreSecurityWhenComputingTitle(boolean pIgnoreSecurityWhenComputingTitle)

getRecommendedAnswerService

public RecommendedAnswerService getRecommendedAnswerService()

setRecommendedAnswerService

public void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)

getViewedAnswerService

public ViewedAnswerService getViewedAnswerService()

setViewedAnswerService

public void setViewedAnswerService(ViewedAnswerService pViewedAnswerService)

getAttachmentUtils

public atg.svc.repository.service.util.AttachmentUtils getAttachmentUtils()

setAttachmentUtils

public void setAttachmentUtils(atg.svc.repository.service.util.AttachmentUtils pAttachmentUtils)

getMaxDisplayedTitleLength

public int getMaxDisplayedTitleLength()
Gets the maximum length to display the solution title.

Returns:
The maximum length to display the solution title.

setMaxDisplayedTitleLength

public void setMaxDisplayedTitleLength(int pMaxDisplayedTitleLength)
Sets the maximum length to display the solution title.

Parameters:
pMaxDisplayedTitleLength - The maximum length to display the solution title.

getMaxComputedTitleLength

public int getMaxComputedTitleLength()
Gets the maximum length allowed when computing the solution title.

Returns:
The maximum length to compute the solution title.

setMaxComputedTitleLength

public void setMaxComputedTitleLength(int pMaxComputedTitleLength)
Sets the maximum length allowed when computing the solution title.

Parameters:
pMaxComputedTitleLength - The maximum length to compute the solution title.

getTruncatedTitleSuffix

public java.lang.String getTruncatedTitleSuffix()
Gets the string that will be appended to any titles that have been truncated.

Returns:
The string that will be appended to any titles that have been truncated.

setTruncatedTitleSuffix

public void setTruncatedTitleSuffix(java.lang.String pTruncatedTitleSuffix)
Sets the string that will be appended to any titles that have been truncated.

Parameters:
pTruncatedTitleSuffix - The string that will be appended to any titles that have been truncated.

getVersionedKnowledgeHomesFactory

public atg.svc.repository.homes.KnowledgeHomesFactory getVersionedKnowledgeHomesFactory()
Gets the versioned KnowledgeHomesFactory. Need to retrieve the solution version number in getSolutionVersion(Solution)

Returns:
The string that will be appended to any titles that have been truncated.

setVersionedKnowledgeHomesFactory

public void setVersionedKnowledgeHomesFactory(atg.svc.repository.homes.KnowledgeHomesFactory pVersionedKnowledgeHomesFactory)
Sets the versioned KnowledgeHomesFactory.

Parameters:
pVersionedKnowledgeHomesFactory - The string that will be appended to any titles that have been truncated.

getSolutionById

public atg.svc.repository.beans.Solution getSolutionById(java.lang.String pId)
                                                  throws ObjectNotFoundException
Finds a solution by it's repository id or legacy id. The solution is first found by the legacy id and if that is not successful the solution is found by the repository id property. For the reverse search order use getSolutionByDisplayId.

Parameters:
pId - The repository or legacy id of a Solution.
Returns:
The Solution ReposImpl
Throws:
ObjectNotFoundException - If a solution is not found by the given id.

getSolutionByPrimaryKey

public atg.svc.repository.beans.Solution getSolutionByPrimaryKey(java.lang.String pId)
                                                          throws ObjectNotFoundException
Finds a solution by it's repository id only. This function doesn't test for the legacy id.

Parameters:
pId - The repository id of a Solution.
Returns:
The Solution ReposImpl
Throws:
ObjectNotFoundException - If a solution is not found by the given id.

getSolutionByDisplayId

public atg.svc.repository.beans.Solution getSolutionByDisplayId(java.lang.String pDisplayId)
                                                         throws ObjectNotFoundException
Finds a solution by it's display id. The display id is either the legacyId (if present) or the repository id if the legacy id is null. Solutions migrated from Knowledge Center will have a legacyId equal to the KC solution id. Solutions creaeted in Wisdom will have a null legacyId.

The legacyId is tried first and then the repository id. This is the opposite search order of getSolutionById.

Parameters:
pDisplayId - The legacy id or repository id.
Returns:
The Solution ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

getPublishedSolutionById

public atg.svc.repository.beans.Solution getPublishedSolutionById(java.lang.String pSolutionId)
                                                           throws ObjectNotFoundException
Finds the published solution by it's repository id. Checks to see if this solution is externally visible. If solution is not published externally, throws an

Parameters:
pSolutionId - The repository id.
Returns:
The Solution ReposImpl
Throws:
ObjectNotFoundException - If the id is not found or the solution is not externally visible.

getSolutionBySolutionField

public atg.svc.repository.beans.Solution getSolutionBySolutionField(SolutionField pSolutionField)
                                                             throws ObjectNotFoundException
Gets the Solution that contains the given SolutionField.

Parameters:
pSolutionField - The solution field.
Returns:
The Solution.
Throws:
ObjectNotFoundException - If the Solution cannot be found.

getSolutionFieldByValue

public SolutionField getSolutionFieldByValue(SolutionFieldValue pSolutionFieldValue)
                                      throws ObjectNotFoundException
Gets the SolutionField that contains the given SolutionFieldValue.

Parameters:
pSolutionFieldValue - The solution field value.
Returns:
The SolutionField.
Throws:
ObjectNotFoundException - If the SolutionField cannot be found.

getSolutionVersion

public java.lang.Integer getSolutionVersion(atg.svc.repository.beans.Solution pSolution)
Gets the version number of the solution. If pSolution is a versioned repository item, uses the version of the item. Otherwise returns the last checked-in version for the solution. Returns null if the solution has never been checked in.

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

createSolution

public atg.svc.repository.beans.Solution createSolution(java.lang.String pSolutionClassId)
                                                 throws javax.ejb.CreateException,
                                                        ObjectNotFoundException
Creates a new solution repository bean object from the given solution class id.

Parameters:
pSolutionClassId - The id of the solution class.
Returns:
A Solution repository bean object.
Throws:
ObjectNotFoundException - If the solution class is not found.
javax.ejb.CreateException

createSolution

public atg.svc.repository.beans.Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass)
                                                 throws javax.ejb.CreateException
Creates a new solution repository bean object from the given solution class.

Parameters:
pSolutionClass - The solution class object.
Returns:
A Solution repository bean object.
Throws:
javax.ejb.CreateException - If the create of the Solution or any SolutionField objects derived from the SolutionClass fails.

createSolutionBean

public atg.svc.repository.beans.Solution createSolutionBean(java.lang.String pSolutionClassId)
                                                     throws ObjectNotFoundException
Creates a Solution in-memory bean that is not connected to the repository.

Parameters:
pSolutionClassId - The id of the SolutionClass to create the Solution from.
Returns:
A SolutionClass in-memory bean object.
Throws:
ObjectNotFoundException - If the SolutionClass is not found.

createSolutionBean

public atg.svc.repository.beans.Solution createSolutionBean(atg.svc.repository.beans.SolutionClass pSolutionClass)
Creates a Solution in-memory bean that is not connected to the repository.

Parameters:
pSolutionClass - The SolutionClass object to create the Solution from.
Returns:
A Solution in-memory bean object.
Throws:
atg.core.exception.ContainerRuntimeException - If an exception is thrown when the in-memory bean is created.

createSolution

public atg.svc.repository.beans.Solution createSolution(java.lang.String pSolutionClassId,
                                                        SolutionHomes pHomes)
                                                 throws javax.ejb.CreateException,
                                                        ObjectNotFoundException
Creates a new Solution object from the given SolutionClass object from the given SolutionHomes. If the SolutionHomes is the bean homes a in-memory bean object is created. If the SolutionHomes is the repository homes a repository bean object is created. In-memory bean objects are not intended to be saved to the repository but to be used in memory, persisted places like the session. Repository bean objects wrap a repository item and are intended to be used for writing Solution items to the repository. These objects should be saved with saveSolution()

Parameters:
pSolutionClassId - The id of the SolutionClass to create the Solution from.
Returns:
A Solution object from the given homes -- either a in-memory bean or repository bean impl.
Throws:
javax.ejb.CreateException - If the homes are repository and the repository create operation fails.
ObjectNotFoundException - If the SolutionClass is not found.

createSolution

public atg.svc.repository.beans.Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass,
                                                        SolutionHomes pHomes)
                                                 throws javax.ejb.CreateException
Creates a new Solution object from the given SolutionClass object from the given SolutionHomes. If the SolutionHomes is the bean homes a in-memory bean object is created. If the SolutionHomes is the repository homes a repository bean object is created. In-memory bean objects are not intended to be saved to the repository but to be used in memory, persisted places like the session. Repository bean objects wrap a repository item and are intended to be used for writing Solution items to the repository. Thee objects should be saved with saveSolution()

Parameters:
pSolutionClass - The SolutionClass to create the Solution from.
Returns:
A Solution object from the given homes -- either a in-memory bean or repository bean impl.
Throws:
javax.ejb.CreateException - If the homes are repository and the repository create operation fails

editSolution

public atg.svc.repository.beans.Solution editSolution(java.lang.String pSolutionId)
                                               throws javax.ejb.CreateException,
                                                      ObjectNotFoundException,
                                                      PersistenceException
Gets an editable Solution bean given its repository id.

Parameters:
pSolutionId - The id of the Solution to edit.
Returns:
An editable Solution bean impl.
Throws:
ObjectNotFoundException - The id is not found.
javax.ejb.CreateException
PersistenceException

deleteSolution

public void deleteSolution(java.lang.String pSolutionId)
                    throws ObjectNotFoundException,
                           PersistenceException
Deletes a solution and all of its fields given the solution id.

Parameters:
pSolutionId - The id of the solution to delete.
Throws:
ObjectNotFoundException - If the solution repository item is not found.
PersistenceException - If a remove operation fails.

copySolution

public atg.svc.repository.beans.Solution copySolution(atg.svc.repository.beans.Solution pSrcSolution)
                                               throws javax.ejb.CreateException
Copies the data from the given Solution into a brand new Solution. The returned Solution has not been committed to the repository or added to any projects.

There is a small chance for mismatch in the solutions if the source solution's fields do not match its SolutionClass because it has not been edited since the SolutionClass might have changed. In that case it won't be a perfect copy but its more important the new solution reflect the current state of the SolutionClass not the Solution being copied from. So, before the copy from the source SolutionField to the destination SolutionField this method checks to see if the destination SolutionField even exists.

Parameters:
pSrcSolution - The Solution to copy into a new Solution.
Returns:
The new Solution.
Throws:
javax.ejb.CreateException - If the create operation fails.

createSolutionReferences

protected java.util.List createSolutionReferences(atg.svc.repository.beans.Solution pSolution)
                                           throws javax.ejb.CreateException
Create the initial Solution references.

Parameters:
pSolution - The solution to whose references these are for.
Returns:
The list of repository objects that refer to the given solution.
Throws:
javax.ejb.CreateException

getSolutionReferences

public java.util.List getSolutionReferences(java.lang.String pSolutionId)
Gets the list of items that refer to a given solution. Includes the QOAA, SolutionRelevance, Favorites and Recommended Reading objects associated with the given solution.

Parameters:
pSolutionId - The id of the solution to get the references for.
Returns:
The list of repository objects that refer to the given solution.

saveSolution

public void saveSolution(atg.svc.repository.beans.Solution pSolution)
                  throws PersistenceException
Saves the solution. Also saves any modified SolutionField and SolutionFieldValues that belong to the properties under the solution.

Parameters:
pSolution - The Solution to save.
Throws:
atg.svc.validation.ValidationException - If one of the fields does not pass validation requirements. Currently the only requirement is "required" if a field has the isRequired flag set to true in it's FieldDefinition.
PersistenceException - If the save operation fails.
java.lang.IllegalArgumentException - If the pSolution argument is an in-memory bean not a repository bean

switchSolutionClass

public void switchSolutionClass(java.lang.String pSolutionClassId,
                                atg.svc.repository.beans.Solution pSolution)
                         throws javax.ejb.CreateException,
                                ObjectNotFoundException,
                                PersistenceException
Changes the solution class on a solution. This removes all the fields on the solution, sets the solution class and then recreates all of the fields. It does not preserve any of the existing values on the Solution.

Parameters:
pSolution - The editable solution bean.
pSolutionClassId - The id of the new solution class to set.
Throws:
ObjectNotFoundException - If the deleteCollection method on the RepositoryService throws it or if the given SolutionClass cannot be found.
PersistenceException - If the delete of the SolutionField objects on the Solution fails.
atg.core.exception.ContainerRuntimeException - If the findBySolution finder on SolutionFieldHome fails.
javax.ejb.CreateException

computeTitle

public java.lang.String computeTitle(atg.svc.repository.beans.Solution pSolution)
Computes the title for the given Solution. The title is defined as the first solution property with the title flag set. If there is no such property the Solution id is returned.

Parameters:
pSolution - The non-null solution to get the title for.
Returns:
The computed title
Throws:
java.lang.IllegalArgumentException - If the pSolution parameter is null.

truncateTitleForDisplay

public java.lang.String truncateTitleForDisplay(java.lang.String pTitle)
Truncates the given title string to the configured number of maximum characters. If the given string is blank or less than or equal the maximum number of characters the given string is returned unchanged.

Parameters:
pTitle - The string to truncate.
Returns:
The truncated string

truncateTitleForCompute

public java.lang.String truncateTitleForCompute(java.lang.String pTitle)
Truncates the given title string to the configured number of maximum bytes. If the given string is blank or less than or equal the maximum number of characters the given string is returned unchanged.

Parameters:
pTitle - The string to truncate.
Returns:
The truncated string

clearSolutionExternalAudience

public void clearSolutionExternalAudience(atg.svc.repository.beans.Solution pSolution)
Clears the all of the segments from the Solution's external audience property.

Parameters:
pSolution - The Solution to clear the segments from.

addTopic

public void addTopic(java.lang.String pTopicId,
                     atg.svc.repository.beans.Solution pSolution)
Adds a topic to a solution.

Parameters:
pTopicId - The topic to add.
pSolution - The Solution to add the topic to.

updateTopicIds

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

Parameters:
pTopicIds - The new set of topic ids (string)
pSolution - The Solution to add the topic to.

setSolutionFieldValue

public void setSolutionFieldValue(atg.svc.repository.beans.Solution pSolution,
                                  java.lang.String pFieldName,
                                  java.lang.String[] pSolutionFieldValueIds)
                           throws javax.ejb.CreateException,
                                  ObjectNotFoundException,
                                  atg.beans.PropertyNotFoundException
Given a set of SolutionFieldValue ids, copy the values from those SolutionFieldValue objects and set them as the new value on the given field.

Parameters:
pSolution - The solution that contains the field to set the values on
pFieldName - The name of the field in the solution's field map to set the values on
pSolutionFieldValueIds - The array of solution field values (by id) to set as the new value on the given SolutionField.
pSolution -
Throws:
javax.ejb.CreateException - If the create of a new SolutionFieldValue fails.
ObjectNotFoundException - If the SolutionFieldValue cannot be found by a given id.
atg.beans.PropertyNotFoundException - If the SolutionField with the given name does not exist on the Solution.

isSolutionVisibleForCurrentUser

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

Parameters:
pSolution - The Solution to check access on.
Returns:
True if the given solution is visible for the current user.

isSolutionEditableForCurrentUser

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

Parameters:
pSolution - The Solution to check access on.
Returns:
True if the given solution is editable for the current user.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                                            throws javax.ejb.CreateException
Creates a new SolutionFieldValue repository impl.

Parameters:
pFieldDefinition - The field definition to create the solution field value from.
Returns:
The SolutionFieldValue repository impl.
Throws:
javax.ejb.CreateException - If the SolutionFieldValue is a repository object and the create operation fails.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinitionType pType)
                                            throws javax.ejb.CreateException
Creates a new SolutionFieldValue repository impl with the given field type..

Parameters:
pType - The field definition type to create the solution field value from.
Returns:
The SolutionFieldValue repository impl.
Throws:
javax.ejb.CreateException - If the SolutionFieldValue is a repository object and the create operation fails.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(SolutionField pField)
                                            throws javax.ejb.CreateException
Creates a SolutionFieldValue for the given SolutionField.

Parameters:
pField - The field to create the SolutionFieldValue for.
Returns:
The SolutionFieldValue impl.
Throws:
javax.ejb.CreateException - If the SolutionFieldValue is a repository object and the create operation fails.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinitionType pType,
                                                   SolutionHomes pHomes)
                                            throws javax.ejb.CreateException
Creates a new SolutionFieldValue impl from the given SolutionHomes (bean or repository).

Parameters:
pType - The field definition type to create the solution field value from.
pHomes - The SolutionHomes to create the solution field value from.
Returns:
The SolutionFieldValue impl.
Throws:
javax.ejb.CreateException - If the create is in the repository and the create operation fails.

getSolutionFieldValueBean

public SolutionFieldValue getSolutionFieldValueBean(SolutionField pField,
                                                    SolutionFieldValue pSolutionFieldValue)
Gets an editable SolutionFieldValue object given the SolutionField and SolutionFieldValue object. The SolutionField is required because the SolutionFieldValue object's getType() method requires the FieldDefinition to be set if a bean is created.

Parameters:
pField - The field parent of the field value.
pSolutionFieldValue - The field value to edit.
Returns:
The solution field value bean.

getSolutionFieldValueById

public SolutionFieldValue getSolutionFieldValueById(java.lang.String pId)
                                             throws ObjectNotFoundException
Finds a SolutionFieldValue given its repository id.

Parameters:
pId - The repository id of the SolutionFieldValue to find.
Returns:
The SolutionFieldValue object.
Throws:
ObjectNotFoundException - If a SolutionFieldValue is not found with the given id.

isFieldEditableForCurrentUser

public boolean isFieldEditableForCurrentUser(SolutionField pField)
Returns true if the given property is editable by the current user.

Returns:
True if the given property is editable by the current user.

isFieldValueVisibleForCurrentUser

public boolean isFieldValueVisibleForCurrentUser(SolutionFieldValue pFieldValue)
Returns true if the given property is visible to the current user.

Parameters:
pFieldValue - The solution property.
Returns:
True if the given property value is visible to the current user.

isFieldValueEditableForCurrentUser

public boolean isFieldValueEditableForCurrentUser(SolutionFieldValue pFieldValue)
Returns true if the given property is editable by the current user.

Parameters:
pFieldValue - The solution property.
Returns:
True if the given property value is editable by the current user.

isFieldValueInternallyVisible

public boolean isFieldValueInternallyVisible(SolutionFieldValue pFieldValue,
                                             java.lang.String pSegment)
Returns true if the given segment is found on the internalAudience field of the field value.

Parameters:
pFieldValue - The field value to examine.
pSegment - The segment to search for on the field value.
Returns:
True if the segment is found on the given field value. Otherwise false.

getInternalAndExternalSegmentsByValueMatch

public java.lang.String[] getInternalAndExternalSegmentsByValueMatch(java.lang.String pSolutionId,
                                                                     java.lang.String pFieldName,
                                                                     java.lang.Object pFieldValue)
                                                              throws ObjectNotFoundException
Gets the internal and external segments for a given property name and value. The value is used to find the right SolutionFieldValue and the property name is used to find the SolutionField. This method is used during search indexing to define both internal and external security constraints on the field values.

Parameters:
pSolutionId - The id of the Solution.
pFieldName - The name of the property.
pFieldValue - The value to match.
Returns:
The array of segments or an empty array if none are found.
Throws:
ObjectNotFoundException - If the FieldDefinition cannot be found by name OR the Solution cannot by found by id.

getSegmentsByValueMatch

public java.lang.String[] getSegmentsByValueMatch(java.lang.String pSolutionId,
                                                  java.lang.String pFieldName,
                                                  java.lang.Object pFieldValue)
                                           throws ObjectNotFoundException
Gets the segments for a given property name and value. The value is used to find the right SolutionFieldValue and the property name is used to find the SolutionField. Returns the internal segments if called from the agent server and returns the external segments if called from the Self Service server.

Parameters:
pSolutionId - The id of the Solution.
pFieldName - The name of the property.
pFieldValue - The value to match.
Returns:
The array of segments or an empty array if none are found.
Throws:
ObjectNotFoundException - If the FieldDefinition cannot be found by name OR the Solution cannot by found by id.

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 statement fields from.
Returns:
The List of SolutionField objects that are viewable for all external users.

getExternallyVisibleContentFields

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

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

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 SolutionClass to get the statement fields from.
Returns:
The List of SolutionField objects that are viewable for all external users.

getSolutionStatusById

public SolutionStatus getSolutionStatusById(java.lang.String pSolutionStatusId)
                                     throws ObjectNotFoundException
Finds a solution status by it's repository id.

Parameters:
pSolutionStatusId - The repository id.
Returns:
The SolutionStatus ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

createSolutionStatus

public SolutionStatus createSolutionStatus()
                                    throws javax.ejb.CreateException
Creates a new solution status bean. Commit the bean with saveSolutionStatus().

Returns:
A solution status BeanImpl.
Throws:
javax.ejb.CreateException - If the create fails.

editSolutionStatus

public SolutionStatus editSolutionStatus(java.lang.String pSolutionStatusId)
                                  throws ObjectNotFoundException
Gets an editable version of a solution status given the solution status' id.

Parameters:
pSolutionStatusId - A Solution Status
Returns:
A Solution Status ReposImpl.
Throws:
ObjectNotFoundException

saveSolutionStatus

public void saveSolutionStatus(SolutionStatus pSolutionStatus)
                        throws PersistenceException
Saves a solution status to the repository. If the solution status does not yet have a repository id it is a new object else it is an existing object that needs to be updated.

Parameters:
pSolutionStatus - The solution status to save.
Throws:
PersistenceException

deleteSolutionStatus

public void deleteSolutionStatus(java.lang.String pSolutionStatusId)
                          throws ObjectNotFoundException,
                                 PersistenceException
Deletes a solution status given it's solution status id.

Parameters:
pSolutionStatusId - The id of the solution status to delete.
Throws:
ObjectNotFoundException - If the solution status repository item is not found.
PersistenceException - If the delete fails.

getSolutionTopics

public java.util.Set getSolutionTopics(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

removeFormattingAndTruncate

public java.lang.String removeFormattingAndTruncate(java.lang.String pFormattedStr)
Removes HTML formatting, newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters then truncates the resulting string if the string exceeds the configured maxComputedTitleLength property. NOTE: This function is almost the same as removeFormatting but also truncates the statement so it doesn't exceed the max title length.

Parameters:
pFormattedStr - The non-null string to remove formatting and possibly truncate.
Returns:
The unformatted string
Throws:
java.lang.IllegalArgumentException - If the pFormattedStr param is null

removeFormatting

public java.lang.String removeFormatting(java.lang.String pFormattedStr)
Removes HTML formatting, newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters. NOTE: This function does not truncate for title length.

Parameters:
pFormattedStr - The non-null string to remove formatting and possibly truncate.
Returns:
The unformatted string
Throws:
java.lang.IllegalArgumentException - If the pFormattedStr param is null

normalize

public java.lang.String normalize(java.lang.String pStr)
Removes newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters.

Parameters:
pStr - The string to remove characters and possibly truncate.
Returns:
The normalized string

normalizeAndTruncate

public java.lang.String normalizeAndTruncate(java.lang.String pStr)
Removes newline, carriage return, tab characters, repetitive whitespace characters and leading and/or trailing whitespace characters then truncates the resulting string if the string exceeds the configured maxComputedTitleLength property.

Parameters:
pStr - The string to remove characters and possibly truncate.
Returns:
The normalized and truncated string

getHomes

public SolutionHomes getHomes(java.lang.Object pObject)
Gets the SolutionHomes for the given repository object.

Parameters:
pObject - The object to get the homes for.
Returns:
The bean homes if the object is a bean impl else the repository homes.

mergeTicketHistory

public void mergeTicketHistory(java.lang.String pSourceSolutionId,
                               java.lang.String pTargetSolutionId)
                        throws ObjectNotFoundException,
                               javax.ejb.CreateException,
                               PersistenceException
Merge ticket history for duplicate solutions, removing the history from the "source" solution into the "target" solution. This is done by simply changing the solution id in the viewed and recommended answers of the source solution into the target solution.

Parameters:
pSourceSolutionId - repository id of the solution the history is moving from
pTargetSolutionId - repository id of the solution the history is moving to.
Throws:
ObjectNotFoundException
javax.ejb.CreateException
PersistenceException

getSolutionsByOwningGroupOrgId

public java.util.Collection getSolutionsByOwningGroupOrgId(java.lang.String organizationId)
Gets Solutions with the given Owning Group.

Parameters:
organizationId - The organization id of the Owning Group
Returns:
a Collection of Solution instances matching the criteria. If no instances match the criteria, then an empty Collection is returned.

wrapSolutionRepositoryItem

public atg.svc.repository.beans.Solution wrapSolutionRepositoryItem(atg.repository.RepositoryItem pItem)
Wraps a solution repository item in a Solution java bean repository implementation.

Parameters:
pItem - The item to wrap.
Returns:
The Solution bean as a repository impl.

wrapSolutionRepositoryItems

public java.util.Collection<atg.svc.repository.beans.Solution> wrapSolutionRepositoryItems(java.util.Collection<atg.repository.RepositoryItem> pColl)
Wraps a collection of solution repository item in a collection of Solution java bean repository implementation.

Parameters:
pColl - The collection of repository items to wrap.
Returns:
A collection of Solution beans as repository impls.