Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleSearch Page using EJB method

 

Code Block
themeEclipse
languagexml
titleSearch Page
collapsetrue
<?xml version="1.0" encoding="UTF-8"?><dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/search.xsd">
	<searchcaption>key_priority_level</searchcaption>
	<classname>ejb/CRMUIServiceRequest</classname>
	<methodname>getPriorityLevels</methodname>
	
	<fields>
	
		<fielditem>
			<field>priorityLevelId</field>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>0</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<indexorder>10</indexorder>
		</fielditem>
		<fielditem>
			<field>priorityLevelName</field>
			<label>key_priority_level</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<indexorder>20</indexorder>
		</fielditem>
	</fields>
</dataset>
Code Block
themeEclipse
languagejava
titleEJB methodcollapsetrue
    /**
	 * Loads a list of service request priority levels filter with the input parameter
	 * 
	 * @param filter  - the filter to filter out the service request priority levels does not match
	 * @return            the list of service request priority levels
	 * @throws Exception
	 */
	public ArrayList<ServiceRequestPriotityLevel> getPriorityLevels(String filter) throws Exception {
		
		
		ArrayList<ServiceRequestPriotityLevel> priorityLevels = new ArrayList<ServiceRequestPriotityLevel>();
		CRMDOServiceRequestDefinition serviceRequestDefinition = (CRMDOServiceRequestDefinition)serviceRequestDefinitionBean.loadActiveDefinition();
		ArrayList<CRMDO> definitionPriorities = serviceRequestDefinitionPriorityBean.load(serviceRequestDefinition);
		if (filter!=null)
		{
			filter = filter.replace("%", "");
			filter = filter.replace("_", "");
		}
		if (definitionPriorities!=null && definitionPriorities.size() > 0)
		{
			for (int i=0; i<definitionPriorities.size(); i++)
			{
				CRMDOServiceRequestDefinitionPriority definitionPriority = (CRMDOServiceRequestDefinitionPriority)definitionPriorities.get(i);
				if(definitionPriority.getLabel()!=null)
				{	
					if (filter==null || filter.length() ==0 || definitionPriority.getLabel().toUpperCase().contains(filter.toUpperCase()))
					{
						ServiceRequestPriotityLevel serviceRequestPriotityLevel = new ServiceRequestPriotityLevel();
						serviceRequestPriotityLevel.setPriorityLevelId(definitionPriority.getPriorityCode());
						serviceRequestPriotityLevel.setPriorityLevelName(definitionPriority.getLabel());
						priorityLevels.add(serviceRequestPriotityLevel);
					}
				}
				else
				{	
					if (filter==null || filter.length() ==0 || definitionPriority.getPriorityCode().toString().toUpperCase().contains(filter.toUpperCase()))
					{
						ServiceRequestPriotityLevel serviceRequestPriotityLevel = new ServiceRequestPriotityLevel();
						serviceRequestPriotityLevel.setPriorityLevelId(definitionPriority.getPriorityCode());
						serviceRequestPriotityLevel.setPriorityLevelName(definitionPriority.getPriorityCode().toString());
						priorityLevels.add(serviceRequestPriotityLevel);
					}
				}
			}
		}
		
		return priorityLevels;
	}
Code Block
themeEclipse
languagejava
titleSearch results Data Objectcollapsetrue
public class ServiceRequestPriotityLevel extends NotPersistenceObject {
	private static final long serialVersionUID = 1L;
	
	private Integer priorityLevelId;
	private String priorityLevelName;
	
	public Integer getPriorityLevelId() {
		return priorityLevelId;
	}
	public void setPriorityLevelId(Integer priorityLevelId) {
		this.priorityLevelId = priorityLevelId;
	}
	public String getPriorityLevelName() {
		return priorityLevelName;
	}
	public void setPriorityLevelName(String priorityLevelName) {
		this.priorityLevelName = priorityLevelName;
	}
}