From da4fd6169717cfa04d644d0af0d23dd089a6e373 Mon Sep 17 00:00:00 2001 From: herbert Date: Sat, 14 Dec 2019 00:06:42 +0100 Subject: remove old version of devicemodel devicemanager oldux featureaggregator Issue-ID: SDNC-1004 Signed-off-by: herbert Change-Id: I5337643181e2398e5a8097e4ee14fa4ac96d0d4c --- sdnr/wt/odlux/apps/mediatorApp/.babelrc | 17 -- sdnr/wt/odlux/apps/mediatorApp/package.json | 41 --- sdnr/wt/odlux/apps/mediatorApp/pom.xml | 161 ---------- .../src/actions/avaliableMediatorServersActions.ts | 58 ---- .../src/actions/mediatorConfigActions.ts | 154 ---------- .../src/actions/mediatorServerActions.ts | 101 ------- .../src/components/editMediatorConfigDialog.tsx | 330 --------------------- .../src/components/editMediatorServerDialog.tsx | 173 ----------- .../handlers/avaliableMediatorServersHandler.ts | 36 --- .../src/handlers/mediatorAppRootHandler.ts | 43 --- .../src/handlers/mediatorServerHandler.ts | 116 -------- sdnr/wt/odlux/apps/mediatorApp/src/index.html | 29 -- .../apps/mediatorApp/src/models/mediatorServer.ts | 77 ----- sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx | 83 ------ .../mediatorApp/src/services/mediatorService.ts | 182 ------------ .../mediatorApp/src/views/mediatorApplication.tsx | 238 --------------- .../src/views/mediatorServerSelection.tsx | 153 ---------- .../sdnr/wt/odlux/bundles/MyOdluxBundle.java | 68 ----- .../resources/OSGI-INF/blueprint/blueprint.xml | 9 - .../sdnr/wt/odlux/bundles/test/TestBundleRes.java | 46 --- .../apps/mediatorApp/src2/test/resources/test.js | 5 - sdnr/wt/odlux/apps/mediatorApp/tsconfig.json | 38 --- sdnr/wt/odlux/apps/mediatorApp/tslint.json | 4 - sdnr/wt/odlux/apps/mediatorApp/webpack.config.js | 148 --------- 24 files changed, 2310 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/.babelrc delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/package.json delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/pom.xml delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/actions/avaliableMediatorServersActions.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorServerHandler.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/index.html delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/models/mediatorServer.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/src2/test/resources/test.js delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/tsconfig.json delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/tslint.json delete mode 100644 sdnr/wt/odlux/apps/mediatorApp/webpack.config.js (limited to 'sdnr/wt/odlux/apps/mediatorApp') diff --git a/sdnr/wt/odlux/apps/mediatorApp/.babelrc b/sdnr/wt/odlux/apps/mediatorApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/mediatorApp/package.json b/sdnr/wt/odlux/apps/mediatorApp/package.json deleted file mode 100644 index cf9cb040d..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@odlux/mediator-app", - "version": "0.1.0", - "description": "A react based modular UI to demo the mediator possible app.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Matthias Fischer", - "license": "Apache-2.0", - "dependencies": { - "@odlux/framework": "*" - }, - "peerDependencies": { - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@types/react": "16.4.14", - "@types/react-dom": "16.0.8", - "@types/react-router-dom": "4.3.1", - "@material-ui/core": "3.8.3", - "@material-ui/icons": "3.0.2", - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "jquery": "3.3.1", - "react": "16.5.2", - "react-dom": "16.5.2", - "react-router-dom": "4.3.1" - } -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/pom.xml b/sdnr/wt/odlux/apps/mediatorApp/pom.xml deleted file mode 100644 index 81f1798ad..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-app-mediatorApp - 0.7.0-SNAPSHOT - bundle - - sdnr-wt-odlux-app-mediatorApp - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - ${project.groupId} - sdnr-wt-odlux-core-model - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-core-provider - ${project.version} - test - - - junit - junit - test - - - - - - highstreet repo - https://cloud-highstreet-technologies.com/mvn/ - - true - always - - - - - - src2/main/java - - - dist - odlux - - - src2/main/resources - - - src2/test/resources - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source - generate-test-sources - - add-test-source - - - - src2/test/java - - - - - - - de.jacksitlab - frontend-maven-plugin - 1.7.1 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v8.10.0 - v1.12.3 - - - - yarn build - - yarn - - - run build - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - - - - - - - diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/avaliableMediatorServersActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/avaliableMediatorServersActions.ts deleted file mode 100644 index 3f56b05e1..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/avaliableMediatorServersActions.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; - -import { MediatorServer } from '../models/mediatorServer'; -import { avaliableMediatorServersReloadAction } from '../handlers/avaliableMediatorServersHandler'; -import mediatorService from '../services/mediatorService'; - -/** Represents the base action. */ -export class BaseAction extends Action { } - -/** Represents an async thunk action that will add a server to the avaliable mediator servers. */ -export const addAvaliableMediatorServerAsyncActionCreator = (server: MediatorServer) => (dispatch: Dispatch) => { - mediatorService.insertMediatorServer(server).then(_ => { - window.setTimeout(() => { - dispatch(avaliableMediatorServersReloadAction); - dispatch(new AddSnackbarNotification({ message: `Successfully added [${ server.name }]`, options: { variant: 'success' } })); - }, 900); - }); - }; - - /** Represents an async thunk action that will add a server to the avaliable mediator servers. */ -export const updateAvaliableMediatorServerAsyncActionCreator = (server: MediatorServer) => (dispatch: Dispatch) => { - mediatorService.updateMediatorServer(server).then(_ => { - window.setTimeout(() => { - dispatch(avaliableMediatorServersReloadAction); - dispatch(new AddSnackbarNotification({ message: `Successfully updated [${ server.name }]`, options: { variant: 'success' } })); - }, 900); - }); -}; - - /** Represents an async thunk action that will delete a server from the avaliable mediator servers. */ - export const removeAvaliableMediatorServerAsyncActionCreator = (server: MediatorServer) => (dispatch: Dispatch) => { - mediatorService.deleteMediatorServer(server).then(_ => { - window.setTimeout(() => { - dispatch(avaliableMediatorServersReloadAction); - dispatch(new AddSnackbarNotification({ message: `Successfully removed [${ server.name }]`, options: { variant: 'success' } })); - }, 900); - }); - }; - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts deleted file mode 100644 index 516515ab2..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts +++ /dev/null @@ -1,154 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import mediatorService from '../services/mediatorService'; -import { MediatorConfig, MediatorConfigResponse } from '../models/mediatorServer'; - -/** Represents the base action. */ -export class BaseAction extends Action { } - -export class SetMediatorBusyByName extends BaseAction { - constructor(public name: string, public isBusy: boolean) { - super(); - } -} - -export class AddMediatorConfig extends BaseAction { - constructor(public mediatorConfig: MediatorConfigResponse) { - super(); - } -} - -export class UpdateMediatorConfig extends BaseAction { - constructor(public name: string, public mediatorConfig: MediatorConfigResponse) { - super(); - } -} - -export class RemoveMediatorConfig extends BaseAction { - constructor(public name: string) { - super(); - } -} - - -export const startMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - dispatch(new SetMediatorBusyByName(name, true)); - const { mediator: { mediatorServerState: { id } } } = getState(); - if (id) { - mediatorService.startMediatorByName(id, name).then(msg => { - dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here - window.setTimeout(() => { - mediatorService.getMediatorServerConfigByName(id, name).then(config => { - if (config) { - dispatch(new UpdateMediatorConfig(name, config)); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: reading mediator config for ${name}.`, options: { variant: 'error' } })); - } - dispatch(new SetMediatorBusyByName(name, false)); - }); - }, 2100); - }); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: currently no mediator server selected.`, options: { variant: 'error' } })); - dispatch(new SetMediatorBusyByName(name, false)); - } -}; - -export const stopMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - dispatch(new SetMediatorBusyByName(name, true)); - const { mediator: { mediatorServerState: { id } } } = getState(); - if (id) { - mediatorService.stopMediatorByName(id, name).then(msg => { - dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here - window.setTimeout(() => { - mediatorService.getMediatorServerConfigByName(id, name).then(config => { - if (config) { - dispatch(new UpdateMediatorConfig(name, config)); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: reading mediator config for ${name}.`, options: { variant: 'error' } })); - } - dispatch(new SetMediatorBusyByName(name, false)); - }); - }, 2100); - }); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: currently no mediator server selected.`, options: { variant: 'error' } })); - dispatch(new SetMediatorBusyByName(name, false)); - } -}; - -export const addMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - const { Name: name } = config; - const { mediator: { mediatorServerState: { id } } } = getState(); - if (id) { - mediatorService.createMediatorConfig(id, config).then(msg => { - dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here - window.setTimeout(() => { - mediatorService.getMediatorServerConfigByName(id, name).then(config => { - if (config) { - dispatch(new AddMediatorConfig(config)); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: reading mediator config for ${name}.`, options: { variant: 'error' } })); - } - }); - }, 2100); - }); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: currently no mediator server selected.`, options: { variant: 'error' } })); - } -}; - -export const updateMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch) => { - // currently not supported be backend -}; - -export const removeMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - const { Name: name } = config; - const { mediator: { mediatorServerState: { id } } } = getState(); - if (id) { - mediatorService.deleteMediatorConfigByName(id, name).then(msg => { - dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here - window.setTimeout(() => { - mediatorService.getMediatorServerConfigByName(id, config.Name).then(config => { - if (!config) { - dispatch(new RemoveMediatorConfig(name)); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: deleting mediator config for ${name}.`, options: { variant: 'error' } })); - } - }); - }, 2100); - }); - } else { - dispatch(new AddSnackbarNotification({ message: `Error: currently no mediator server selected.`, options: { variant: 'error' } })); - dispatch(new SetMediatorBusyByName(name, false)); - } -}; - - - diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts deleted file mode 100644 index 143dd7d4a..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { MediatorServerVersionInfo, MediatorConfig, MediatorConfigResponse, MediatorServerDevice } from '../models/mediatorServer'; -import mediatorService from '../services/mediatorService'; -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -/** Represents the base action. */ -export class BaseAction extends Action { } - -export class SetMediatorServerBusy extends BaseAction { - constructor(public isBusy: boolean) { - super(); - } -} - -export class SetMediatorServerInfo extends BaseAction { - /** - * Initializes a new instance of this class. - */ - constructor(public id: string | null, public name: string | null, public url: string | null) { - super(); - - } -} - -export class SetMediatorServerVersion extends BaseAction { - /** - * Initializes a new instance of this class. - */ - constructor(public versionInfo: MediatorServerVersionInfo | null) { - super(); - - } -} - -export class SetAllMediatorServerConfigurations extends BaseAction { - /** - * Initializes a new instance of this class. - */ - constructor(public allConfigurations: MediatorConfigResponse[] | null) { - super(); - - } -} - -export class SetMediatorServerSupportedDevices extends BaseAction { - /** - * Initializes a new instance of this class. - */ - constructor(public devices: MediatorServerDevice[] | null) { - super(); - - } -} - -export const initializeMediatorServerAsyncActionCreator = (serverId: string) => (dispatch: Dispatch) => { - dispatch(new SetMediatorServerBusy(true)); - mediatorService.getMediatorServerById(serverId).then(mediatorServer => { - if (!mediatorServer) { - dispatch(new SetMediatorServerBusy(false)); - dispatch(new AddSnackbarNotification({ message: `Error loading mediator server [${serverId}]`, options: { variant: 'error' } })); - dispatch(new NavigateToApplication("mediator")); - return; - } - dispatch(new SetMediatorServerInfo(mediatorServer._id, mediatorServer.name, mediatorServer.url)); - - mediatorService.getMediatorServerVersion(mediatorServer._id).then(versionInfo => { - dispatch(new SetMediatorServerVersion(versionInfo)); - }); - - Promise.all([ - mediatorService.getMediatorServerAllConfigs(mediatorServer._id), - mediatorService.getMediatorServerSupportedDevices(mediatorServer._id) - ]).then(([configurations, supportedDevices]) => { - dispatch(new SetAllMediatorServerConfigurations(configurations)); - dispatch(new SetMediatorServerSupportedDevices(supportedDevices)); - dispatch(new SetMediatorServerBusy(false)); - }); - }); -}; - diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx deleted file mode 100644 index 20ece4c22..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx +++ /dev/null @@ -1,330 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Typography, FormControlLabel, Checkbox } from '@material-ui/core'; - -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Select from '@material-ui/core/Select'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; - -import Tabs from '@material-ui/core/Tabs'; -import Tab from '@material-ui/core/Tab'; - -import Fab from '@material-ui/core/Fab'; -import AddIcon from '@material-ui/icons/Add'; -import DeleteIcon from '@material-ui/icons/Delete'; -import IconButton from '@material-ui/core/IconButton'; - -import { addMediatorConfigAsyncActionCreator, updateMediatorConfigAsyncActionCreator, removeMediatorConfigAsyncActionCreator } from '../actions/mediatorConfigActions'; -import { MediatorConfig, ODLConfig } from '../models/mediatorServer'; -import FormControl from '@material-ui/core/FormControl'; -import InputLabel from '@material-ui/core/InputLabel'; -import MenuItem from '@material-ui/core/MenuItem'; - -import { Panel } from '../../../../framework/src/components/material-ui/panel'; - -import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - - -const styles = (theme: Theme) => createStyles({ - root: { - display: 'flex', - flexDirection: 'column', - flex: '1', - }, - fab: { - position: 'absolute', - bottom: theme.spacing.unit, - right: theme.spacing.unit, - }, - title: { - fontSize: 14, - }, - center: { - flex: "1", - display: "flex", - alignItems: "center", - justifyContent: "center", - }, - alignInOneLine: { - display: 'flex', - flexDirection: 'row' - }, - left: { - marginRight: theme.spacing.unit, - }, - right: { - marginLeft: 0, - } -}); - -const TabContainer: React.SFC = ({ children }) => { - return ( -
- {children} -
- ); -} - -export enum EditMediatorConfigDialogMode { - None = "none", - AddMediatorConfig = "addMediatorConfig", - EditMediatorConfig = "editMediatorConfig", - RemoveMediatorConfig = "removeMediatorConfig", -} - -const mapProps = (state: IApplicationStoreState) => ({ - supportedDevices: state.mediator.mediatorServerState.supportedDevices -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - addMediatorConfig: (config: MediatorConfig) => { - dispatcher.dispatch(addMediatorConfigAsyncActionCreator(config)); - }, - updateMediatorConfig: (config: MediatorConfig) => { - dispatcher.dispatch(updateMediatorConfigAsyncActionCreator(config)); - }, - removeMediatorConfig: (config: MediatorConfig) => { - dispatcher.dispatch(removeMediatorConfigAsyncActionCreator(config)); - }, -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - readonly: boolean; - readonlyName: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [EditMediatorConfigDialogMode.None]: { - dialogTitle: "", - dialogDescription: "", - applyButtonText: "", - cancelButtonText: "", - readonly: true, - readonlyName: true, - }, - [EditMediatorConfigDialogMode.AddMediatorConfig]: { - dialogTitle: "Add Mediator Configuration", - dialogDescription: "", - applyButtonText: "Add", - cancelButtonText: "Cancel", - readonly: false, - readonlyName: false, - }, - [EditMediatorConfigDialogMode.EditMediatorConfig]: { - dialogTitle: "Edit Mediator Configuration", - dialogDescription: "", - applyButtonText: "Update", - cancelButtonText: "Cancel", - readonly: false, - readonlyName: true, - }, - [EditMediatorConfigDialogMode.RemoveMediatorConfig]: { - dialogTitle: "Remove Mediator Configuration", - dialogDescription: "", - applyButtonText: "Remove", - cancelButtonText: "Cancel", - readonly: true, - readonlyName: true, - }, -}; - -type EditMediatorConfigDialogComponentProps = WithStyles & Connect & { - mode: EditMediatorConfigDialogMode; - mediatorConfig: MediatorConfig; - onClose: () => void; -}; - -type EditMediatorConfigDialogComponentState = MediatorConfig & { activeTab: number; activeOdlConfig: string }; - -class EditMediatorConfigDialogComponent extends React.Component { - constructor (props: EditMediatorConfigDialogComponentProps) { - super(props); - - this.state = { - ...this.props.mediatorConfig, - activeTab: 0, - activeOdlConfig: "" - }; - } - - private odlConfigValueChangeHandlerCreator = (index: number, property: TKey, mapValue: (event: React.ChangeEvent) => any) => (event: React.ChangeEvent) => { - event.stopPropagation(); - event.preventDefault(); - this.setState({ - ODLConfig: [ - ...this.state.ODLConfig.slice(0, index), - { ...this.state.ODLConfig[index], [property]: mapValue(event) }, - ...this.state.ODLConfig.slice(index + 1) - ] - }); - } - - render(): JSX.Element { - const setting = settings[this.props.mode]; - const { classes } = this.props; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - this.setState({ activeTab: value })} > - - - - {this.state.activeTab === 0 ? - { this.setState({ Name: event.target.value }); }} /> - - Device - - - { this.setState({ DeviceIp: event.target.value }); }} /> - { this.setState({ DevicePort: +event.target.value }); }} /> - { this.setState({ TrapPort: +event.target.value }); }} /> - { this.setState({ NcUsername: event.target.value }); }} /> - { this.setState({ NcPassword: event.target.value }); }} /> - { this.setState({ NcPort: +event.target.value }); }} /> - : null} - {this.state.activeTab === 1 ? - {this.state.ODLConfig && this.state.ODLConfig.length > 0 - ? this.state.ODLConfig.map((cfg, ind) => { - const panelId = `panel-${ind}`; - const deleteButton = ( { - this.setState({ - ODLConfig: [ - ...this.state.ODLConfig.slice(0, ind), - ...this.state.ODLConfig.slice(ind + 1) - ] - }); - }} >) - return ( - this.setState({ activeOdlConfig: (this.state.activeOdlConfig === id) ? "" : (id || "") })} > -
- - Protocoll - - - e.target.value)} /> - +e.target.value)} /> -
-
- e.target.value)} /> - e.target.value)} /> -
-
- e.target.checked)} />} label="Trustall" /> -
-
- ); - }) - :
- Please add an ODL auto connect configuration. -
- } - this.setState({ - ODLConfig: [...this.state.ODLConfig, { Server: '', Port: 8181, Protocol: 'https', User: 'admin', Password: 'admin', Trustall: false }] - })} > - -
: null} - -
- - - - -
- ) - } - - private onApply = (config: MediatorConfig) => { - this.props.onClose && this.props.onClose(); - switch (this.props.mode) { - case EditMediatorConfigDialogMode.AddMediatorConfig: - config && this.props.addMediatorConfig(config); - break; - case EditMediatorConfigDialogMode.EditMediatorConfig: - config && this.props.updateMediatorConfig(config); - break; - case EditMediatorConfigDialogMode.RemoveMediatorConfig: - config && this.props.removeMediatorConfig(config); - break; - } - }; - - private onCancel = () => { - this.props.onClose && this.props.onClose(); - } - - static getDerivedStateFromProps(props: EditMediatorConfigDialogComponentProps, state: EditMediatorConfigDialogComponentState & { _initialMediatorConfig: MediatorConfig }): EditMediatorConfigDialogComponentState & { _initialMediatorConfig: MediatorConfig } { - if (props.mediatorConfig !== state._initialMediatorConfig) { - state = { - ...state, - ...props.mediatorConfig, - _initialMediatorConfig: props.mediatorConfig, - }; - } - return state; - } -} - -export const EditMediatorConfigDialog = withStyles(styles)(connect(mapProps, mapDispatch)(EditMediatorConfigDialogComponent)); -export default EditMediatorConfigDialog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx deleted file mode 100644 index d38fb0b6e..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx +++ /dev/null @@ -1,173 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; - -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; - -import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; - -import { addAvaliableMediatorServerAsyncActionCreator, removeAvaliableMediatorServerAsyncActionCreator, updateAvaliableMediatorServerAsyncActionCreator } from '../actions/avaliableMediatorServersActions'; -import { MediatorServer } from '../models/mediatorServer'; - -export enum EditMediatorServerDialogMode { - None = "none", - AddMediatorServer = "addMediatorServer", - EditMediatorServer = "editMediatorServer", - RemoveMediatorServer = "removeMediatorServer", -} - -const mapDispatch = (dispatcher: IDispatcher) => ({ - addMediatorServer: (element: MediatorServer) => { - dispatcher.dispatch(addAvaliableMediatorServerAsyncActionCreator(element)); - }, - updateMediatorServer: (element: MediatorServer) => { - dispatcher.dispatch(updateAvaliableMediatorServerAsyncActionCreator(element)); - }, - removeMediatorServer: (element: MediatorServer) => { - dispatcher.dispatch(removeAvaliableMediatorServerAsyncActionCreator(element)); - }, -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - readonly: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [EditMediatorServerDialogMode.None]: { - dialogTitle: "", - dialogDescription: "", - applyButtonText: "", - cancelButtonText: "", - readonly: true, - }, - [EditMediatorServerDialogMode.AddMediatorServer]: { - dialogTitle: "Add Mediator Server", - dialogDescription: "", - applyButtonText: "Add", - cancelButtonText: "Cancel", - readonly: false, - }, - [EditMediatorServerDialogMode.EditMediatorServer]: { - dialogTitle: "Edit Mediator Server", - dialogDescription: "", - applyButtonText: "Update", - cancelButtonText: "Cancel", - readonly: false, - }, - [EditMediatorServerDialogMode.RemoveMediatorServer]: { - dialogTitle: "Remove Mediator Server", - dialogDescription: "", - applyButtonText: "Remove", - cancelButtonText: "Cancel", - readonly: true, - }, -}; - -type EditMediatorServerDialogComponentProps = Connect & { - mode: EditMediatorServerDialogMode; - mediatorServer: MediatorServer; - onClose: () => void; -}; - -type EditMediatorServerDialogComponentState = MediatorServer; - -class EditMediatorServerDialogComponent extends React.Component { - constructor (props: EditMediatorServerDialogComponentProps) { - super(props); - - this.state = { - ...this.props.mediatorServer - }; - } - - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - {/* { this.setState({_id: event.target.value}); } } /> */} - { this.setState({ name: event.target.value }); }} /> - { this.setState({ url: event.target.value }); }} /> - - - - - - - ) - } - - private onApply = (element: MediatorServer) => { - this.props.onClose && this.props.onClose(); - switch (this.props.mode) { - case EditMediatorServerDialogMode.AddMediatorServer: - element && this.props.addMediatorServer(element); - break; - case EditMediatorServerDialogMode.EditMediatorServer: - element && this.props.updateMediatorServer(element); - break; - case EditMediatorServerDialogMode.RemoveMediatorServer: - element && this.props.removeMediatorServer(element); - break; - } - }; - - private onCancel = () => { - this.props.onClose && this.props.onClose(); - } - - static getDerivedStateFromProps(props: EditMediatorServerDialogComponentProps, state: EditMediatorServerDialogComponentState & { _initialMediatorServer: MediatorServer }): EditMediatorServerDialogComponentState & { _initialMediatorServer: MediatorServer } { - if (props.mediatorServer !== state._initialMediatorServer) { - state = { - ...state, - ...props.mediatorServer, - _initialMediatorServer: props.mediatorServer, - }; - } - return state; - } -} - -export const EditMediatorServerDialog = connect(undefined, mapDispatch)(EditMediatorServerDialogComponent); -export default EditMediatorServerDialog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts deleted file mode 100644 index c22252d20..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { MediatorServer } from '../models/mediatorServer'; -import { mediatorServerResourcePath } from '../services/mediatorService'; - -export interface IAvaliableMediatorServersState extends IExternalTableState { } - -// create eleactic search material data fetch handler -const avaliableMediatorServersSearchHandler = createSearchDataHandler(mediatorServerResourcePath); - -export const { - actionHandler: avaliableMediatorServersActionHandler, - createActions: createAvaliableMediatorServersActions, - createProperties: createAvaliableMediatorServersProperties, - reloadAction: avaliableMediatorServersReloadAction, - - // set value action, to change a value -} = createExternal(avaliableMediatorServersSearchHandler, appState => appState.mediator.avaliableMediatorServers); \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts deleted file mode 100644 index 2642ec8cd..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// main state handler - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { IAvaliableMediatorServersState, avaliableMediatorServersActionHandler } from './avaliableMediatorServersHandler' ; -import { MediatorServerState, mediatorServerHandler } from './mediatorServerHandler'; - -export interface IMediatorAppStoreState { - avaliableMediatorServers: IAvaliableMediatorServersState, - mediatorServerState: MediatorServerState, -} - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - mediator: IMediatorAppStoreState - } -} - -const actionHandlers = { - avaliableMediatorServers: avaliableMediatorServersActionHandler, - mediatorServerState: mediatorServerHandler, -}; - -export const mediatorAppRootHandler = combineActionHandler(actionHandlers); -export default mediatorAppRootHandler; diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorServerHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorServerHandler.ts deleted file mode 100644 index 0d137b396..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorServerHandler.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { XmlFileInfo, MediatorConfig, BusySymbol, MediatorConfigResponse, MediatorServerDevice } from "../models/mediatorServer"; -import { IActionHandler } from "../../../../framework/src/flux/action"; -import { SetMediatorServerVersion, SetMediatorServerInfo, SetAllMediatorServerConfigurations, SetMediatorServerBusy, SetMediatorServerSupportedDevices } from "../actions/mediatorServerActions"; -import { SetMediatorBusyByName, UpdateMediatorConfig, AddMediatorConfig, RemoveMediatorConfig } from "../actions/mediatorConfigActions"; - -export type MediatorServerState = { - busy: boolean; - name: string | null; - url: string | null; - id: string | null; - serverVersion: string | null; - mediatorVersion: string | null; - nexmls: XmlFileInfo[]; - configurations: MediatorConfigResponse[]; - supportedDevices: MediatorServerDevice[]; -} - -const mediatorServerInit: MediatorServerState = { - busy: false, - name: null, - url: null, - id: null, - serverVersion: null, - mediatorVersion: null, - nexmls: [], - configurations: [], - supportedDevices: [] -} - -export const mediatorServerHandler: IActionHandler = (state = mediatorServerInit, action) => { - if (action instanceof SetMediatorServerBusy) { - state = { - ...state, - busy: action.isBusy - }; - } else if (action instanceof SetMediatorServerInfo) { - state = { - ...state, - name: action.name, - url: action.url, - id: action.id, - }; - } else if (action instanceof SetMediatorServerVersion) { - state = { - ...state, - serverVersion: action.versionInfo && action.versionInfo.server, - mediatorVersion: action.versionInfo && action.versionInfo.mediator, - nexmls: action.versionInfo && [...action.versionInfo.nexmls] || [], - }; - } else if (action instanceof SetAllMediatorServerConfigurations) { - state = { - ...state, - configurations: action.allConfigurations && action.allConfigurations.map(config => ({ ...config, busy: false })) || [], - }; - } else if (action instanceof SetMediatorServerSupportedDevices) { - state = { - ...state, - supportedDevices: action.devices || [], - }; - } else if (action instanceof SetMediatorBusyByName) { - const index = state.configurations.findIndex(config => config.Name === action.name); - if (index > -1) state = { - ...state, - configurations: [ - ...state.configurations.slice(0, index), - { ...state.configurations[index], [BusySymbol]: action.isBusy }, - ...state.configurations.slice(index + 1) - ] - }; - } else if (action instanceof AddMediatorConfig) { - state = { - ...state, - configurations: [ - ...state.configurations, - action.mediatorConfig - ] - }; - } else if (action instanceof UpdateMediatorConfig) { - const index = state.configurations.findIndex(config => config.Name === action.name); - if (index > -1) state = { - ...state, - configurations: [ - ...state.configurations.slice(0, index), - { ...action.mediatorConfig, [BusySymbol]: state.configurations[index][BusySymbol] }, - ...state.configurations.slice(index + 1) - ] - }; - } else if (action instanceof RemoveMediatorConfig) { - const index = state.configurations.findIndex(config => config.Name === action.name); - if (index > -1) state = { - ...state, - configurations: [ - ...state.configurations.slice(0, index), - ...state.configurations.slice(index + 1) - ] - }; - } - return state; -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/index.html b/sdnr/wt/odlux/apps/mediatorApp/src/index.html deleted file mode 100644 index 95bf9ec6b..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - Mediator App - - - -
- - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/models/mediatorServer.ts b/sdnr/wt/odlux/apps/mediatorApp/src/models/mediatorServer.ts deleted file mode 100644 index a2b54599c..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/models/mediatorServer.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -export type MediatorServer = { - _id: string; - name: string; - url: string; -} - -export type XmlFileInfo = { - filename: string; - version: string; -} - -export type MediatorServerVersionInfo = { - mediator: string; - server: string; - nexmls: XmlFileInfo[]; -} - -export type ODLConfig = { - User: string; - Password: string; - Port: number; - Protocol: "http" | "https"; - Server: string; - Trustall: boolean; -}; - -export const BusySymbol = Symbol("Busy"); - -export type MediatorConfig = { - Name: string; - DeviceIp: string; - DevicePort: number; - DeviceType: number; - TrapPort: number; - NcUsername: string; - NcPassword: string; - NcPort: number; - NeXMLFile: string; - ODLConfig: ODLConfig[]; -} - -export type MediatorConfigResponse = MediatorConfig & { - IsNCConnected: boolean; - IsNeConnected: boolean; - autorun: boolean; - fwactive: boolean; - islocked: boolean; - ncconnections:{}[]; - pid: number; - // extended properties - [BusySymbol]: boolean; -} - -export type MediatorServerDevice = { - id: number; // DeviceType - device: string; - vendor: string; - version: string; - xml: string; // NeXMLFile -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx deleted file mode 100644 index 5ffd0124b..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// app configuration and main entry point for the app - -import * as React from "react"; -import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; - -import { faGlobe } from '@fortawesome/free-solid-svg-icons'; // select app icon - -import applicationManager from '../../../framework/src/services/applicationManager'; -import { IApplicationStoreState } from "../../../framework/src/store/applicationStore"; -import connect, { Connect, IDispatcher } from '../../../framework/src/flux/connect'; - -import { mediatorAppRootHandler } from './handlers/mediatorAppRootHandler'; -import { avaliableMediatorServersReloadAction } from "./handlers/avaliableMediatorServersHandler"; - -import { MediatorApplication } from "./views/mediatorApplication"; -import { MediatorServerSelection } from "./views/mediatorServerSelection"; -import { initializeMediatorServerAsyncActionCreator } from "./actions/mediatorServerActions"; - -let currentMediatorServerId: string | undefined = undefined; - -const mapDisp = (dispatcher: IDispatcher) => ({ - loadMediatorServer : (mediatorServerId: string) => dispatcher.dispatch(initializeMediatorServerAsyncActionCreator(mediatorServerId)), -}); - -const MediatorServerRouteAdapter = connect(undefined, mapDisp)((props: RouteComponentProps<{ mediatorServerId: string }> & Connect) => { - if (currentMediatorServerId !== props.match.params.mediatorServerId) { - // route parameter has changed - currentMediatorServerId = props.match.params.mediatorServerId || undefined; - // Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress ! - window.setTimeout(() => { - if (currentMediatorServerId) { - props.loadMediatorServer(currentMediatorServerId); - } - }); - } - return ( - - ) -}); - -type AppProps = RouteComponentProps & Connect; - -const App = (props: AppProps) => ( - - - - - -); - -const FinalApp = withRouter(connect()(App)); - -export function register() { - const applicationApi = applicationManager.registerApplication({ - name: "mediator", - icon: faGlobe, - rootComponent: FinalApp, - rootActionHandler: mediatorAppRootHandler, - menuEntry: "Mediator" - }); - - // prefetch all avaliable mediator servers - applicationApi.applicationStoreInitialized.then(applicationStore => { - applicationStore.dispatch(avaliableMediatorServersReloadAction) - }); -}; diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts b/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts deleted file mode 100644 index b257fa92c..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as $ from 'jquery'; - -import { requestRest, formEncode } from '../../../../framework/src/services/restService'; -import { MediatorServer, MediatorServerVersionInfo, MediatorConfig, MediatorServerDevice, MediatorConfigResponse } from '../models/mediatorServer'; -import { HitEntry } from '../../../../framework/src/models'; - -export const mediatorServerResourcePath = "mwtn/mediator-server"; - -type MediatorServerResponse = { code: number, data: TData }; -type IndexableMediatorServer = MediatorServer & { [key: string]: any; }; - -/** - * Represents a web api accessor service for all mediator server actions. - */ -class MediatorService { - /** - * Inserts data into the mediator servers table. - */ - public async insertMediatorServer(server: IndexableMediatorServer): Promise { - const path = `database/${mediatorServerResourcePath}`; - const data = Object.keys(server).reduce((acc, cur) => { - if (cur !== "_id") acc[cur] = server[cur]; - return acc; - }, {} as IndexableMediatorServer); - const result = await requestRest(path, { method: "POST", body: JSON.stringify(data) }); - return result || null; - } - - /** - * Updates data into the mediator servers table. - */ - public async updateMediatorServer(server: IndexableMediatorServer): Promise { - const path = `database/${mediatorServerResourcePath}/${server._id}`; - const data = Object.keys(server).reduce((acc, cur) => { - if (cur !== "_id") { acc[cur] = server[cur] } else { acc["id"] = 0 }; - return acc; - }, {} as IndexableMediatorServer); - const result = await requestRest(path, { method: "PUT", body: JSON.stringify(data) }); - return result || null; - } - - /** - * Deletes data from the mediator servers table. - */ - public async deleteMediatorServer(server: MediatorServer): Promise { - const path = `database/${mediatorServerResourcePath}/${server._id}`; - const result = await requestRest(path, { method: "DELETE" }); - return result || null; - } - - public async getMediatorServerById(serverId: string): Promise { - const path = `database/${mediatorServerResourcePath}/${serverId}`; - const result = await requestRest & { found: boolean }>(path, { method: "GET" }); - return result && result.found && result._source && { - _id: result._id, - name: result._source.name, - url: result._source.url, - } || null; - } - - // https://cloud-highstreet-technologies.com/wiki/doku.php?id=att:ms:api - - private async accassMediatorServer(mediatorServerId: string, task: string, data?: {}): Promise | null> { - const path = `ms/${mediatorServerId}/api/'?task=${task}`; - const result = (await requestRest(path, { - method: data ? "POST" : "GET", - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: data ? formEncode({ - ...data, - ...{ task: task } - }) : null - }, true)) || null; - - return result ? JSON.parse(result) as { code: number, data: TData } : null; - } - /* - private accassMediatorServer(mediatorServerId: string, task: string, data?: {}): Promise | null> { - const path = `ms/${mediatorServerId}/api/?task=${task}`; - return new Promise<{ code: number, data: TData }>((resolve, reject) => { - $.ajax({ - method: data ? 'POST' : 'GET', - url: path, - data: { ...{ task: task }, ...data }, - //contentType: 'application/json' - }).then((result: any) => { - if (typeof result === "string") { - resolve(JSON.parse(result)); - } else { - resolve(result); - }; - }); - }); - }*/ - - public async getMediatorServerVersion(mediatorServerId: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'version'); - if (result && result.code === 1) return result.data; - return null; - } - - public async getMediatorServerAllConfigs(mediatorServerId: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'getconfig'); - if (result && result.code === 1) return result.data; - return null; - } - - public async getMediatorServerConfigByName(mediatorServerId: string, name: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, `getconfig&name=${name}`); - if (result && result.code === 1 && result.data && result.data.length === 1) return result.data[0]; - return null; - } - - public async getMediatorServerSupportedDevices(mediatorServerId: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'getdevices'); - if (result && result.code === 1) return result.data; - return null; - } - - public async startMediatorByName(mediatorServerId: string, name: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, `start&name=${name}`); - if (result && result.code === 1) return result.data; - return null; - } - - public async stopMediatorByName(mediatorServerId: string, name: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, `stop&name=${name}`); - if (result && result.code === 1) return result.data; - return null; - } - - public async createMediatorConfig(mediatorServerId: string, config: MediatorConfig): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'create', { config: JSON.stringify(config) }); - if (result && result.code === 1) return result.data; - return null; - } - - public async updateMediatorConfigByName(mediatorServerId: string, config: MediatorConfig): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'update', { config: JSON.stringify(config) }); - if (result && result.code === 1) return result.data; - return null; - } - - public async deleteMediatorConfigByName(mediatorServerId: string, name: string): Promise { - const result = await this.accassMediatorServer(mediatorServerId, `delete&name=${name}`); - if (result && result.code === 1) return result.data; - return null; - } - - public async getMediatorServerFreeNcPorts(mediatorServerId: string, limit?: number): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'getncports', { limit }); - if (result && result.code === 1) return result.data; - return null; - } - - public async getMediatorServerFreeSnmpPorts(mediatorServerId: string, limit?: number): Promise { - const result = await this.accassMediatorServer(mediatorServerId, 'getsnmpports', { limit }); - if (result && result.code === 1) return result.data; - return null; - } -} - -export const mediatorService = new MediatorService; -export default mediatorService; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx deleted file mode 100644 index fcb3fe46f..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx +++ /dev/null @@ -1,238 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Tooltip } from '@material-ui/core'; - -import AddIcon from '@material-ui/icons/Add'; -import IconButton from '@material-ui/core/IconButton'; -import EditIcon from '@material-ui/icons/Edit'; -import DeleteIcon from '@material-ui/icons/Delete'; -import InfoIcon from '@material-ui/icons/Info'; -import StartIcon from '@material-ui/icons/PlayArrow'; -import StopIcon from '@material-ui/icons/Stop'; - -import CircularProgress from '@material-ui/core/CircularProgress' - -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import MaterialTable, { MaterialTableCtorType, ColumnType } from '../../../../framework/src/components/material-table'; - -import { MediatorConfig, BusySymbol, MediatorConfigResponse } from '../models/mediatorServer'; -import EditMediatorConfigDialog, { EditMediatorConfigDialogMode } from '../components/editMediatorConfigDialog'; -import { startMediatorByNameAsyncActionCreator, stopMediatorByNameAsyncActionCreator } from '../actions/mediatorConfigActions'; -import mediatorService from '../services/mediatorService'; - -const styles = (theme: Theme) => createStyles({ - root: { - display: 'flex', - flexDirection: 'column', - flex: '1', - }, - formControl: { - margin: theme.spacing.unit, - minWidth: 300, - }, - button: { - margin: 0, - padding: "6px 6px", - minWidth: 'unset' - }, - spacer: { - marginLeft: theme.spacing.unit, - marginRight: theme.spacing.unit, - display: "inline" - }, - progress: { - flex: '1 1 100%', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - pointerEvents: 'none' - } -}); - -const mapProps = (state: IApplicationStoreState) => ({ - serverName: state.mediator.mediatorServerState.name, - serverUrl: state.mediator.mediatorServerState.url, - serverId: state.mediator.mediatorServerState.id, - serverVersion: state.mediator.mediatorServerState.serverVersion, - mediatorVersion: state.mediator.mediatorServerState.mediatorVersion, - configurations: state.mediator.mediatorServerState.configurations, - supportedDevices: state.mediator.mediatorServerState.supportedDevices, - busy: state.mediator.mediatorServerState.busy, -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - startMediator: (name: string) => dispatcher.dispatch(startMediatorByNameAsyncActionCreator(name)), - stopMediator: (name: string) => dispatcher.dispatch(stopMediatorByNameAsyncActionCreator(name)), -}); - -const emptyMediatorConfig: MediatorConfig = { - Name: "", - DeviceIp: "127.0.0.1", - DevicePort: 161, - NcUsername: "admin", - NcPassword: "admin", - DeviceType: -1, - NcPort: 4020, - TrapPort: 10020, - NeXMLFile: "", - ODLConfig: [] -}; - -const MediatorServerConfigurationsTable = MaterialTable as MaterialTableCtorType; - -type MediatorApplicationComponentProps = Connect & WithStyles; - -type MediatorServerSelectionComponentState = { - busy: boolean, - mediatorConfigToEdit: MediatorConfig, - mediatorConfigEditorMode: EditMediatorConfigDialogMode -} - -class MediatorApplicationComponent extends React.Component { - - constructor(props: MediatorApplicationComponentProps) { - super(props); - - this.state = { - busy: false, - mediatorConfigToEdit: emptyMediatorConfig, - mediatorConfigEditorMode: EditMediatorConfigDialogMode.None, - } - } - - render() { - const { classes } = this.props; - - const renderActions = (rowData: MediatorConfigResponse) => ( - <> -
- - - { event.preventDefault(); event.stopPropagation(); this.props.startMediator(rowData.Name); }} /> - - - - - { event.preventDefault(); event.stopPropagation(); this.props.stopMediator(rowData.Name); }} /> - - -
-
- -
-
- {process.env.NODE_ENV === "development" ? this.onOpenEditConfigurationDialog(event, rowData)}> : null} - this.onOpenRemoveConfigutationDialog(event, rowData)}> -
- - ); - - const addMediatorConfigAction = { icon: AddIcon, tooltip: 'Add', onClick: this.onOpenAddConfigurationDialog }; - return ( -
- {this.props.busy || this.state.busy - ?
- : rowData.pid ? (Running) : (Stopped) }, - { property: "DeviceIp", title: "IP Adress", type: ColumnType.text }, - { - property: "Device", title: "Device", type: ColumnType.custom, customControl: ({ rowData }) => { - const dev = this.props.supportedDevices && this.props.supportedDevices.find(dev => dev.id === rowData.DeviceType); - return ( - {dev && `${dev.vendor} - ${dev.device} (${dev.version || '0.0.0'})`} - ) - } - }, - { property: "actions", title: "Actions", type: ColumnType.custom, customControl: ({ rowData }) => renderActions(rowData) }, - ]} /> - } - - - -
- ); - } - - private onOpenAddConfigurationDialog = () => { - // Tries to determine a free port for netconf listener and snpm listener - // it it could not determine free ports the dialog will open any way - // those ports should not be configured from the fontend, furthermore - // the backend should auto configure them and tell the user the result - // after the creation process. - - this.setState({ - busy: true, - }); - this.props.serverId && Promise.all([ - mediatorService.getMediatorServerFreeNcPorts(this.props.serverId, 1), - mediatorService.getMediatorServerFreeSnmpPorts(this.props.serverId, 1), - ]).then(([freeNcPorts, freeSnmpPorts]) => { - if (freeNcPorts && freeSnmpPorts && freeNcPorts.length > 0 && freeSnmpPorts.length > 0) { - this.setState({ - busy: false, - mediatorConfigEditorMode: EditMediatorConfigDialogMode.AddMediatorConfig, - mediatorConfigToEdit: { - ...emptyMediatorConfig, - NcPort: freeNcPorts[0], - TrapPort: freeSnmpPorts[0], - }, - }); - } else { - this.setState({ - busy: false, - mediatorConfigEditorMode: EditMediatorConfigDialogMode.AddMediatorConfig, - mediatorConfigToEdit: { ...emptyMediatorConfig }, - }); - } - }) - - } - - private onOpenEditConfigurationDialog = (event: React.MouseEvent, configEntry: MediatorConfig) => { - event.preventDefault(); - event.stopPropagation(); - this.setState({ - mediatorConfigEditorMode: EditMediatorConfigDialogMode.EditMediatorConfig, - mediatorConfigToEdit: configEntry, - }); - } - - private onOpenRemoveConfigutationDialog = (event: React.MouseEvent, configEntry: MediatorConfig) => { - event.preventDefault(); - event.stopPropagation(); - this.setState({ - mediatorConfigEditorMode: EditMediatorConfigDialogMode.RemoveMediatorConfig, - mediatorConfigToEdit: configEntry, - }); - } - - private onCloseEditMediatorConfigDialog = () => { - this.setState({ - mediatorConfigEditorMode: EditMediatorConfigDialogMode.None, - mediatorConfigToEdit: emptyMediatorConfig, - }); - } -} - -export const MediatorApplication = withStyles(styles)(connect(mapProps, mapDispatch)(MediatorApplicationComponent)); diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx deleted file mode 100644 index a23afb5f6..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx +++ /dev/null @@ -1,153 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; -import { WithStyles, withStyles, createStyles, Theme, Tooltip } from '@material-ui/core'; - -import AddIcon from '@material-ui/icons/Add'; -import IconButton from '@material-ui/core/IconButton'; -import EditIcon from '@material-ui/icons/Edit'; -import DeleteIcon from '@material-ui/icons/Delete'; - -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; -import MaterialTable, { MaterialTableCtorType, ColumnType } from '../../../../framework/src/components/material-table'; - -import { createAvaliableMediatorServersProperties, createAvaliableMediatorServersActions } from '../handlers/avaliableMediatorServersHandler'; - -import { MediatorServer } from '../models/mediatorServer'; -import EditMediatorServerDialog, { EditMediatorServerDialogMode } from '../components/editMediatorServerDialog'; -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; - -const MediatorServersTable = MaterialTable as MaterialTableCtorType; - -const styles = (theme: Theme) => createStyles({ - button: { - margin: 0, - padding: "6px 6px", - minWidth: 'unset', - }, - spacer: { - marginLeft: theme.spacing.unit, - marginRight: theme.spacing.unit, - display: "inline", - }, -}); - -const mapProps = (state: IApplicationStoreState) => ({ - mediatorServersProperties: createAvaliableMediatorServersProperties(state), -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - mediatorServersActions: createAvaliableMediatorServersActions(dispatcher.dispatch), - selectMediatorServer: (mediatorServerId: string) => mediatorServerId && dispatcher.dispatch(new NavigateToApplication("mediator", mediatorServerId)), -}); - -const emptyMediatorServer: MediatorServer = { - _id: "", - name: "", - url: "" -}; - -type MediatorServerSelectionComponentProps = Connect & WithStyles; - -type MediatorServerSelectionComponentState = { - mediatorServerToEdit: MediatorServer, - mediatorServerEditorMode: EditMediatorServerDialogMode -} - -class MediatorServerSelectionComponent extends React.Component { - - constructor (props: MediatorServerSelectionComponentProps) { - super(props); - - this.state = { - mediatorServerEditorMode: EditMediatorServerDialogMode.None, - mediatorServerToEdit: emptyMediatorServer, - } - } - - render() { - const { classes } = this.props; - - const addMediatorServerActionButton = { - icon: AddIcon, tooltip: 'Add', onClick: () => { - this.setState({ - mediatorServerEditorMode: EditMediatorServerDialogMode.AddMediatorServer, - mediatorServerToEdit: emptyMediatorServer, - }); - } - }; - return ( - <> - ( -
- { this.onEditMediatorServer(event, rowData); }}> - { this.onRemoveMediatorServer(event, rowData); }}> -
- ) - } - ]} onHandleClick={ this.onSelectMediatorServer } /> - - - ); - } - - private onSelectMediatorServer = (event: React.MouseEvent, server: MediatorServer) =>{ - event.preventDefault(); - event.stopPropagation(); - this.props.selectMediatorServer(server && server._id); - - } - - private onEditMediatorServer = (event: React.MouseEvent, server: MediatorServer) => { - event.preventDefault(); - event.stopPropagation(); - this.setState({ - mediatorServerEditorMode: EditMediatorServerDialogMode.EditMediatorServer, - mediatorServerToEdit: server, - }); - } - - private onRemoveMediatorServer = (event: React.MouseEvent, server: MediatorServer) => { - event.preventDefault(); - event.stopPropagation(); - this.setState({ - mediatorServerEditorMode: EditMediatorServerDialogMode.RemoveMediatorServer, - mediatorServerToEdit: server, - }); - } - - private onCloseEditMediatorServerDialog = () => { - this.setState({ - mediatorServerEditorMode: EditMediatorServerDialogMode.None, - mediatorServerToEdit: emptyMediatorServer, - }); - } -} - - -export const MediatorServerSelection = withStyles(styles)(connect(mapProps, mapDispatch)(MediatorServerSelectionComponent)); -export default MediatorServerSelection; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/mediatorApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 1e882fc69..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - ******************************************************************************/ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/mediatorApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/mediatorApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index c11492bc4..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/mediatorApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index d0fbe63c0..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - ******************************************************************************/ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/mediatorApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/mediatorApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/tsconfig.json b/sdnr/wt/odlux/apps/mediatorApp/tsconfig.json deleted file mode 100644 index b0c9b424d..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/tsconfig.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "node", - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/mediatorApp/tslint.json b/sdnr/wt/odlux/apps/mediatorApp/tslint.json deleted file mode 100644 index b5143e92c..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/tslint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "rules":{ - } -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js b/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js deleted file mode 100644 index 94943ecd5..000000000 --- a/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - mediatorApp: ["./plugin.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release") ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ] - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: { - "/oauth2/": { - target: "http://localhost:3000", - secure: false - }, - "/database/": { - target: "http://localhost:3000", - secure: false - }, - "/restconf/": { - target: "http://localhost:3000", - secure: false - }, - "/help/": { - target: "http://localhost:3000", - secure: false - } - } - } - }]; -} -- cgit 1.2.3-korg