org.kuali.ole.ingest
Class ProfileBuilder

java.lang.Object
  extended by org.kuali.ole.ingest.ProfileBuilder

public class ProfileBuilder
extends Object

ProfileBuilder is used to build the KRMS Agenda for the Profile xml which is used for Staff upload screen.


Constructor Summary
ProfileBuilder()
           
 
Method Summary
 org.kuali.rice.krms.impl.repository.ActionBo addActionToRule(String namespace, String actionName, String description, String actionTypeId, org.kuali.rice.krms.impl.repository.RuleBo ruleBo, Integer sequenceNumber)
          This method adds the action into rule to create the agenda.
 org.kuali.rice.krms.impl.repository.PropositionBo addCustomFunctionToPropositionParameter(String functionId, org.kuali.rice.krms.impl.repository.PropositionBo proposition)
          This method adds the customFunction into propositionParameter to create the rule and agenda.
 org.kuali.rice.krms.impl.repository.AgendaItemBo addDummyRuleForFalseAction(org.kuali.rice.krms.impl.repository.RuleBo ruleBo, org.kuali.rice.krms.impl.repository.RuleBo falseActionRuleBo)
          This method adds the dummy rule into database for falseAction.
 MatchBo addMatchBo(String agendaName, String termName, String docType, String incomingField, String existingField)
          This method adds the agendaName,docType,incomingField,existingField into MatchBo.
 org.kuali.rice.krms.impl.repository.AgendaBo addRuleToAgenda(org.kuali.rice.krms.impl.repository.AgendaBo agendaBo, org.kuali.rice.krms.impl.repository.RuleBo ruleBo)
          This method adds the rule to agenda.
 org.kuali.rice.krms.impl.repository.PropositionBo addTermToPropositionParameter(String termId, org.kuali.rice.krms.impl.repository.PropositionBo proposition)
          This method adds the term to propositionParameter to create the rule and agenda.
 Profile buildProfile(String fileName)
          This method builds the profile based on fileContent.
 Profile buildProfileFromFileContent(String fileContent)
          This method returns Profile build from fileContent.
 org.kuali.rice.krms.impl.repository.KrmsTypeBo createActionTypeService()
          This method create Bibliographic record action as type in the database for creating custom action.
 org.kuali.rice.krms.impl.repository.AgendaBo createAgenda(String agendaName, org.kuali.rice.krms.impl.repository.ContextBo contextBo)
          This method creates the agenda and persist in the database for the context.
 org.kuali.rice.krms.impl.repository.CategoryBo createCategory(String namespace, String categoryName)
          This method creates the category.
 org.kuali.rice.krms.impl.repository.ContextBo createContext(String namespace, String contextName)
          This method creates the context.
 org.kuali.rice.krms.impl.repository.FunctionBo createFunction(String namespace, String termName, String returnType, List categories)
          This method creates the custom function by using functionLoader.
 org.kuali.rice.krms.impl.repository.PropositionBo createProposition(String categoryId, String propositionDescription, String propositionType, org.kuali.rice.krms.impl.repository.RuleBo rule)
          This method creates the simple or compound proposition.
 org.kuali.rice.krms.impl.repository.RuleBo createRule(String namespace, String ruleName)
          This method creates the rule for the ruleName.
 org.kuali.rice.krms.impl.repository.TermBo createTerm(String name, org.kuali.rice.krms.impl.repository.TermSpecificationBo termSpecificationBo)
          This method creates the term for each termSpecification.
 org.kuali.rice.krms.impl.repository.KrmsTypeBo createTermResolverTypeService()
          This method creates profileTermResolverType record as type in database for creating custom action.
 org.kuali.rice.krms.impl.repository.TermSpecificationBo createTermSpecification(String namespace, String termSpecificationName, String type, List<org.kuali.rice.krms.impl.repository.CategoryBo> categoryBoList, List<org.kuali.rice.krms.impl.repository.ContextBo> contextBoList)
          This method creates the term specifications .
 void deleteAgenda(Profile profile)
          To clear Profile Data if Profile already Exists
 Boolean doesProfileExist(String profileName)
          This method returns True/False.
 ProfileObjectGeneratorFromXML getProfileObjectGeneratorFromXML()
          Gets the profileObjectGeneratorFromXML attribute.
 Object objectExists(Class objectClass, String key, String value)
          This method returns the object
 String persist(Profile profile)
          This method creates context,category,rules,preposition,term and action for creating agenda and finally persisted into database.
 String persistKRMSProfile(String profileFileName)
          This method persists the KRMSProfile into database.
 String persistKRMSProfileFromFileContent(String fileContent)
          This method persists the KRMSProfile got from fileContent into the database.
 void registerDefaultFunctionLoader()
          This method creates function loader type in the database for creating custom function.
 org.kuali.rice.krms.impl.repository.ContextValidActionBo registerDefaultServiceTypes(org.kuali.rice.krms.impl.repository.ContextBo contextBo)
          This method registers the default service types in the database for the context.
 void registerDefaultTermResolvers(List<org.kuali.rice.krms.impl.repository.ContextBo> contextBos, List<org.kuali.rice.krms.impl.repository.CategoryBo> categoryBos)
          This method creates the termResolver for ExistingField and IncomingField based on category and context.
 void setProfileObjectGeneratorFromXML(ProfileObjectGeneratorFromXML profileObjectGeneratorFromXML)
          Sets the profileObjectGeneratorFromXML attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileBuilder

public ProfileBuilder()
Method Detail

createContext

public org.kuali.rice.krms.impl.repository.ContextBo createContext(String namespace,
                                                                   String contextName)
This method creates the context.

Parameters:
namespace -
contextName -
Returns:
contextBo

registerDefaultServiceTypes

public org.kuali.rice.krms.impl.repository.ContextValidActionBo registerDefaultServiceTypes(org.kuali.rice.krms.impl.repository.ContextBo contextBo)
This method registers the default service types in the database for the context.

Parameters:
contextBo -
Returns:
contextValidActionBo

createActionTypeService

public org.kuali.rice.krms.impl.repository.KrmsTypeBo createActionTypeService()
This method create Bibliographic record action as type in the database for creating custom action.

Returns:
actionTypeService

createTermResolverTypeService

public org.kuali.rice.krms.impl.repository.KrmsTypeBo createTermResolverTypeService()
This method creates profileTermResolverType record as type in database for creating custom action.

Returns:
profileTermResolverTypeService

createCategory

public org.kuali.rice.krms.impl.repository.CategoryBo createCategory(String namespace,
                                                                     String categoryName)
This method creates the category. If category name already exists it returns the category else it returns new category.

Parameters:
namespace -
categoryName -
Returns:
categoryBo

createTermSpecification

public org.kuali.rice.krms.impl.repository.TermSpecificationBo createTermSpecification(String namespace,
                                                                                       String termSpecificationName,
                                                                                       String type,
                                                                                       List<org.kuali.rice.krms.impl.repository.CategoryBo> categoryBoList,
                                                                                       List<org.kuali.rice.krms.impl.repository.ContextBo> contextBoList)
This method creates the term specifications . If the term already exists in termSpecificationBo then it will return that object else it will create new termSpecificationBo.

Parameters:
namespace -
termSpecificationName -
type -
categoryBoList -
contextBoList -
Returns:
termSpecificationBo

createTerm

public org.kuali.rice.krms.impl.repository.TermBo createTerm(String name,
                                                             org.kuali.rice.krms.impl.repository.TermSpecificationBo termSpecificationBo)
This method creates the term for each termSpecification.

Parameters:
name -
termSpecificationBo -
Returns:
termBo

createFunction

public org.kuali.rice.krms.impl.repository.FunctionBo createFunction(String namespace,
                                                                     String termName,
                                                                     String returnType,
                                                                     List categories)
This method creates the custom function by using functionLoader.

Parameters:
namespace -
termName -
returnType -
categories -
Returns:
functionBo

createProposition

public org.kuali.rice.krms.impl.repository.PropositionBo createProposition(String categoryId,
                                                                           String propositionDescription,
                                                                           String propositionType,
                                                                           org.kuali.rice.krms.impl.repository.RuleBo rule)
This method creates the simple or compound proposition.

Parameters:
categoryId -
propositionDescription -
propositionType -
rule -
Returns:
propositionBo

createRule

public org.kuali.rice.krms.impl.repository.RuleBo createRule(String namespace,
                                                             String ruleName)
This method creates the rule for the ruleName. if the rule already exists then it will return that object else it return new rule.

Parameters:
namespace -
ruleName -
Returns:
ruleBo

addActionToRule

public org.kuali.rice.krms.impl.repository.ActionBo addActionToRule(String namespace,
                                                                    String actionName,
                                                                    String description,
                                                                    String actionTypeId,
                                                                    org.kuali.rice.krms.impl.repository.RuleBo ruleBo,
                                                                    Integer sequenceNumber)
This method adds the action into rule to create the agenda.

Parameters:
namespace -
actionName -
description -
actionTypeId -
ruleBo -
sequenceNumber -
Returns:
actionBo

addCustomFunctionToPropositionParameter

public org.kuali.rice.krms.impl.repository.PropositionBo addCustomFunctionToPropositionParameter(String functionId,
                                                                                                 org.kuali.rice.krms.impl.repository.PropositionBo proposition)
This method adds the customFunction into propositionParameter to create the rule and agenda.

Parameters:
functionId -
proposition -
Returns:
proposition

