forked from community/device-mgt-plugins
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt-plugins into devicetype-3.1.0
commit
92ee01d597
@ -1,37 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<eventPublisher name="Geo-Publisher-RDBMS-GeoAlertNotifications"
|
|
||||||
statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
|
|
||||||
<from streamName="org.wso2.geo.AlertsNotifications" version="1.0.0"/>
|
|
||||||
<mapping customMapping="enable" type="map">
|
|
||||||
<property>
|
|
||||||
<from name="id"/>
|
|
||||||
<to name="id"/>
|
|
||||||
</property>
|
|
||||||
<property>
|
|
||||||
<from name="state"/>
|
|
||||||
<to name="state"/>
|
|
||||||
</property>
|
|
||||||
<property>
|
|
||||||
<from name="information"/>
|
|
||||||
<to name="information"/>
|
|
||||||
</property>
|
|
||||||
<property>
|
|
||||||
<from name="timeStamp"/>
|
|
||||||
<to name="timeStamp"/>
|
|
||||||
</property>
|
|
||||||
<property>
|
|
||||||
<from name="longitude"/>
|
|
||||||
<to name="longitude"/>
|
|
||||||
</property>
|
|
||||||
<property>
|
|
||||||
<from name="latitude"/>
|
|
||||||
<to name="latitude"/>
|
|
||||||
</property>
|
|
||||||
</mapping>
|
|
||||||
<to eventAdapterType="rdbms">
|
|
||||||
<property name="datasource.name">WSO2_GEO_DB</property>
|
|
||||||
<property name="table.name">alerts_history</property>
|
|
||||||
<property name="execution.mode">insert</property>
|
|
||||||
<property name="update.keys"/>
|
|
||||||
</to>
|
|
||||||
</eventPublisher>
|
|
@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<EventStoreConfiguration>
|
||||||
|
<TableSchema>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>id</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>true</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>state</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>true</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>information</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>timeStamp</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>true</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>LONG</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>latitude</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>DOUBLE</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>longitude</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>DOUBLE</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>type</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>true</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
</TableSchema>
|
||||||
|
<Source>
|
||||||
|
<StreamId>Geo-Publisher-RDBMS-GeoAlertNotifications:1.0.0</StreamId>
|
||||||
|
</Source>
|
||||||
|
<MergeSchema>false</MergeSchema>
|
||||||
|
<RecordStoreName>EVENT_STORE</RecordStoreName>
|
||||||
|
</EventStoreConfiguration>
|
17
components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js → components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js
17
components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js → components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js
17
components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js → components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js
17
components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js → components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
~
|
|
||||||
~ WSO2 Inc. licenses this file to you 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<artifact name="raspberrypi_receiver" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
|
|
||||||
<file>raspberrypi_receiver.xml</file>
|
|
||||||
</artifact>
|
|
17
components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js → components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js
17
components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js → components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
~
|
|
||||||
~ WSO2 Inc. licenses this file to you 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<artifact name="virtualfirealarm_receiver" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
|
|
||||||
<file>virtualfirealarm_receiver.xml</file>
|
|
||||||
</artifact>
|
|
@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
~
|
|
||||||
~ WSO2 Inc. licenses this file to you 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<artifact name= "virtualfirealarm_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
|
|
||||||
<file>org.wso2.iot.virtualfirealarm_1.0.0.json</file>
|
|
||||||
</artifact>
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function onRequest(context){
|
||||||
|
var viewModel = {};
|
||||||
|
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
||||||
|
viewModel["permissions"] = userModule.getUIPermissions();
|
||||||
|
return viewModel;
|
||||||
|
}
|
@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. licenses this file to you 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.
|
|
||||||
*/
|
|
||||||
package org.wso2.carbon.device.mgt.output.adapter.websocket.authorization;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.wso2.carbon.base.MultitenantConstants;
|
|
||||||
import org.wso2.carbon.device.mgt.output.adapter.websocket.internal.WebsocketEventAdaptorServiceDataHolder;
|
|
||||||
import org.wso2.carbon.registry.api.Resource;
|
|
||||||
import org.wso2.carbon.registry.core.Registry;
|
|
||||||
import org.wso2.carbon.registry.core.exceptions.RegistryException;
|
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility class which holds necessary utility methods required for persisting permissions in
|
|
||||||
* registry.
|
|
||||||
*/
|
|
||||||
public class PermissionUtil {
|
|
||||||
|
|
||||||
public static final String PERMISSION_PROPERTY_NAME = "name";
|
|
||||||
private static Log log = LogFactory.getLog(DeviceAuthorizer.class);
|
|
||||||
|
|
||||||
public static void putPermission(String permission) {
|
|
||||||
try {
|
|
||||||
StringTokenizer tokenizer = new StringTokenizer(permission, "/");
|
|
||||||
String lastToken = "", currentToken, tempPath;
|
|
||||||
while (tokenizer.hasMoreTokens()) {
|
|
||||||
currentToken = tokenizer.nextToken();
|
|
||||||
tempPath = lastToken + "/" + currentToken;
|
|
||||||
if (!checkResourceExists(tempPath)) {
|
|
||||||
createRegistryCollection(tempPath, currentToken);
|
|
||||||
|
|
||||||
}
|
|
||||||
lastToken = tempPath;
|
|
||||||
}
|
|
||||||
} catch (org.wso2.carbon.registry.api.RegistryException e) {
|
|
||||||
log.error("Failed to creation permission in registry" + permission, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void createRegistryCollection(String path, String resourceName)
|
|
||||||
throws org.wso2.carbon.registry.api.RegistryException {
|
|
||||||
Resource resource = getGovernanceRegistry().newCollection();
|
|
||||||
resource.addProperty(PERMISSION_PROPERTY_NAME, resourceName);
|
|
||||||
getGovernanceRegistry().beginTransaction();
|
|
||||||
getGovernanceRegistry().put(path, resource);
|
|
||||||
getGovernanceRegistry().commitTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean checkResourceExists(String path)
|
|
||||||
throws RegistryException {
|
|
||||||
return getGovernanceRegistry().resourceExists(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Registry getGovernanceRegistry() throws RegistryException {
|
|
||||||
return WebsocketEventAdaptorServiceDataHolder.getRegistryService()
|
|
||||||
.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue