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","eventTools","favoritesService","htmlToTextConverter","qOAAService","recommendedAnswerService","recommendedReadingService","segmentService","siteConfiguration","solutionFieldDataService","solutionMetadataService","solutionRedirectService","solutionScoringService","solutionScoringUtils","solutionValidationUtils","topicService","transactionalFragmentService","optionService","viewedAnswerService"})
public class SolutionService
extends KnowledgeBaseService

Business methods for the Solution object. NOTE: The following methods were removed in the 10.0 release. getSolutionBySolutionField(SolutionField pSolutionField) - this method depended on a find by solution field. This functionality is no longer supported now that solutino fields are encoded as a JSON string. getSolutionFieldByValue() - this method depended on a find by solution field value. This functionality is no longer supported now that solutino fields are encoded as a JSON string. NOTE: We did not previously have a base exception class in ATG Service that we threw. To allow for new exceptions to be thrown, we changed the signature of the functions to throw a new SvcException base exception. This will allow us to throw new exceptions in the future without changing the signature of the methods. However, customizations built before 10.0 will need to catch the new SvcException. The PersistenceException, ObjectException and ObjectNotFoundException now sub-class the SvcException. So does the new SolutionFieldStorageException. Methods that previously threw javax.ejb.CreateException, javax.ebj.FinderException or javax.ejb.RemoveException now throw a PersistenceException which is declared as throws SvcException to allow for other SvcExceptions to be thrown in the future.


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 addSolutionField(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition, Solution pSolution)
          Adds a new SolutionField to a Solution given the field metadata (SolutionClassFieldDefinition).
 void addTopic(java.lang.String pTopicId, Solution pSolution)
          Adds a topic to a solution.
 void assignSolutionDefaultValues(Solution pSolution)
           
 void clearSolutionExternalAudience(Solution pSolution)
          Clears the all of the segments from the Solution's external audience property.
 java.lang.String computeTitle(Solution pSolution)
          Computes the title for the given Solution.
 Solution copySolution(Solution pSrcSolution)
          Copies the data from the given Solution into a brand new Solution.
 Solution copySolutionAsNew(java.lang.String pTemplateSolutionId)
          Creates a new solution bean based on the template solution provided
 Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Creates a new solution repository bean object from the given solution class.
 Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass, SolutionHomes pHomes)
          Creates a new Solution object from the given SolutionClass object from the given SolutionHomes.
 Solution createSolution(java.lang.String pSolutionClassId)
          Creates a new solution repository bean object from the given solution class id.
 Solution createSolution(java.lang.String pSolutionClassId, SolutionHomes pHomes)
          Creates a new Solution object from the given SolutionClass object from the given SolutionHomes.
 Solution createSolutionBean(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Creates a Solution in-memory bean that is not connected to the repository.
 Solution createSolutionBean(java.lang.String pSolutionClassId)
          Creates a Solution in-memory bean that is not connected to the repository.
 SolutionField createSolutionField(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition, SolutionHomes pHomes)
          Creates a new SolutionField based on the given SolutionClassFieldDefinition.
 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<SolutionRelevance> createSolutionReferences(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.
 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.
 java.util.Collection getAllSolutions()
           
 atg.svc.repository.service.util.AttachmentUtils getAttachmentUtils()
           
 atg.svc.agent.events.EventTools getEventTools()
           
 java.util.List<SolutionField> getExternallyVisibleContentFields(Solution pSolution)
          Gets the solution content fields that are visible to everyone external.
 java.util.List<SolutionField> getExternallyVisiblePropertyFields(Solution pSolution)
          Gets the solution property fields that are visible to everyone external.
 java.util.List<SolutionField> getExternallyVisibleStatementFields(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.svc.sgmlparser.parser.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 - their external audience is set to none.
 java.lang.String getLanguage()
          The language (locale) code (e.g.
 int getMaxComputedTitleLength()
          The maximum length allowed when computing the solution title.
 int getMaxDisplayedTitleLength()
          The maximum length to display the solution title.
 atg.svc.repository.service.OptionService getOptionService()
           
 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.
 atg.svc.repository.service.SegmentService getSegmentService()
           
 SiteConfiguration getSiteConfiguration()
           
 Solution getSolutionByDisplayId(java.lang.String pDisplayId)
          Finds a solution by it's display id.
 Solution getSolutionById(java.lang.String pId)
          Finds a solution by it's repository id or legacy id.
 Solution getSolutionByPrimaryKey(java.lang.String pId)
          Finds a solution by it's repository id only.
 atg.svc.repository.service.SolutionFieldDataServiceImpl getSolutionFieldDataService()
           
 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<javax.ejb.EJBLocalObject> getSolutionReferences(java.lang.String pSolutionId)
          Gets the list of items that refer to a given solution.
 java.util.Collection<Solution> 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<atg.searchadmin.repository.beans.Topic> getSolutionTopics(Solution pSolution)
          Gets a set of Topic based on the Solution topicIds property.
 atg.svc.repository.service.util.SolutionValidationUtils getSolutionValidationUtils()
           
 java.lang.Integer getSolutionVersion(Solution pSolution)
          Gets the version number of the solution.
 atg.searchadmin.repository.service.TopicService getTopicService()
           
 TransactionalFragmentService getTransactionalFragmentService()
           
 java.lang.String getTruncatedTitleSuffix()
          The string that will be appended to any titles that have been truncated.
 java.lang.String getVersionedKnowledgeHomesFactoryName()
          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()
          Should we ignore security when computing the solution title NOTE: Migration sets ignoreSecurityWhenComputingTitle to true because statement security isn't migrated yet when the solution title is first computed.
 boolean isRemoveSolutionReferencesOnDelete()
          Returns true if the QOAA, SolutionRelevance, Favorites and Recommended Readings should be deleted when the assoc.
 boolean isSolutionEditableForCurrentUser(Solution pSolution)
          Returns true if the given solution is editable for the current user.
 boolean isSolutionVisibleForCurrentUser(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 removeSolutionField(SolutionField pField)
          Removes a SolutionField and any associated SolutionFieldValue objects from the repository.
 void saveSolution(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)
           
 void setEventTools(atg.svc.agent.events.EventTools pEventTools)
           
 void setFavoritesService(FavoritesService pFavoritesService)
           
 void setHtmlToTextConverter(atg.svc.sgmlparser.parser.HtmlToTextConverter pHtmlToTextConverter)
           
 void setIgnoreSecurityWhenComputingTitle(boolean pIgnoreSecurityWhenComputingTitle)
           
 void setInitialSolutionStatus(java.lang.String pStartingSolutionStatus)
           
 void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)
           
 void setLanguage(java.lang.String pLanguage)
           
 void setMaxComputedTitleLength(int pMaxComputedTitleLength)
           
 void setMaxDisplayedTitleLength(int pMaxDisplayedTitleLength)
           
 void setOptionService(atg.svc.repository.service.OptionService pOptionService)
           
 void setQOAAService(QOAAService pQOAAService)
           
 void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)
           
 void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)
           
 void setRemoveSolutionReferencesOnDelete(boolean pRemoveSolutionReferencesOnDelete)
           
 void setSegmentService(atg.svc.repository.service.SegmentService pSegmentService)
           
 void setSiteConfiguration(SiteConfiguration pSiteConfiguration)
           
 void setSolutionFieldDataService(atg.svc.repository.service.SolutionFieldDataServiceImpl pSolutionFieldDataService)
           
 void setSolutionFieldValue(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)
           
 void setValidateOnSaveSolution(boolean pValidateOnSaveSolution)
           
 void setVersionedKnowledgeHomesFactoryName(java.lang.String pVersionedKnowledgeHomesFactoryName)
           
 void setViewedAnswerService(ViewedAnswerService pViewedAnswerService)
           
 void switchSolutionClass(java.lang.String pSolutionClassId, 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 updateCustomFields(Solution pSolution, java.util.Map<java.lang.String,SolutionField> pFields)
          Takes the solution field map and stores it as encoded data on the Solution.encodedFieldData property of the solution.
 void updateTopicIds(java.util.Set<java.lang.String> pTopicIds, Solution pSolution)
          Adds/Removes topic(s) to/from a solution.
 Solution wrapSolutionRepositoryItem(atg.repository.RepositoryItem pItem)
          Wraps a solution repository item in a Solution java bean repository implementation.
 java.util.Collection<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, getServiceSegmentBeanHomes, getServiceSegmentRepositoryHomes, getSolutionBeanHomes, getSolutionRepositoryHomes, 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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

getAttachmentUtils

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

setAttachmentUtils

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

getEventTools

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

setEventTools

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

getFavoritesService

public FavoritesService getFavoritesService()

setFavoritesService

public void setFavoritesService(FavoritesService pFavoritesService)

getHtmlToTextConverter

public atg.svc.sgmlparser.parser.HtmlToTextConverter getHtmlToTextConverter()

setHtmlToTextConverter

public void setHtmlToTextConverter(atg.svc.sgmlparser.parser.HtmlToTextConverter pHtmlToTextConverter)

getQOAAService

public QOAAService getQOAAService()

setQOAAService

public void setQOAAService(QOAAService pQOAAService)

getRecommendedAnswerService

public RecommendedAnswerService getRecommendedAnswerService()

setRecommendedAnswerService

public void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)

getRecommendedReadingService

public RecommendedReadingService getRecommendedReadingService()

setRecommendedReadingService

public void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)

getSegmentService

public atg.svc.repository.service.SegmentService getSegmentService()

setSegmentService

public void setSegmentService(atg.svc.repository.service.SegmentService pSegmentService)

getSiteConfiguration

public SiteConfiguration getSiteConfiguration()

setSiteConfiguration

public void setSiteConfiguration(SiteConfiguration pSiteConfiguration)

setSolutionFieldDataService

public void setSolutionFieldDataService(atg.svc.repository.service.SolutionFieldDataServiceImpl pSolutionFieldDataService)

getSolutionFieldDataService

public atg.svc.repository.service.SolutionFieldDataServiceImpl getSolutionFieldDataService()

getSolutionMetadataService

public SolutionMetadataService getSolutionMetadataService()

setSolutionMetadataService

public void setSolutionMetadataService(SolutionMetadataService pSolutionMetadataService)

getSolutionRedirectService

public SolutionRedirectService getSolutionRedirectService()

setSolutionRedirectService

public void setSolutionRedirectService(SolutionRedirectService pSolutionRedirectService)

getSolutionScoringService

public SolutionScoringService getSolutionScoringService()

setSolutionScoringService

public void setSolutionScoringService(SolutionScoringService pSolutionScoringService)

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)

