Historique de la page
| Sommaire |
|---|
Pour se lier à une application d'inventaireIn order to link to external inventory applications, esup-helpdesk utilise des générateurs d'uses URL . Les URLs générées sont automatiquement ajoutées à l'interface web et permettent ainsi de naviguer depuis le suivi des demandes vers l'inventaire.
Propriétés de /properties/config.properties
generators. The URL generated are automatically added to the web interface and allow the managers to navigate from the helpdesk application to the inventory application.
URL generators are defined in the configuration file Les générateurs d'URL sont définis dans le fichier /properties/domain/computerUrl.xml. Trois générateurs sont proposés dans la Three generators are available in the distribution:
- null : aucune no URL
- glpi : des URLs vers l'application GLPIURLs to the GLPI application
- glpiThroughCas : des URLs vers l'application GLPI après authentification au serveur CAS
Générateur d'URL par défaut
- URLs to the GLPI application via a CAS authentication
Default URL generator
The URL generator is set for each department. The generator used for new departments is set by this porperty (set in properties/config.properties)Dans l'application, le générateur d'URL est défini par service. Le générateur utilisé pour les nouveaux services est donné par la propriété suivante :
| Bloc de code |
|---|
#defaultComputerUrlBuilderName=null |
| Astuce |
|---|
Pour chaque service, cette propriété peut ensuite être changée via l'interface web de l'application. |
Modèle des URLs GLPI
For each department, this property can be changed at any time through the web interface. |
Links to the GLPI application
When one of the generators glpi or glpiThroughCas is used, they rely on this property to build the Lorsque les générateurs glpi ou glpiThroughCas sont utilisés, ils se basent sur cette propriété pour construire les URLs:
| Bloc de code |
|---|
#computerUrl.glpiPattern=http://glpi.domain.edu/front/computer.php?contains[0]=%s&field[0]=1&sort=1&deleted=N&start=0 |
| Astuce |
|---|
Dans la propriété ci-dessus, %s est remplacé par le nom de la machine. |
Serveur CAS
%s is automatically replaced by the name of the machine. |
The URL of the CAS server, used when the property defaultComputerUrlBuilderName is set to L'URL du serveur CAS, utilisé par le générateur glpiThroughCas:
| Bloc de code |
|---|
#computerUrl.casServiceUrl=https://cas.domain.edu?service=%s |
Personnalisation
L'ajout d'un générateur d'URL (vers une autre application d'inventaire) se fait de la manière suivante :
Links to another application
The steps to add a new URL generator are:
- write a class that implements the développer une classe implémentant l' interface org.esupportail.helpdesk.domain.computerUrl.ComputerUrlBuilder, par exemple en héritant d'une classe existantefor instance by inheriting of an existing class
- declarer a bean of this class in the configuration file déclarer un bean de cette classe dans le fichier /properties/domain/computerUrl.xml et ajouter une référence à ce bean dans l'attribut map du bean computerUrlBuilderStorepermettre la récupération de la nouvelle classe et du fichier /properties/domain/computerUrl.xml lors de la prochaine mise à jour (cf Conservation des personnalisations lors des mises à jour). 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.enssatGlpiPattern}" />
<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 |