![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Version
WORK in PROGRESS
Table of Contents 1.2 What do you need to understand this book 6 3 Adapting the openCRX HTML GUI to Your Needs 8 3.1 Overview openCRX GUI Types 8 3.2 Customizing Options openCRX HTML GUI 9 3.3 Things to do before you start Customizing openCRX 10 3.4 Limitations of the generic HTML GUI 11 4.1.1 File Overloading at the Project Level 13 4.1.2 UI Configuration Overloading 13 4.1.3 Code Table Overloading 13 4.2 “Adding” Fields / Extending Objects 14 4.2.1 User-definable attributes of CrxObject 14 4.2.2 Property Data Bindings 15 5.1 Enabling/Disabling Packages at the Application Level 16 5.2 Enabling/Disabling Packages at the User Level 17 6.1 Enabling/Disabling Locales at the Application Level 18 6.2 Setting the Default Locale at the User Level 19 7 CSS, Headers, Footers, etc. 20 7.2 HTML Header and Footer Files 21 8.2 UI Configuration Overloading 23 8.3.1 Elements of an Inspector 23 8.4.3.1 Enabling/Disabling Attributes 23 8.4.3.2 Positioning of Attributes (order, orderFieldGroup) 23 8.4.3.4 AlternateElementDefinition 23 8.5.1.1 Positioning of Tabs in a Grid Pane 24 8.5.1.2 Expanding/Collapsing Tabs 24 8.5.1.3 AdditionalElementDefinition 24 8.5.1.4 XML Filter Definitions 24 8.5.2 Object Row Attributes 24 8.5.2.1 Ordering of Attributes (order, orderObjectContainer) 24 8.5.2.2 Selection of Visible Attributes (showMaxMember) 24 8.5.2.3 Selection of Filterable Attributes (maxMember) 24 8.5.2.4 Advanced Attribute Selection (showMemberRange) 24 8.6 Various XML Tags Explained 25 8.6.18 orderObjectContainer 27 8.7.1.1 A comprehensive example with PropertyDataBindings 28 8.7.1.2 BooleanPropertyDataBinding 35 8.7.1.3 IntegerPropertyDataBinding 35 8.7.1.4 DecimalPropertyDataBinding 35 8.7.1.5 StringPropertyDataBinding 35 8.7.1.6 DatePropertyDataBinding 35 8.7.1.7 DateTimePropertyDataBinding 35 8.7.1.8 ReferencePropertyDataBinding 35 8.7.2 DataBinding ProductConfigurationSet 36 8.7.3 DataBinding ProductConfigurationTypeSet 36 8.7.4 DataBindings with Referenced Objects 36 8.7.5 DataBindungs with Composite Objects 36 8.7.6 DataBindings for Addresses 36 8.7.6.1 EmailAddressDataBinding 36 8.7.6.2 PhoneNumberDataBinding 36 8.7.6.3 WebAddressDataBinding 36 8.7.7 DataBindings Example Grid: 36 8.7.8 DataBinding AssignedActivityGroupsDataBinding 37 8.7.9 DataBinding FilteredActivitiesDataBinding 37 8.7.10 DataBinding FormattedNoteDataBinding 37 9.2.1 Adding Codes to Existing Code Tables 38 9.2.2 Disabling Existing Codes 38 9.2.3 Replacing Existing Code Tables 38 9.3 Segment-Specific Code Tables 38 10.1 MenuOps – openCRX Operations Menu 39 10.2 Navigation – openCRX Breadcrum 39 10.3 North – openCRX Header 39 10.4 RootMenu – openCRX Top Level Tabbed Menu 39 10.5 RootPanel – openCRX Top Level PopUp Menu 39 10.6 Search – openCRX Index-based Search 39 14 Advanced Customizing Options 43 14.5 Application Logic Extensions 43
List of Figures Figure 1: Types of openCRX GUIs 8 Figure 2: Non-Java GUIs for openCRX 8 Figure 3: openCRX Servlets enabling access with third-party clients 9 Figure 4: Customizing Options – openCRX Standard HTML GUI 9 Figure 5: openCRX Development and Customizing with Custom Project 12 Figure 6: UML Model - CrxObject 14 Figure 7: Add the string field Y!M nick to Contact objects 14 Figure 8: Launch Wizard User Settings 17 Figure 9: Wizard User Settings – enable/disable Root Menu Entries 17 Figure 10: Set Default Locale by Saving User Settings 19 Figure 11: Sample Extension of class Product with PropertyDataBindings 32 Figure 12: Sample Extension of class Product with PropertyDataBindings 33 Figure 13: Property Set Extension 34
List of Listings Listing 1: UI Customizing File zorder_contact.xml 15 Listing 2: List of Packages in web.xml 16 Listing 3: Enabling/Disabling Packages in web.xml 16 Listing 4: Locales in web.xml 18 Listing 5: Activating/Deactivating Locales in web.xml 18 Listing 6: Active Locales in Login.jsp 19 Listing 7: UI Customizing File zorder_product.xml 28 Listing 8: uiRefreshRate in web.xml 44 Listing 9: load-on-startup in web.xml 44 Listing 10: sesstion-timeout in web.xml 45 Listing 11: transport-guarantee in web.xml 45
1 About this BookThis book describes various ways of customizing the openCRX Standard HTML GUI to adapt the look and feel to your personal tastes and preferences or to your company's CI (corporate identity). openCRX is the leading enterprise-class open source CRM suite. openCRX is based on openMDX, an open source MDA framework based on the OMG's model driven architecture (MDA) standards. This guarantees total openness, standards compliance, a state-of-the-art component-based architecture, and virtually unlimited scalability. 1.1 Who this book is forThe intended audience are openCRX administrators and advanced users. 1.2 What do you need to understand this bookIt is helpful to have a good understanding of the openCRX architecture. We assume that you are able to read/understand the openCRX UML models and the openCRX Javadoc (Java API). It is also assumed that you are familiar with XML files and you should know how to program JSPs. 1.3 Tips, Warnings, etc.We make use the following pictograms:
2 PrerequisitesTo work through some of the examples and in particular to build your own customized openCRX, there as some prerequisites:
You can either follow the openCRX Server Installer documentation at http://www.opencrx.org/server.htm or you can do a manual installation of openCRX following the QuickStart guide.
Follow the openCRX SDK Installer documentation at http://www.opencrx.org/sdk.htm.
If you decide to
manipulate files directly in the apps folder, the same files are
contained in one of the subdirectories of the
directory 3 Adapting the openCRX HTML GUI to Your Needs3.1 Overview openCRX GUI TypesopenCRX is distributed with a generic HTML GUI (based on openMDX/portal) that connects to the openCRX API as shown below: Figure 1: Types of openCRX GUIs This Ajax-enabled HTML GUI supports a wide range of modern browsers, including Firefox, Opera, Safari, Google Chrome, KDE Konqueror, and IE. It goes without saying that you can also program your own custom GUI. openCRX/store is an example DHTML GUI consisting of a set of manually programmed JSPs connecting to the openCRX API. It is also possible to develop non-Java-based GUIs for openCRX. You could – for example – write an XML-RRC Adapter (see Apache XML-RPC): Figure 2: Non-Java GUIs for openCRX Another option you might consider is REST (Representational State Transfer); see also http://www.opencrx.org/opencrx/2.3/new.htm#REST . openCRX also includes a set of servlets (ical, imap, vcard, rest, news, ...) so that you can connect to openCRX with a wide range of specialized third-party clients like Mozilla Thunderbird, MS Outlook, KDE Kontact, and others: Figure 3: openCRX Servlets enabling access with third-party clients 3.2 Customizing Options openCRX HTML GUIThe openCRX Standard HTML GUI can be customized in many ways to suit your needs: Figure 4: Customizing Options – openCRX Standard HTML GUI Basic customizing options are relatively straight-forward and require no (or only moderate) programming know how. Advanced customizing options, however, require a good understanding of the openCRX architecture. This guide covers basic customizing options. If you're interested in advanced customizing options, have a look at the source code or consider attending an openCRX Developer Workshop (see www.opencrx.org for more information). 3.3 Things to do before you start Customizing openCRXAdapting openCRX to your needs typically involves the following steps:
Obviously, if you're only interested in changing some of the colors, there is not much to do in step 2 above. However, if you plan to capture your companies business processes, forms, etc. with openCRX, it pays off to spend some time on collecting the requirements and properly mapping them to openCRX before you get down to customizing...
3.4 Limitations of the generic HTML GUIEven though the openCRX HTML GUI is extremely flexible, we would like to point out a few limitations (not due to bad design, but rather we are looking at advanced features that have not been implemented yet). 3.4.1 Role-based UIopenCRX features UI perspectives, a mechanism that enables users to have different UI customizations based on the current role (e.g. one GUI for sales and another GUI for the back office). More information is available from http://www.opencrx.org/opencrx/2.3/new.htm#UIPerspectives. Obviously, the same goal can also be achieved with multiple web applications. Simply create a custom project for each role / customization and then deploy multiple web applications. 3.4.2 Model PermissionsModel permissions are not implemented yet. Hence you cannot control access to individual attributes of an object with simple customization (the openCRX security plugin controls access to complete objects, not to individual attributes of an object). You can, however, deploy multiple web applications or work with Layout JSPs to achieve the same goal. 4 Important HintsThe following information is so important that it deserves its own chapter! 4.1 OverloadingOverloading is a concept that allows you to selectively enhance (or even replace) features of the standard distribution of openCRX with your own changes and/or extensions.
Figure 5: openCRX Development and Customizing with Custom Project
4.1.1 File Overloading at the Project LevelTypically, files in your custom project will be added to the custom EARs. However, if a file in your custom project has the same name as a file of the standard distribution, your file will actually replace the respective file of the standard distribution when you build custom EARs.
4.1.2 UI Configuration OverloadingIt is likely that you want to change some of the default customizing. Quite possibly, however, (a) you want to make a few changes only and (b) you want to keep these changes if you upgrade to a new version of openCRX. This is where UI configuration overloading can add value. Instead of changing the original UI configuration files provided with the standard distribution you create a new configuration file (or multiple configuration files) containing all your changes. Make sure that you name your file(s) containing changed UI Element Definitions such that your changes are loaded AFTER the default configuration files, thereby overloading the original configuration. More information is available in chapter 8.2 UI Configuration Overloading. 4.1.3 Code Table OverloadingSimilar to UI configuration overloading, you can also overload code tables. Instead of changing original code tables you create new code table files that contain your changes/extensions. It is also possible to deactivate codes of the standard distribution. Make sure that you name your file(s) containing changed code tables such that your changes are loaded AFTER the default code tables, thereby overloading the code tables. More information is available in chapter 9.2 Code Table Overloading.
4.2 “Adding” Fields / Extending ObjectsEven though the openCRX UML Model covers a wide range of use cases, you may still come to the conclusion that you have to “add” a field to a particular object. While the newbie's approach would be to add a field to the appropriate database table and then patch the code a bit here and there, take our advice and make use of the advanced extension mechanisms provided by openCRX. 4.2.1 User-definable attributes of CrxObject
To make an example, let's assume your Contacts absolutely need another String field to store the Yahoo! Messenger Nickname as shown below: Figure 7: Add the string field Y!M nick to Contact objects All you have to do to “add” the field Y!M nick to Contacts is to deploy the following UI customizing file zorder_contact.xml to the directory {TOMCAT_INSTALL_DIR}/apps/opencrx-core-CRX/opencrx-core-CRX/WEB-INF/config/ui/Root/en_US and then restart Tomcat. Listing 1: UI Customizing File zorder_contact.xml <?xml
version="1.0"
encoding="UTF-8"?>
The above file is – strictly speaking – not adding a field to the class Contact, it is rather activating the attribute userString0 of the class Contact (which it inherits from the class CrxObject). The field userString0 is already available in the standard distribution of openCRX, it's just not visible.
4.2.2 Property Data BindingsWhat can you do if you need even more user-definable attributes, i.e. more than the ones provided by CrxObject? This is where the PropertyDataBinding concept comes in handy. With PropertyDataBindings you get access to a virtually unlimited pool of user-definable attributes. See chapter 8.7.1 PropertyDataBinding for a detailed introduction into this topic). 5 Managing Packages5.1 Enabling/Disabling Packages at the Application LevelWith the openCRX standard distribution all available packages are enabled. The openCRX administrator may wish to disable certain packages at the application level if they are not used. This chapter shows how you can achieve this. In the custom project sample, the package list is contained in the file: opencrx—custom\sample\src\data\org.opencrx.sample\WEB-INF\web.xml Once deployed on Tomcat, the package list is contained in the file apps\opencrx-core-CRX\opencrx-core-CRX\WEB-INF\web.xml Look for the section <!-- Admin --> to find a list of available packages: Listing 2: List of Packages in web.xml <!-- Admin
-->
You can disable packages by commenting them out (<!-- to open a comment and --> to close a comment). The following example shows how to deactivate the package depot1: Listing 3: Enabling/Disabling Packages in web.xml
...
5.2 Enabling/Disabling Packages at the User LevelIndividual user can enable/disable root menu entries with the wizard User Settings (available on a user's Homage): Figure 8: Launch Wizard User Settings Once the wizard has loaded, uncheck entries you don't need: Figure 9: Wizard User Settings – enable/disable Root Menu Entries
6 Managing LocalesThe default installation of openCRX activates all locales that are included in the Open Source distribution. The openCRX administrator may wish to deactivate certain locales from the locale list. This chapter shows how you can achieve this. 6.1 Enabling/Disabling Locales at the Application LevelThe locale list is contained in the file opencrx-core-CRX.ear\opencrx-core-CRX.war\WEB-INF\web.xml Look for the section <!-- locales --> to find a list of available locales: Listing 4: Locales in web.xml <!-- locales
-->
You can deactivate locales by simply commenting them out. The following example shows how to deactivate the locale de_CH. Listing 5: Activating/Deactivating Locales in web.xml <!-- locales
-->
As the Login page is displayed before the authentication of the user has taken place, Login.jsp cannot access the above information. That is why the list of available and active locales are maintained in the file localeSettings.jsp as well. Changing the list of active locales is straightforward. Simply comment out the relevant statements in the following code segment of localeSettings.jsp: Listing 6: Active Locales in Login.jsp ...
The above example shows how to disable the locales fa_IR and nl_NL in the Login page of openCRX.
6.2 Setting the Default Locale at the User LevelA user's default locale can be set by choosing/activating the desired locale and then clicking on [Save Settings] in the header of the application as shown below: Figure 10: Set Default Locale by Saving User Settings If the login page supports a user's preferred locale xx_YY, you can request the login page in that locale xx_YY by appending the string "?locale=xx_YY" to the default login URL. Example: the following URL loads the German login page: http://demo.opencrx.org/opencrx-core-CRX/Login?locale=de_CH 7 CSS, Headers, Footers, etc.7.1 Cascading Style SheetsThe directory ...\opencrx-core-CRX\_style contains various CSS files:
7.2 HTML Header and Footer FilesThe Layout JSPs and the login page (Login.jsp) by default include various HTML files. They are located in the directory ...\opencrx-core-CRX and you can adapt them to your liking:
See also chapter 13 Layout JSPs for additional information.
8 UI XML Files8.1 Overview8.2 UI Configuration Overloading8.3 Inspector8.3.1 Elements of an Inspector8.3.2 Labels / Tooltips8.3.3 Icons8.4 Attribute Pane8.4.1 Tabs8.4.2 Field Groups8.4.3 Fields / Attributes8.4.3.1 Enabling/Disabling Attributes8.4.3.2 Positioning of Attributes (order, orderFieldGroup)8.4.3.3 Column Breaks8.4.3.4 AlternateElementDefinition
8.5 Grid Panes8.5.1 Tabs8.5.1.1 Positioning of Tabs in a Grid Pane8.5.1.2 Expanding/Collapsing Tabs8.5.1.3 AdditionalElementDefinition8.5.1.4 XML Filter Definitions8.5.2 Object Row Attributes8.5.2.1 Ordering of Attributes (order, orderObjectContainer)8.5.2.2 Selection of Visible Attributes (showMaxMember)8.5.2.3 Selection of Filterable Attributes (maxMember)8.5.2.4 Advanced Attribute Selection (showMemberRange)
8.6 Various XML Tags Explained8.6.1 active8.6.2 backColor
8.6.3 changeable8.6.4 color
8.6.5 columnBreak
8.6.6 defaultValue
8.6.7 eventHandler8.6.8 filterable8.6.9 iconKey8.6.10 inPlace8.6.11 label8.6.12 mandatory
8.6.13 minValue8.6.14 maxMember8.6.15 maxValue8.6.16 order8.6.17 orderFieldGroup8.6.18 orderObjectContainer8.6.19 showMaxMember8.6.20 showMemberRange8.6.21 skipRow8.6.22 spanRow8.6.23 sortable8.6.24 toolTip
8.7 DataBindings8.7.1 PropertyDataBindingPropertyDataBindings provide you with access to a virtually unlimited pool of user-definable attributes to extend CrxObjects. From a performance point of view, PropertyDataBindings are not quite as efficient as the User-definable attributes of CrxObject because the latter are always stored in the same table as the extended object, whereas attributes based on PropertyDataBindings are stored in a separate table (leading to additional SELECT statements). Nevertheless, whenever you need additional attributes that cannot be mapped to user-definable attributes, you should still consider PropertyDataBindings before you jump at extending the openCRX core model.
8.7.1.1 A comprehensive example with PropertyDataBindingsThe following UI customizing file demonstrates how to extend the Product class with a set of attributes, one of each type. Deploy the file zorder_product.xml to the directory {TOMCAT_INSTALL_DIR}/apps/opencrx-core-CRX/opencrx-core-CRX/WEB-INF/config/ui/Root/en_US and then restart Tomcat. Listing 7: UI Customizing File zorder_product.xml <?xml
version="1.0"
encoding="UTF-8"?>
<org.openmdx.ui1.StructuralFeatureDefinition
qualifiedName="org:opencrx:kernel:product1:Product:Extension!myBoolean">
<_item>Extended Attributes (PropertyDataBinding)</_item>
<org.openmdx.ui1.ElementDefinition
name="org:opencrx:kernel:product1:Product:Extension!myDate">
Once Tomcat is up and running, navigate to the tab [Products] and create a new product as shown below: The screen for entering new products should now include a new field group labeled Extended Attributes (PropertyDateBinding) containing additional fields as shown below: Figure 11: Sample Extension of class Product with PropertyDataBindings Enter some data as follows:
Save to new product and then navigate to it. Expand the grid tabs in the first grid pane by clicking on the tab [>>]. You will see additional tabs like [Notes], [Folders], etc. Click on the tab [Property Sets] to see the entry Extension as shown below: Figure 12: Sample Extension of class Product with PropertyDataBindings The PropertySet Extension was created automatically when you saved the new product. It is called Extension because that is what was customized in the file zorder_product.xml. The PropertySet Extension contains all the attributes defined with PropertyDataBindings, i.e. myBoolean, myInteger, myDecimal, myString, myDate, myDateTime, and myReference. Let's verify this by clicking on the icon of the respective Property Set. You should see the following: Figure 13: Property Set Extension While all of these properties could be edited right within the Property Set, it is definitely more comfortable (and natural) to edit them within the attribute pane of products. Note that thi extension of the class Product did not require any modifications of the openCRX UML Model. We did not even have to modify the database schema. The whole extension is done with customizing features only! 8.7.1.2 BooleanPropertyDataBinding8.7.1.3 IntegerPropertyDataBinding8.7.1.4 DecimalPropertyDataBinding8.7.1.5 StringPropertyDataBinding8.7.1.6 DatePropertyDataBinding8.7.1.7 DateTimePropertyDataBinding8.7.1.8 ReferencePropertyDataBinding
8.7.2 DataBinding ProductConfigurationSet8.7.3 DataBinding ProductConfigurationTypeSet8.7.4 DataBindings with Referenced Objects8.7.5 DataBindungs with Composite Objects8.7.6 DataBindings for Addresses8.7.6.1 EmailAddressDataBinding8.7.6.2 PhoneNumberDataBinding8.7.6.3 WebAddressDataBinding8.7.7 DataBindings Example Grid:<featureDefinition> 8.7.8 DataBinding AssignedActivityGroupsDataBinding8.7.9 DataBinding FilteredActivitiesDataBinding8.7.10 DataBinding FormattedNoteDataBinding9 Code Table XML Files9.1 Overview9.2 Code Table Overloading9.2.1 Adding Codes to Existing Code Tables9.2.2 Disabling Existing Codes9.2.3 Replacing Existing Code Tables9.3 Segment-Specific Code Tables
10 Groovy Controls10.1 MenuOps – openCRX Operations Menu10.2 Navigation – openCRX Breadcrum10.3 North – openCRX Header10.4 RootMenu – openCRX Top Level Tabbed Menu10.5 RootPanel – openCRX Top Level PopUp Menu10.6 Search – openCRX Index-based Search
11 JSP WizardsSee the various examples in the directory ...\opencrx-core-CRX\wizards\en_US
12 FormsForms were introduced with openCRX v2.4. Have a look at the following examples included in the distribution:
13 Layout JSPsopenCRX is distributed with 2 default layout JSPs located in the directory ...\opencrx-core-CRX\WEB-INF\config\layout\en_US. 13.1 show-Default.jspThis layout JSP renders all pages that show information (typically an Inspector containing information about the current object and all the grids containing associated information). This layout JSP is generic and can handle any object. It is provided by openMDX/portal. 13.2 edit-Default.jspSimilarly, this layout JSP renders all pages that are used to edit objects and create new objects. This layout JSP is generic and can handle any object. It is provided by openMDX/portal. 13.3 Custom Layout JSPsIf you have a need for specialized screens for a particular object in edit and/or show mode, you can write your own layout JSP and deploy it to the above-mentioned directory. The file name of your custom layout JSP determines which objects (or rather: objects of which class) will be handled by your custom layout JSP. Example: Let's assume you want to replace the default edit screen for openCRX Contacts (i.e. class org.opencrx.kernel.account1.Contact) with a custom layout JSP. Name your file edit-org.opencrx.kernel.account1.Contact.jsp and deploy it to the directory ...\WEB-INF\config\layout\en_US. After restarting Tomcat or your application server your new layout JSP will be active.
14 Advanced Customizing Options14.1 Workflows14.2 Java Controls14.3 Portal Extensions14.4 UML Model Extensions14.5 Application Logic Extensions
15 Other Customizing OptionsA collection of useful configuration and customizing options. 15.1 web.xmlAll of the following settings can be made in the
file 15.1.1 uiRefreshRateBy default, the UI configuration is loaded at startup only. If you are changing customizing files during a customization session you might want to reload the UI periodically to verify your changes without restarting the servlet container. You can do so by setting the respective value to something else than 0. The refresh period is measured in milliseconds, i.e. the following example would cause the UI configuration to reload once per minute: Listing 8: uiRefreshRate in web.xml ...
15.1.2 load-on-startupBy default, the ObjectInspectorServlet is initialized with the first login (and hence the first login can take some time). If you prefer to initialize the ObjectInspectorServlet right after the deployment of the respective EAR, uncomment the following section in web.xml: Listing 9: load-on-startup in web.xml ...
15.1.3 session-timeoutBy default, the session timeout is set to 30 minutes. If you want to shorten or lengthen the session timeout you can do so by changing the value of session-timeout (measured in minutes) in web.xml. The following example shows how to change the timeout to 2 hours: Listing 10: sesstion-timeout in web.xml ...
15.1.4 transport-guaranteeIf you want to force your users to connect with SSL you can require a transport guarantee and replace the default value NONE with CONFIDENTIAL. The following example shows how to require the application admin (admin-Root) to connect with SSL: Listing 11: transport-guarantee in web.xml ...
16 Next StepsYou might want to have a look at some of the additional documentation published at http://www.opencrx.org/documents.htm. The openCRX Admin Guide might be of particular interest to you. License
The contents of this file are
subject to a BSD license (the "License"); you may not use
this file except in compliance with the License. You may obtain a
copy of the License at http://
Copyright 2009 ©
CRIXP Corp. All rights reserved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() |