getTopicService

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

setTopicService

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

getTransactionalFragmentService

public TransactionalFragmentService getTransactionalFragmentService()

setTransactionalFragmentService

public void setTransactionalFragmentService(TransactionalFragmentService pTransactionalFragmentService)

getOptionService

public atg.svc.repository.service.OptionService getOptionService()

setOptionService

public void setOptionService(atg.svc.repository.service.OptionService pOptionService)

getVersionedKnowledgeHomesFactoryName

public java.lang.String getVersionedKnowledgeHomesFactoryName()
Gets the versioned KnowledgeHomesFactory. Need to retrieve the solution version number in getSolutionVersion(Solution)


setVersionedKnowledgeHomesFactoryName

public void setVersionedKnowledgeHomesFactoryName(java.lang.String pVersionedKnowledgeHomesFactoryName)

getViewedAnswerService

public ViewedAnswerService getViewedAnswerService()

setViewedAnswerService

public void setViewedAnswerService(ViewedAnswerService pViewedAnswerService)

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.


setCheckoutAttachmentsOnSave

public void setCheckoutAttachmentsOnSave(boolean pCheckoutAttachmentsOnSave)

getInternalOnlyFields

public java.lang.String[] getInternalOnlyFields()
Gets the list of field definition types that are internal only - their external audience is set to none.

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

setInternalOnlyFields

public void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)

getLanguage

public java.lang.String getLanguage()
The language (locale) code (e.g. en_US) to use when creating solution and solution events.


setLanguage

public void setLanguage(java.lang.String pLanguage)

isValidateOnSaveSolution

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


setValidateOnSaveSolution

public void setValidateOnSaveSolution(boolean pValidateOnSaveSolution)

isRemoveSolutionReferencesOnDelete

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


setRemoveSolutionReferencesOnDelete

public void setRemoveSolutionReferencesOnDelete(boolean pRemoveSolutionReferencesOnDelete)

isIgnoreSecurityWhenComputingTitle

public boolean isIgnoreSecurityWhenComputingTitle()
Should we ignore security when computing the solution title NOTE: Migration sets ignoreSecurityWhenComputingTitle to true because statement security isn't migrated yet when the solution title is first computed.


setIgnoreSecurityWhenComputingTitle

public void setIgnoreSecurityWhenComputingTitle(boolean pIgnoreSecurityWhenComputingTitle)

getMaxDisplayedTitleLength

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


setMaxDisplayedTitleLength

public void setMaxDisplayedTitleLength(int pMaxDisplayedTitleLength)

getMaxComputedTitleLength

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


setMaxComputedTitleLength

public void setMaxComputedTitleLength(int pMaxComputedTitleLength)

getTruncatedTitleSuffix

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


setTruncatedTitleSuffix

public void setTruncatedTitleSuffix(java.lang.String pTruncatedTitleSuffix)

getSolutionById

public Solution getSolutionById(java.lang.String pId)
                         throws SvcException,
                                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 solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getSolutionByPrimaryKey

public Solution getSolutionByPrimaryKey(java.lang.String pId)
                                 throws SvcException,
                                        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 solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getSolutionByDisplayId

public Solution getSolutionByDisplayId(java.lang.String pDisplayId)
                                throws SvcException,
                                       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 solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getPublishedSolutionById

public Solution getPublishedSolutionById(java.lang.String pSolutionId)
                                  throws SvcException,
                                         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.
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getSolutionVersion

public java.lang.Integer getSolutionVersion(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 Solution createSolution(java.lang.String pSolutionClassId)
                        throws SvcException,
                               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 solution class is not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

createSolution

public Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass)
                        throws SvcException
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:
SvcException - If the create of the Solution or any SolutionField objects derived from the SolutionClass fails.

createSolutionBean

public Solution createSolutionBean(java.lang.String pSolutionClassId)
                            throws SvcException,
                                   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 solution class is not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

createSolutionBean

public Solution createSolutionBean(atg.svc.repository.beans.SolutionClass pSolutionClass)
                            throws SvcException
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:
SvcException - If an exception is thrown when the in-memory bean is created.

createSolution

public Solution createSolution(java.lang.String pSolutionClassId,
                               SolutionHomes pHomes)
                        throws SvcException,
                               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:
ObjectNotFoundException - if solution class is not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

createSolution

public Solution createSolution(atg.svc.repository.beans.SolutionClass pSolutionClass,
                               SolutionHomes pHomes)
                        throws SvcException
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:
SvcException - If the homes are repository and the repository create operation fails

editSolution

public Solution editSolution(java.lang.String pSolutionId)
                      throws SvcException,
                             ObjectNotFoundException
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 - if solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

deleteSolution

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

Parameters:
pSolutionId - The id of the solution to delete.
Throws:
ObjectNotFoundException - if solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

removeSolutionField

public void removeSolutionField(SolutionField pField)
                         throws SvcException
Removes a SolutionField and any associated SolutionFieldValue objects from the repository.

Parameters:
pField - The SolutionField to remove.
Throws:
SvcException - If the remove operation fails.

copySolution

public Solution copySolution(Solution pSrcSolution)
                      throws SvcException
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:
SvcException - If the create operation fails.

copySolutionAsNew

public Solution copySolutionAsNew(java.lang.String pTemplateSolutionId)
                           throws SvcException,
                                  ObjectNotFoundException,
                                  javax.ejb.CreateException,
                                  atg.beans.PropertyNotFoundException
Creates a new solution bean based on the template solution provided

Parameters:
pTemplateSolutionId - The Solution ID to use as a template.
Throws:
SvcException
ObjectNotFoundException
javax.ejb.CreateException
atg.beans.PropertyNotFoundException

createSolutionReferences

protected java.util.List<SolutionRelevance> createSolutionReferences(Solution pSolution)
                                                              throws SvcException
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:
SvcException

getSolutionReferences

public java.util.List<javax.ejb.EJBLocalObject> getSolutionReferences(java.lang.String pSolutionId)
                                                               throws SvcException
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 (QOAA, RecommendedReading, FavoriteQuery) that refer to the given solution.
Throws:
SvcException
See Also:
QOAA, RecommendedReading, Favorites

