]> git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.core/src/org/argeo/app/core/SuiteMaintenance.java
Releasing
[gpl/argeo-suite.git] / org.argeo.app.core / src / org / argeo / app / core / SuiteMaintenance.java
1 package org.argeo.app.core;
2
3 import javax.measure.Quantity;
4 import javax.measure.quantity.Area;
5
6 import org.argeo.api.acr.spi.ProvidedRepository;
7 //import org.geotools.gml3.v3_2.GML;
8
9 import si.uom.SI;
10 import tech.units.indriya.quantity.Quantities;
11
12 /**
13 * Background service starting and stopping with the whole system, and making
14 * sure it is in a proper state.
15 */
16 public class SuiteMaintenance {
17 private ProvidedRepository contentRepository;
18
19 public void start() {
20 // make sure that the unit system is initialised
21 Quantity<Area> dummy = Quantities.getQuantity(0, SI.SQUARE_METRE);
22
23 getContentRepository().registerTypes(SuiteContentNamespace.values());
24 // for (SuiteContentTypes types : SuiteContentTypes.values()) {
25 // getContentRepository().registerTypes(types.getDefaultPrefix(), types.getNamespace(),
26 // types.getResource() != null ? types.getResource().toExternalForm() : null);
27 // }
28
29 // GML schema import fails because of xlinks issues
30 // getContentRepository().registerTypes(new ContentNamespace() {
31 //
32 // @Override
33 // public URL getSchemaResource() {
34 // try {
35 // return new URL(GML.getInstance().getSchemaLocation());
36 // } catch (MalformedURLException e) {
37 // throw new IllegalArgumentException(e);
38 // }
39 // }
40 //
41 // @Override
42 // public String getNamespaceURI() {
43 // return GML.getInstance().getNamespaceURI();
44 // }
45 //
46 // @Override
47 // public String getDefaultPrefix() {
48 // return "gml";
49 // }
50 // });
51
52 }
53
54 public void stop() {
55
56 }
57
58 protected ProvidedRepository getContentRepository() {
59 return contentRepository;
60 }
61
62 public void setContentRepository(ProvidedRepository contentRepository) {
63 this.contentRepository = contentRepository;
64 }
65
66 }