1 package org
.argeo
.app
.core
;
3 import java
.net
.MalformedURLException
;
6 import javax
.measure
.Quantity
;
7 import javax
.measure
.quantity
.Area
;
9 import org
.argeo
.api
.acr
.spi
.ContentNamespace
;
10 import org
.argeo
.api
.acr
.spi
.ProvidedRepository
;
11 import org
.geotools
.gml3
.v3_2
.GML
;
14 import tech
.units
.indriya
.quantity
.Quantities
;
17 * Background service starting and stopping with the whole system, and making
18 * sure it is in a proper state.
20 public class SuiteMaintenance
{
21 private ProvidedRepository contentRepository
;
24 // make sure that the unit system is initialised
25 Quantity
<Area
> dummy
= Quantities
.getQuantity(0, SI
.SQUARE_METRE
);
27 getContentRepository().registerTypes(SuiteContentNamespace
.values());
28 // for (SuiteContentTypes types : SuiteContentTypes.values()) {
29 // getContentRepository().registerTypes(types.getDefaultPrefix(), types.getNamespace(),
30 // types.getResource() != null ? types.getResource().toExternalForm() : null);
33 // GML schema import fails because of xlinks issues
34 getContentRepository().registerTypes(new ContentNamespace() {
37 public URL
getSchemaResource() {
39 return new URL(GML
.getInstance().getSchemaLocation());
40 } catch (MalformedURLException e
) {
41 throw new IllegalArgumentException(e
);
46 public String
getNamespaceURI() {
47 return GML
.getInstance().getNamespaceURI();
51 public String
getDefaultPrefix() {
62 protected ProvidedRepository
getContentRepository() {
63 return contentRepository
;
66 public void setContentRepository(ProvidedRepository contentRepository
) {
67 this.contentRepository
= contentRepository
;