saveSolution

public void saveSolution(Solution pSolution)
                  throws SvcException
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:
SvcException

switchSolutionClass

public void switchSolutionClass(java.lang.String pSolutionClassId,
                                Solution pSolution)
                         throws SvcException
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 solution class is not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

computeTitle

public java.lang.String computeTitle(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(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,
                     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<java.lang.String> pTopicIds,
                           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(Solution pSolution,
                                  java.lang.String pFieldName,
                                  java.lang.String[] pSolutionFieldValueIds)
                           throws SvcException,
                                  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:
SvcException - If the create of a new SolutionFieldValue fails.
atg.beans.PropertyNotFoundException - If the SolutionField with the given name does not exist on the Solution.

isSolutionVisibleForCurrentUser

public boolean isSolutionVisibleForCurrentUser(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(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 SvcException
Creates a new SolutionFieldValue repository impl.

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

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinitionType pType)
                                            throws SvcException
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:
SvcException - If the SolutionFieldValue is a repository object and the create operation fails.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(SolutionField pField)
                                            throws SvcException
Creates a SolutionFieldValue for the given SolutionField.

Parameters:
pField - The field to create the SolutionFieldValue for.
Returns:
The SolutionFieldValue impl.
Throws:
SvcException - 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 SvcException
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:
SvcException - 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 solution field value is not found

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 SvcException,
                                                                     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 solution not found
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getSegmentsByValueMatch

public java.lang.String[] getSegmentsByValueMatch(java.lang.String pSolutionId,
                                                  java.lang.String pFieldName,
                                                  java.lang.Object pFieldValue)
                                           throws SvcException,
                                                  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.
atg.svc.repository.service.exception.SvcException - for all other errors
SvcException

getExternallyVisiblePropertyFields

public java.util.List<SolutionField> getExternallyVisiblePropertyFields(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<SolutionField> getExternallyVisibleContentFields(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<SolutionField> getExternallyVisibleStatementFields(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.

getAllSolutions

public java.util.Collection getAllSolutions()
                                     throws javax.ejb.EJBException,
                                            javax.ejb.FinderException
Throws:
javax.ejb.EJBException
javax.ejb.FinderException

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 SolutionStatus is not found
SvcException - If the id is not found.

createSolutionStatus

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

Returns:
A solution status BeanImpl.
Throws:
atg.svc.repository.service.exception.SvcException - If the create fails.
SvcException

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 - if the soltuion status is not found

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 SvcException,
                                 ObjectNotFoundException
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.
atg.svc.repository.service.exception.SvcException - If the delete fails.
SvcException

getSolutionTopics

public java.util.Set<atg.searchadmin.repository.beans.Topic> getSolutionTopics(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 SvcException,
                               ObjectNotFoundException
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 - if source or target solution is not found
SvcException - for all other errors

updateCustomFields

public void updateCustomFields(Solution pSolution,
                               java.util.Map<java.lang.String,SolutionField> pFields)
                        throws SvcException,
                               ObjectNotFoundException
Takes the solution field map and stores it as encoded data on the Solution.encodedFieldData property of the solution.

Parameters:
pSolution - The solution to update
pFields - The field values to store
Throws:
SolutionFieldStorageException
PersistenceException
SvcException
ObjectNotFoundException

addSolutionField

public void addSolutionField(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition,
                             Solution pSolution)
                      throws SvcException
Adds a new SolutionField to a Solution given the field metadata (SolutionClassFieldDefinition).

Parameters:
pSolutionClassFieldDefinition - The solution field metadata.
pSolution - The solution to add the field.
Throws:
SvcException - If the create fails.

createSolutionField

public SolutionField createSolutionField(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition,
                                         SolutionHomes pHomes)
                                  throws SvcException
Creates a new SolutionField based on the given SolutionClassFieldDefinition.

Parameters:
pSolutionClassFieldDefinition - The solution field metadata
pHomes - The homes to use for the create
Returns:
The SolutionField implementation
Throws:
SvcException - If the create fails
atg.service.idgen.IdGeneratorException

getSolutionsByOwningGroupOrgId

public java.util.Collection<Solution> 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 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<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.

assignSolutionDefaultValues

public void assignSolutionDefaultValues(Solution pSolution)