addTermToPropositionParameter

public org.kuali.rice.krms.impl.repository.PropositionBo addTermToPropositionParameter(String termId,
                                                                                       org.kuali.rice.krms.impl.repository.PropositionBo proposition)
This method adds the term to propositionParameter to create the rule and agenda.

Parameters:
termId -
proposition -
Returns:
proposition

createAgenda

public org.kuali.rice.krms.impl.repository.AgendaBo createAgenda(String agendaName,
                                                                 org.kuali.rice.krms.impl.repository.ContextBo contextBo)
This method creates the agenda and persist in the database for the context.

Parameters:
agendaName -
contextBo -
Returns:
agendaBo

addRuleToAgenda

public org.kuali.rice.krms.impl.repository.AgendaBo addRuleToAgenda(org.kuali.rice.krms.impl.repository.AgendaBo agendaBo,
                                                                    org.kuali.rice.krms.impl.repository.RuleBo ruleBo)
This method adds the rule to agenda.

Parameters:
agendaBo -
ruleBo -
Returns:
agendaBo

addDummyRuleForFalseAction

public org.kuali.rice.krms.impl.repository.AgendaItemBo addDummyRuleForFalseAction(org.kuali.rice.krms.impl.repository.RuleBo ruleBo,
                                                                                   org.kuali.rice.krms.impl.repository.RuleBo falseActionRuleBo)
This method adds the dummy rule into database for falseAction.

Parameters:
ruleBo -
falseActionRuleBo -
Returns:
existingAgendaItemBo

addMatchBo

public MatchBo addMatchBo(String agendaName,
                          String termName,
                          String docType,
                          String incomingField,
                          String existingField)
This method adds the agendaName,docType,incomingField,existingField into MatchBo.

Parameters:
agendaName -
termName -
docType -
incomingField -
existingField -
Returns:
matchBo

buildProfileFromFileContent

public Profile buildProfileFromFileContent(String fileContent)
                                    throws URISyntaxException,
                                           IOException
This method returns Profile build from fileContent.

Parameters:
fileContent -
Returns:
Profile
Throws:
URISyntaxException
IOException

buildProfile

public Profile buildProfile(String fileName)
                     throws URISyntaxException,
                            IOException,
                            SAXException
This method builds the profile based on fileContent.

Parameters:
fileName -
Returns:
Profile
Throws:
URISyntaxException
IOException
SAXException

persistKRMSProfileFromFileContent

public String persistKRMSProfileFromFileContent(String fileContent)
                                         throws IOException,
                                                URISyntaxException
This method persists the KRMSProfile got from fileContent into the database.

Parameters:
fileContent -
Returns:
name
Throws:
IOException
URISyntaxException

persistKRMSProfile

public String persistKRMSProfile(String profileFileName)
                          throws IOException,
                                 URISyntaxException,
                                 SAXException
This method persists the KRMSProfile into database.

Parameters:
profileFileName -
Returns:
name
Throws:
IOException
URISyntaxException
SAXException

persist

public String persist(Profile profile)
This method creates context,category,rules,preposition,term and action for creating agenda and finally persisted into database.

Parameters:
profile -
Returns:
name

registerDefaultFunctionLoader

public void registerDefaultFunctionLoader()
This method creates function loader type in the database for creating custom function.


registerDefaultTermResolvers

public void registerDefaultTermResolvers(List<org.kuali.rice.krms.impl.repository.ContextBo> contextBos,
                                         List<org.kuali.rice.krms.impl.repository.CategoryBo> categoryBos)
This method creates the termResolver for ExistingField and IncomingField based on category and context.

Parameters:
contextBos -
categoryBos -

objectExists

public Object objectExists(Class objectClass,
                           String key,
                           String value)
This method returns the object

Parameters:
objectClass -
key -
value -
Returns:
This method returns object if exists in db, if not returns null.

deleteAgenda

public void deleteAgenda(Profile profile)
To clear Profile Data if Profile already Exists

Parameters:
profile -

doesProfileExist

public Boolean doesProfileExist(String profileName)
This method returns True/False. This method checks the existence of profileName with the help of BusinessObjectService.

Parameters:
profileName -
Returns:
Boolean

getProfileObjectGeneratorFromXML

public ProfileObjectGeneratorFromXML getProfileObjectGeneratorFromXML()
Gets the profileObjectGeneratorFromXML attribute. if profileObjectGeneratorFromXML is null it will create a new instance else it will return existing instance.

Returns:
profileObjectGeneratorFromXML

setProfileObjectGeneratorFromXML

public void setProfileObjectGeneratorFromXML(ProfileObjectGeneratorFromXML profileObjectGeneratorFromXML)
Sets the profileObjectGeneratorFromXML attribute value.

Parameters:
profileObjectGeneratorFromXML -


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.