-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guido Grune <g.grune@datainmotion.com>
- Loading branch information
Showing
17 changed files
with
251 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
-init: \ | ||
${system-allow-fail; npm run build-only --prefix ../../../legacy.dashboard.client/} | ||
|
||
|
||
-includeresource: \ | ||
content=-../../../legacy.dashboard.client/dist,\ | ||
content/configs=configs | ||
content/config=config | ||
|
||
-buildpath: \ | ||
org.osgi.annotation.bundle,\ | ||
org.osgi.service.component.annotations,\ | ||
org.osgi.service.http.whiteboard,\ | ||
org.osgi.framework,\ | ||
jakarta.servlet-api | ||
jakarta.ws.rs-api,\ | ||
jakarta.servlet-api,\ | ||
org.osgi.service.jakartars,\ | ||
org.osgi.service.cm |
9 changes: 9 additions & 0 deletions
9
backend/de.jena.udp.dashboard.edit.web.app/config/settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
(function(window) { | ||
window.__env = window.__env || {}; | ||
|
||
window.__env.settings = { | ||
"releaseEndPointUrl": "../../rest/dashboard/release" | ||
}; | ||
|
||
})(this); |
1 change: 0 additions & 1 deletion
1
backend/de.jena.udp.dashboard.edit.web.app/configs/irgnendnenname.json
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...shboard.edit.web.app/src/de/jena/udp/dashboard/edit/web/app/DashboardRestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2012 - 2024 Data In Motion and others. | ||
* All rights reserved. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Data In Motion - initial API and implementation | ||
*/ | ||
package de.jena.udp.dashboard.edit.web.app; | ||
|
||
import jakarta.ws.rs.core.Application; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.jakartars.whiteboard.propertytypes.JakartarsApplicationBase; | ||
import org.osgi.service.jakartars.whiteboard.propertytypes.JakartarsName; | ||
import org.osgi.service.jakartars.whiteboard.propertytypes.JakartarsWhiteboardTarget; | ||
|
||
/** | ||
* | ||
* @author grune | ||
* @since Oct 1, 2024 | ||
*/ | ||
@Component(name = "DashboardRestApplication", service = Application.class, property = {"applicationId=dashboardRest"}) | ||
@JakartarsApplicationBase("/dashboard") | ||
@JakartarsWhiteboardTarget("(jersey.jakartars.whiteboard.name=udprest)") | ||
@JakartarsName("UDP Dashboard API") | ||
public class DashboardRestApplication extends Application { | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
....jena.udp.dashboard.edit.web.app/src/de/jena/udp/dashboard/edit/web/app/SaveResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* Copyright (c) 2012 - 2024 Data In Motion and others. | ||
* All rights reserved. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Data In Motion - initial API and implementation | ||
*/ | ||
package de.jena.udp.dashboard.edit.web.app; | ||
|
||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Hashtable; | ||
|
||
import org.osgi.service.cm.Configuration; | ||
import org.osgi.service.cm.ConfigurationAdmin; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.osgi.service.component.annotations.ServiceScope; | ||
import org.osgi.service.jakartars.whiteboard.propertytypes.JakartarsApplicationSelect; | ||
import org.osgi.service.jakartars.whiteboard.propertytypes.JakartarsResource; | ||
|
||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
/** | ||
* | ||
* @author grune | ||
* @since Oct 1, 2024 | ||
*/ | ||
@Component(service = SaveResource.class, scope = ServiceScope.PROTOTYPE) | ||
@JakartarsResource | ||
@JakartarsApplicationSelect("(applicationId=dashboardRest)") | ||
@Path("/") | ||
public class SaveResource { | ||
|
||
@Reference | ||
private ConfigurationAdmin configAdmin; | ||
|
||
@GET | ||
@Path("/hello") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "Hello"; | ||
} | ||
|
||
@POST | ||
@Path("/release/{path}") | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public Response release(@PathParam("path") String path, InputStream stream) throws IOException { | ||
byte[] bytes = stream.readAllBytes(); | ||
String dir = System.getProperty("user.dir", "/tmp"); | ||
File p = new File(dir + "/dashboards/"); | ||
p.mkdirs(); | ||
File file = new File(p, path + ".json"); | ||
try (FileOutputStream os = new FileOutputStream(file)) { | ||
os.write(bytes); | ||
} | ||
Hashtable<String, Object> props = new Hashtable<>(); | ||
props.put("path", path); | ||
props.put("configFile", file.getAbsolutePath()); | ||
Configuration configuration = configAdmin.getFactoryConfiguration("DashboardViewerConfigurator", path, "?"); | ||
configuration.updateIfDifferent(props); | ||
|
||
return Response.ok().build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
backend/de.jena.udp.dashboard.view.web.app/configs/irgnendnenname.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
backend/de.jena.udp.sensinact.runtime.config/configs/dashboard.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
backend/de.jena.udp.sensinact.runtime/data/ePackages.ecore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:sensinactMetadata="https://eclipse.org/sensinact/core/metadata/1.0" | ||
name="base" nsURI="https://eclipse.org/sensinact/default" nsPrefix="sensinactBase"> | ||
<eClassifiers xsi:type="ecore:EClass" name="Sensinact" eSuperTypes="https://eclipse.org/sensinact/core/provider/1.0#//Provider"> | ||
<eAnnotations source="metadata"> | ||
<contents xsi:type="sensinactMetadata:AnnotationMetadata" timestamp="2024-10-01T14:19:27.685511794Z"/> | ||
</eAnnotations> | ||
<eAnnotations source="model"> | ||
<details key="name" value="sensinact"/> | ||
</eAnnotations> | ||
<eStructuralFeatures xsi:type="sensinactMetadata:ServiceReference" name="system" | ||
eType="ecore:EClass data/ePackages.ecore#//System" containment="true" timestamp="2024-10-01T14:19:27.685511794Z" | ||
locked="false" originalName="system"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="System" eSuperTypes="https://eclipse.org/sensinact/core/provider/1.0#//Service"> | ||
<eAnnotations source="metadata"> | ||
<contents xsi:type="sensinactMetadata:AnnotationMetadata" timestamp="2024-10-01T14:19:27.685511794Z"/> | ||
</eAnnotations> | ||
<eStructuralFeatures xsi:type="sensinactMetadata:ResourceAttribute" name="version" | ||
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble" timestamp="2024-10-01T14:19:27.685511794Z" | ||
locked="false" originalName="version"/> | ||
<eStructuralFeatures xsi:type="sensinactMetadata:ResourceAttribute" name="started" | ||
eType="ecore:EDataType https://eclipse.org/sensinact/core/provider/1.0#//EInstant" | ||
timestamp="2024-10-01T14:19:27.685511794Z" locked="false" originalName="started"/> | ||
</eClassifiers> | ||
</ecore:EPackage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="ASCII"?> | ||
<sensinactBase:Sensinact xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:sensinactBase="https://eclipse.org/sensinact/default" xmlns:sensinactMetadata="https://eclipse.org/sensinact/core/metadata/1.0" id="sensiNact"> | ||
<admin friendlyName="sensiNact" modelPackageUri="https://eclipse.org/sensinact/default" model="sensinact"> | ||
<metadata> | ||
<key xsi:type="ecore:EAttribute" href="https://eclipse.org/sensinact/core/provider/1.0#//Admin/friendlyName"/> | ||
<value xsi:type="sensinactMetadata:ResourceMetadata" timestamp="2024-10-01T14:19:27.685511794Z" originalName="friendlyName"/> | ||
</metadata> | ||
<metadata> | ||
<key xsi:type="ecore:EAttribute" href="https://eclipse.org/sensinact/core/provider/1.0#//Admin/modelPackageUri"/> | ||
<value xsi:type="sensinactMetadata:ResourceMetadata" timestamp="2024-10-01T14:19:27.685511794Z" originalName="modelPackageUri"/> | ||
</metadata> | ||
<metadata> | ||
<key xsi:type="ecore:EAttribute" href="https://eclipse.org/sensinact/core/provider/1.0#//Admin/model"/> | ||
<value xsi:type="sensinactMetadata:ResourceMetadata" timestamp="2024-10-01T14:19:27.685511794Z" originalName="model"/> | ||
</metadata> | ||
</admin> | ||
<system version="0.1" started="2024-10-01T14:19:27.685511794Z"> | ||
<metadata> | ||
<key xsi:type="sensinactMetadata:ResourceAttribute" href="https://eclipse.org/sensinact/default#//System/version"/> | ||
<value xsi:type="sensinactMetadata:ResourceMetadata" timestamp="2024-10-01T14:19:27.685511794Z"/> | ||
</metadata> | ||
<metadata> | ||
<key xsi:type="sensinactMetadata:ResourceAttribute" href="https://eclipse.org/sensinact/default#//System/started"/> | ||
<value xsi:type="sensinactMetadata:ResourceMetadata" timestamp="2024-10-01T14:19:27.685511794Z"/> | ||
</metadata> | ||
</system> | ||
</sensinactBase:Sensinact> |
Oops, something went wrong.