...
Expand |
---|
|
keys used: key_new, key_set_privacy_level Code Block |
---|
language | xml |
---|
title | Summary page actions |
---|
| <actions>
<action>
<caption>key_new</caption>
<topmenu>true</topmenu>
<link>page.do?xml=communications/communication&act=new&jndi=ejb/CRMUICommunication&fc=createButton&pvc=0</link>
</action>
<action>
<caption>key_set_privacy_level</caption>
<modal>true</modal>
<link>javascript:displayModalCreate('communications/setPrivacyLevel','ejb/CRMUICommunication','loadPrivacyLevelForm','java.util.ArrayList@[[SummaryComponent_((component))]]','edit',null,'','')</link>
</action>
</actions> |
|
Data Entry Pages
This section shows how to use the Glossary Mechanism when creating data entry pages.
Definition File
In data entry definition files, all name, label, sidelabel, truelabel, falselabel, tipexpression tags must contain only keys in order for their values to be translated by the glossary mechanism.
...
The following example demonstrates how to make use of the glossary mechanism when defining the title of a data entry page.
Expand |
---|
|
keys used: key_communication
Code Block |
---|
language | xml |
---|
title | Data entry page title |
---|
| <?xml version="1.0" encoding="UTF-8"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/dataEntry.xsd">
<id>communications/communications</id>
<name>key_communication</name>
<datapath>number</datapath>
.
.
.
</page> |
|
...
The following examples demonstrate how to make use of the glossary mechanism when implementing the main menu of a data entry page.
Expand |
---|
|
keys used: key_new
Code Block |
---|
language | xml |
---|
title | New menu option |
---|
| <mainmenu>
<components>
<component>
<id>cmpNew</id>
<name>key_new</name>
<visiblemodes>read</visiblemodes>
<hideinmodal>true</hideinmodal>
<elements>
<button>
<id>btnNew</id>
<name>key_new</name>
.
.
.
</button>
</elements>
</component>
.
.
.
</components>
</mainmenu> |
|
...
- searchcaption and label tags should always contain a key in order for their values to be translated by the glossary mechanism.
- displaytype tag should make use of keys to define the available search criterion options.
...
Expand |
---|
|
keys used: key_search_accounts_receivable, key_life_cycle_state, key_active, key_suspended, key_terminated
Code Block |
---|
language | xml |
---|
title | search page |
---|
| <searchcaption>key_search_accounts_receivable</searchcaption>
.
.
.
<fields>
<fielditem>
<field>ACCOUNTSRECEIVABLE.LIFECYCLESTATE</field>
<label>key_life_cycle_state</label>
<expression>VALUE</expression>
<datatype>ftXString</datatype>
<fieldlen>10</fieldlen>
<searchcriteria>1</searchcriteria>
<visible>1</visible>
<executable>1</executable>
<displaytype>combobox;;;ACTIVE;key_active;SUSPENDED;key_suspended;TERMINATED;key_terminated</displaytype>
<indexorder>50</indexorder>
</fielditem>
.
.
.
</fields>
.
.
. |
|
...
Expand |
---|
title | Module printouts example |
---|
|
keys used: key_warranty, key_view_the_warranty_policy_printout
Code Block |
---|
language | xml |
---|
title | Module printout |
---|
| <printouts>
<printout>
<id>WARRANTY_PRINTOUT</id>
<name>key_warranty</name>
<description>key_view_the_warranty_policy_printout</description>
<printoutfilename>InstalledItems/warranty_policy_printout.jrxml</printoutfilename>
<entityid>INSTALLEDITEMS</entityid>
</printout>
.
.
.
</printouts> |
|
Exceptions
This section shows how to use the Glossary Mechanism when creating exceptions.
The following examples demonstrate how to make use of the glossary mechanism when defining and throw an exception.
Expand |
---|
title | Defining an exception example |
---|
|
1. Create the exception class. Code Block |
---|
language | java |
---|
title | Exception class |
---|
| public class OnlyOneRecordException extends CRMValidationException {
/**
* Only one %1 %2 must be specified.
*
* @param crmSession - the session object
* @param value1 - the exception first value
* @param value2 - the exception second value
* @throws Exception
*/
public OnlyOneRecordException(CRMSession crmSession, String value1,String value2) throws Exception {
super();
ArrayList<String> parameters = new ArrayList<String>();
parameters.add(value1);
parameters.add(value2);
try
{
setMessage(this.getClass().getName().toUpperCase(), crmSession, parameters);
}
catch (Exception e)
{
e.printStackTrace();
}
}
} |
2. Define the exception in the messages.xmlfile. Use a unique key for the expression tag. Keys used: key_com_crm_exception_onlyonerecordexception Code Block |
---|
language | xml |
---|
title | messages.xml |
---|
| <messages>
<message>
<code>COM.CRM.EXCEPTION.ONLYONERECORDEXCEPTION</code>
<expression>key_com_crm_exception_onlyonerecordexception</expression>
<description>Only one record must be specified.</description>
</message>
.
.
.
</messages> |
3. Define the exception in the properties file, by using the expression tag key defined in metadata messages file as the entry key, and specifying the exception message. Code Block |
---|
language | xml |
---|
title | translation_eng.properties |
---|
| <properties>
<entry key="key_com_crm_exception_onlyonerecordexception">Only one %1 %2 must be specified.</entry>
.
.
.
</properties> |
|
...
This section shows how to use the Glossary Mechanism when defining mandatory while creating business object classes.
Expand |
---|
title | Mandatory fields example |
---|
|
keys used: key_website Code Block |
---|
language | java |
---|
title | CRMBOWebCustomerEventBean |
---|
| @Override
protected LinkedHashMap<String, String> getMandatoryFields(CRMDO dto) throws Exception {
LinkedHashMap<String, String> mandatoryFields = new LinkedHashMap<String, String>();
mandatoryFields.putAll(super.getMandatoryFields(dto));
mandatoryFields.put("key_website", "website");
return mandatoryFields;
} |
|