RC class.
Available providers
Below is a section from the web.config file.ResourceDllProvider.
- FieldLabelProvider - The field label provider supports customization using the SOADMIN client. Replacement text labels are stored in the database in the LocaleText table. This provider handles the label customization rules.
- CurrentValueProvider - This provider will provide us with current values of a given user. Current values mean the current contact of a given user, the month of a given user in the calendar, the current follow-up of a given user and so on. For example the current company name is used in the menu as: - <caption>[SR_MENU_SELECTION_GOTO_CONTACT] [current:contact_name]</caption>
- TemplateTagProvider - The tags of the document templates of the Six Web application will be provided by this provider. The Template tags are defined for use in the document templates. They represent complex strings computed from the current values. For example, [name] is the name of the current company. [cont] is the name of the current company’s our-contact.
- Note that template tags may trigger several agent calls to compute the results.
- PreferenceValueProvider - This is the provider that will provide us with the preference values of a given user. For example Splitter positions will determine the size of the cards that appear in a give page of the application.
Example use
ThroughoutSuperOffice CRM, string resources are used extensively wherever common text appears. Below is an example from the SoContactPanel.config file. The UI is declared in SuperOffice Markup Language (SOML) configuration files, where the UI elements are declared using XML. Resource strings are used a lot and appear obvious everywhere there is text inside square brackets. The example is even more recognizable by the binding attributebinding="resources".
caption tag it does not give us the actual caption instead it gives a string that is formatted in a specific way. So when the application encounters a string like this in its config file, the resource mechanism comes into play.
What the application will do when it encounters a string like this it will call the appropriate resource DLL to find the actual string that matches the string “SR_MORE_CONTACT” in the XML file. The application will find the correct XML file from the language that we select when we log into the system.
Add your own resources
Now since SuperOffice has provided us with aResourceDllProvider, we are able to add our own resources and be able to show them in a given page. There are 3 ways that we can do this:
-
We can write our own ResourceDllProvider and add it to the config file so that it will read the resource files the way we want. If we are developing our own
ResourceDllProviderwe have to implement theIResourceProviderinterface in order to maintain the common interface between other components of the system. -
The second method is we can use the SuperOffice
ResourceDllProvideras it is and develop our own language resource satellite assemblies. To do this we need to specify the name of the new DLL as the parameter in the config file. For example if we want to add new strings to the French satellite assembly we can develop our own Resx files and then compile it to a satellite assembly. When we add our French satellite assembly next to the one already exists we should get the strings we added or modified. -
The third method is to use the
ResXmlFileProviderto provide custom strings without compiling them into resource DLLs. XML files are easier to edit but tend to be larger than the compiled DLL files.