Historique de la page
...
- write a class that implements the interface org.esupportail.helpdesk.domain.computerUrl.ComputerUrlBuilder, for instance by inheriting of an existing class
- declarer a bean of this class in the configuration file /properties/domain/computerUrl.xml and add a reference to this bean in the attribute map of the bean computerUrlBuilderStore
- allow the automatic recovering of the new class and the configuration file /properties/domain/computerUrl.xml when upgrading (see Recovering previous configuration and customizations when upgrading).
Using several instances of GLPI
Let us assume here that a department named ENSSAT wants to use a new URL generator that will lead managers to their own GLPI instance.
Add two beans in /properties/domain/computerUrl.xml:
| Bloc de code |
|---|
<bean id="computerUrlBuilderStore"
class="org.esupportail.helpdesk.domain.computerUrl.ComputerUrlBuilderStoreImpl"
lazy-init="true"
>
<description>A store for the computer URL builders.</description>
<property name="map" >
<map>
<entry key="null" value-ref="nullComputerUrlBuilder" />
<entry key="glpi" value-ref="glpiComputerUrlBuilder" />
<entry key="glpiThroughCas" value-ref="glpiThroughCasComputerUrlBuilder" />
<entry key="enssatGlpi" value-ref="enssatGlpiComputerUrlBuilder" />
<entry key="enssatGlpiThroughCas" value-ref="enssatGlpiThroughCasComputerUrlBuilder" />
</map>
</property>
</bean>
...
<bean id="enssatGlpiComputerUrlBuilder"
parent="abstractComputerUrlBuilder"
class="org.esupportail.helpdesk.domain.computerUrl.PatternBasedComputerUrlBuilderImpl"
lazy-init="true"
>
<property name="pattern" value="\${computerUrl.lannionGlpiPattern}" />
<property name="i18nDescriptionKey" value="DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI" />
</bean>
<bean id="enssatGlpiThroughCasComputerUrlBuilder"
parent="abstractComputerUrlBuilder"
class="org.esupportail.helpdesk.domain.computerUrl.CasPatternBasedComputerUrlBuilderImpl"
lazy-init="true"
>
<property name="pattern" value="${computerUrl.enssatGlpiPattern}" />
<property name="casServiceUrl" value="${computerUrl.casServiceUrl}" />
<property name="i18nDescriptionKey" value="DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI_THROUGH_CAS" />
</bean> |
Declare the property computerUrl.enssatGlpiPattern in /properties/config.properties:
| Bloc de code |
|---|
computerUrl.enssatGlpiPattern=http://glpi.enssat.univ-rennes1.fr/front/computer.php?contains\[0\]=%s&field\[0\]=1&sort=1&deleted=N&start=0 |
Add the i18n keys to the bundles.
/properties/i18n/bundles/Custom_fr.properties:
| Bloc de code |
|---|
DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI = GLPI (ENSSAT)
DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI_THROUGH_CAS = GLPI via CAS (ENSSAT) |
/properties/i18n/bundles/Custom_en.properties:
| Bloc de code |
|---|
DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI = GLPI (ENSSAT)
DOMAIN.COMPUTER_URL_BUILDER.ENSSAT_GLPI_THROUGH_CAS = GLPI through CAS (ENSSAT) |
Tell esup-helpdesk to automatically recover your modified configuration file at the next upgrade in /build.properties:
| Bloc de code |
|---|
custom.recover.files= \
... \
/properties/domain/computerUrl.xml |
Vue d'ensemble
Gestion des contenus