revert-70aa11f8
Pasindu 8 years ago
commit d666f9ea14

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId> <artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name> <name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description> <description>WSO2 Carbon - API Management Custom Annotation Module</description>

@ -21,12 +21,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name> <name>WSO2 Carbon - API Application Management API</name>

@ -22,12 +22,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name> <name>WSO2 Carbon - API Application Management</name>

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId> <artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name> <name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description> <description>WSO2 Carbon - API Management Security Handler Module</description>

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name> <name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

@ -21,24 +21,43 @@ package org.wso2.carbon.apimgt.integration.client.util;
import feign.Client; import feign.Client;
import javax.net.ssl.HostnameVerifier; import javax.net.ssl.*;
import javax.net.ssl.SSLContext; import java.io.FileInputStream;
import javax.net.ssl.SSLSession; import java.io.FileNotFoundException;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.IOException; import java.io.IOException;
import java.security.KeyManagementException; import java.io.InputStream;
import java.security.NoSuchAlgorithmException; import java.security.*;
import java.security.cert.CertificateException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import feign.Logger; import feign.Logger;
import feign.Request; import feign.Request;
import feign.Response; import feign.Response;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
public class Utils { public class Utils {
private static final Log log = LogFactory.getLog(Utils.class);
private static final String KEY_STORE_TYPE = "JKS";
/**
* Default truststore type of the client
*/
private static final String TRUST_STORE_TYPE = "JKS";
/**
* Default keymanager type of the client
*/
private static final String KEY_MANAGER_TYPE = "SunX509"; //Default Key Manager Type
/**
* Default trustmanager type of the client
*/
private static final String TRUST_MANAGER_TYPE = "SunX509"; //Default Trust Manager Type
private static final String SSLV3 = "SSLv3";
//This method is only used if the mb features are within DAS. //This method is only used if the mb features are within DAS.
public static String replaceProperties(String text) { public static String replaceProperties(String text) {
String regex = "\\$\\{(.*?)\\}"; String regex = "\\$\\{(.*?)\\}";
@ -55,15 +74,20 @@ public class Utils {
} }
public static Client getSSLClient() { public static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() { boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
@Override if(isIgnoreHostnameVerification) {
public boolean verify(String s, SSLSession sslSession) { return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
return true; @Override
} public boolean verify(String s, SSLSession sslSession) {
}); return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
} }
private static SSLSocketFactory getTrustedSSLSocketFactory() { private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try { try {
TrustManager[] trustAllCerts = new TrustManager[]{ TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() { new X509TrustManager() {
@ -86,4 +110,60 @@ public class Utils {
} }
} }
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,KEY_STORE_TYPE);
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KEY_MANAGER_TYPE);
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE);
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance(SSLV3);
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword,String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,TRUST_STORE_TYPE);
}
} }

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name> <name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name> <name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description> <description>WSO2 Carbon - API Management Webapp Publisher</description>

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name> <name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name> <name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description> <description>WSO2 Carbon - Certificate Management Core</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Component</name> <name>WSO2 Carbon - Certificate Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlRootElement;
public class GeoLocationConfiguration { public class GeoLocationConfiguration {
private boolean publishLocationOperationResponse; private boolean publishLocationOperationResponse;
private boolean isEnabled;
public boolean getPublishLocationOperationResponse() { public boolean getPublishLocationOperationResponse() {
return publishLocationOperationResponse; return publishLocationOperationResponse;
@ -37,4 +38,13 @@ public class GeoLocationConfiguration {
public void setPublishLocationOperationResponse(boolean publishLocationOperationResponse) { public void setPublishLocationOperationResponse(boolean publishLocationOperationResponse) {
this.publishLocationOperationResponse = publishLocationOperationResponse; this.publishLocationOperationResponse = publishLocationOperationResponse;
} }
public boolean getIsEnabled() {
return isEnabled;
}
@XmlElement(name = "isEnabled", required = true)
public void setEnabled(boolean enabled) {
isEnabled = enabled;
}
} }

@ -155,7 +155,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, d.NAME, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, d.NAME, " +
"t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_DETAIL dt " + "t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_DETAIL dt " +
"WHERE t.NAME = ? AND t.ID = d.DEVICE_TYPE_ID AND d.DEVICE_IDENTIFICATION = ? AND d.TENANT_ID = ? AND dt.DEVICE_ID = d.ID " + "WHERE t.NAME = ? AND t.ID = d.DEVICE_TYPE_ID AND d.DEVICE_IDENTIFICATION = ? AND d.TENANT_ID = ? AND dt.DEVICE_ID = d.ID " +
"AND dt.UPDATE_TIMESTAMP > ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ?" ; "AND dt.UPDATE_TIMESTAMP > ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ? ORDER BY e.DATE_OF_LAST_UPDATE DESC" ;
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
int paramIdx = 1; int paramIdx = 1;
stmt.setString(paramIdx++, deviceIdentifier.getType()); stmt.setString(paramIdx++, deviceIdentifier.getType());
@ -190,7 +190,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, d.NAME, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, d.NAME, " +
"t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE " + "t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE " +
"t.NAME = ? AND t.ID = d.DEVICE_TYPE_ID AND d.DEVICE_IDENTIFICATION = ? AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID " + "t.NAME = ? AND t.ID = d.DEVICE_TYPE_ID AND d.DEVICE_IDENTIFICATION = ? AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID " +
"AND TENANT_ID = ? AND e.STATUS = ?"; "AND TENANT_ID = ? AND e.STATUS = ? ORDER BY e.DATE_OF_LAST_UPDATE DESC";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, deviceIdentifier.getType()); stmt.setString(1, deviceIdentifier.getType());
stmt.setString(2, deviceIdentifier.getId()); stmt.setString(2, deviceIdentifier.getId());
@ -285,7 +285,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID AS DEVICE_ID, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID AS DEVICE_ID, " +
"d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " + "d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " +
"DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ?) d1 " + "DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ?) d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ?"; "WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? ORDER BY e.DATE_OF_LAST_UPDATE DESC";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
@ -317,7 +317,8 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, " +
"d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " + "d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " +
"DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND t.NAME = ? " + "DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND t.NAME = ? " +
"AND t.ID = d.DEVICE_TYPE_ID AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ?"; "AND t.ID = d.DEVICE_TYPE_ID AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ?" +
" ORDER BY e.DATE_OF_LAST_UPDATE DESC";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, type); stmt.setString(1, type);
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
@ -350,7 +351,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
" e1.DATE_OF_ENROLMENT, d.DESCRIPTION, d.NAME AS DEVICE_NAME, d.DEVICE_IDENTIFICATION, t.NAME " + " e1.DATE_OF_ENROLMENT, d.DESCRIPTION, d.NAME AS DEVICE_NAME, d.DEVICE_IDENTIFICATION, t.NAME " +
"AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " + "AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " +
"e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " + "e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " +
"e.TENANT_ID = ? AND LOWER(e.OWNER) = LOWER(?)) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " + "e.TENANT_ID = ? AND LOWER(e.OWNER) = LOWER(?) ORDER BY e.DATE_OF_LAST_UPDATE DESC) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " +
"AND t.ID = d.DEVICE_TYPE_ID"; "AND t.ID = d.DEVICE_TYPE_ID";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
@ -383,7 +384,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
" e1.DATE_OF_ENROLMENT, d.DESCRIPTION, d.NAME AS DEVICE_NAME, d.DEVICE_IDENTIFICATION, t.NAME " + " e1.DATE_OF_ENROLMENT, d.DESCRIPTION, d.NAME AS DEVICE_NAME, d.DEVICE_IDENTIFICATION, t.NAME " +
"AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " + "AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " +
"e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " + "e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " +
"e.TENANT_ID = ? AND LOWER(e.OWNER) = LOWER(?)) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " + "e.TENANT_ID = ? AND LOWER(e.OWNER) = LOWER(?) ORDER BY e.DATE_OF_LAST_UPDATE DESC) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " +
"AND t.ID = d.DEVICE_TYPE_ID AND t.NAME= ?"; "AND t.ID = d.DEVICE_TYPE_ID AND t.NAME= ?";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);

@ -200,33 +200,7 @@ public final class DeviceManagementDAOUtil {
if (deviceInfoIncluded) { if (deviceInfoIncluded) {
device.setDeviceInfo(loadDeviceInfo(rs)); device.setDeviceInfo(loadDeviceInfo(rs));
} }
return device;
if (EnrolmentInfo.Status.ACTIVE.equals(device.getEnrolmentInfo().getStatus())) {
return device;
}
deviceMap.put(device.getEnrolmentInfo().getStatus(), device);
while (rs.next()) {
device = loadDevice(rs);
if (deviceInfoIncluded) {
device.setDeviceInfo(loadDeviceInfo(rs));
}
if (EnrolmentInfo.Status.ACTIVE.equals(device.getEnrolmentInfo().getStatus())) {
return device;
}
if (device.getEnrolmentInfo() != null) {
deviceMap.put(device.getEnrolmentInfo().getStatus(), device);
}
}
if (deviceMap.containsKey(EnrolmentInfo.Status.UNREACHABLE)) {
return deviceMap.get(EnrolmentInfo.Status.UNREACHABLE);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.INACTIVE)) {
return deviceMap.get(EnrolmentInfo.Status.INACTIVE);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.CREATED)) {
return deviceMap.get(EnrolmentInfo.Status.CREATED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.UNCLAIMED)) {
return deviceMap.get(EnrolmentInfo.Status.UNCLAIMED);
}
return null;
} }
//This method will retrieve most appropriate device information when there are multiple device enrollments for //This method will retrieve most appropriate device information when there are multiple device enrollments for
@ -237,39 +211,6 @@ public final class DeviceManagementDAOUtil {
if (deviceInfoIncluded) { if (deviceInfoIncluded) {
device.setDeviceInfo(loadDeviceInfo(rs)); device.setDeviceInfo(loadDeviceInfo(rs));
} }
if (EnrolmentInfo.Status.ACTIVE.equals(device.getEnrolmentInfo().getStatus())) {
return device;
}
while (rs.next()) {
device = loadDevice(rs);
if (deviceInfoIncluded) {
device.setDeviceInfo(loadDeviceInfo(rs));
}
if (EnrolmentInfo.Status.ACTIVE.equals(device.getEnrolmentInfo().getStatus())) {
return device;
}
if (device.getEnrolmentInfo() != null) {
deviceMap.put(device.getEnrolmentInfo().getStatus(), device);
}
}
if (deviceMap.containsKey(EnrolmentInfo.Status.UNREACHABLE)) {
return deviceMap.get(EnrolmentInfo.Status.UNREACHABLE);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.INACTIVE)) {
return deviceMap.get(EnrolmentInfo.Status.INACTIVE);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED)) {
return deviceMap.get(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.CREATED)) {
return deviceMap.get(EnrolmentInfo.Status.CREATED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.REMOVED)) {
return deviceMap.get(EnrolmentInfo.Status.REMOVED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.UNCLAIMED)) {
return deviceMap.get(EnrolmentInfo.Status.UNCLAIMED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.SUSPENDED)) {
return deviceMap.get(EnrolmentInfo.Status.SUSPENDED);
} else if (deviceMap.containsKey(EnrolmentInfo.Status.BLOCKED)) {
return deviceMap.get(EnrolmentInfo.Status.BLOCKED);
}
return device; return device;
} }

@ -18,8 +18,6 @@
package org.wso2.carbon.device.mgt.core.dto; package org.wso2.carbon.device.mgt.core.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition;
@ -36,7 +34,6 @@ public class DeviceType implements Serializable {
@ApiModelProperty(name = "name", value = "Device type name", required = true) @ApiModelProperty(name = "name", value = "Device type name", required = true)
private String name; private String name;
@JsonProperty("metaDefinition")
@ApiModelProperty(name = "metaDefinition", value = "Device type definition", required = true) @ApiModelProperty(name = "metaDefinition", value = "Device type definition", required = true)
private DeviceTypeMetaDefinition deviceTypeMetaDefinition; private DeviceTypeMetaDefinition deviceTypeMetaDefinition;
@ -47,7 +44,6 @@ public class DeviceType implements Serializable {
this.name = name; this.name = name;
} }
@JsonIgnore
public int getId() { public int getId() {
return id; return id;
} }

@ -213,6 +213,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
enrolmentId = enrollmentDAO. enrolmentId = enrollmentDAO.
addEnrollment(existingDevice.getId(), newEnrolmentInfo, tenantId); addEnrollment(existingDevice.getId(), newEnrolmentInfo, tenantId);
DeviceManagementDAOFactory.commitTransaction(); DeviceManagementDAOFactory.commitTransaction();
this.removeDeviceFromCache(deviceIdentifier);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("An enrolment is successfully added with the id '" + enrolmentId + log.debug("An enrolment is successfully added with the id '" + enrolmentId +
"' associated with " + "the device identified by key '" + "' associated with " + "the device identified by key '" +

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -36,7 +36,7 @@ import java.util.List;
* Implements CRUD for Devices. This holds the generic implementation. An instance of this will be created for * Implements CRUD for Devices. This holds the generic implementation. An instance of this will be created for
* each device type. * each device type.
*/ */
public class DeviceTypePluginDAOImpl implements PluginDAO{ public class DeviceTypePluginDAOImpl implements PluginDAO {
private static final Log log = LogFactory.getLog(DeviceTypePluginDAOImpl.class); private static final Log log = LogFactory.getLog(DeviceTypePluginDAOImpl.class);
private DeviceTypeDAOHandler deviceTypeDAOHandler; private DeviceTypeDAOHandler deviceTypeDAOHandler;
@ -241,9 +241,11 @@ public class DeviceTypePluginDAOImpl implements PluginDAO{
} }
private String getPropertString(List<Device.Property> properties, String propertyName) { private String getPropertString(List<Device.Property> properties, String propertyName) {
for (Device.Property property : properties) { if (properties != null) {
if (property.getName() != null && property.getName().equals(propertyName)) { for (Device.Property property : properties) {
return property.getValue(); if (property.getName() != null && property.getName().equals(propertyName)) {
return property.getValue();
}
} }
} }
return null; return null;

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -1,6 +1,7 @@
{ {
"appContext": "/devicemgt/", "appContext": "/devicemgt/",
"isCloud": false, "isCloud": false,
"isDeviceOwnerEnabled": false,
"httpsURL": "https://%iot.gateway.host%:%iot.gateway.https.port%", "httpsURL": "https://%iot.gateway.host%:%iot.gateway.https.port%",
"httpURL": "http://%iot.gateway.host%:%iot.gateway.http.port%", "httpURL": "http://%iot.gateway.host%:%iot.gateway.http.port%",
"wssURL": "https://%iot.analytics.host%:%iot.analytics.https.port%", "wssURL": "https://%iot.analytics.host%:%iot.analytics.https.port%",

@ -1,112 +1,137 @@
{ {
"Logo": { "Logo": {
"name": "Cloud", "name": "Cloud",
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt", "url": "https://cloudmgt.cloud.wso2.com/cloudmgt",
"target": "_parent" "target": "_parent"
}, },
"Main": { "Main": {
"Domain": { "Domain": {
"url": "#", "url": "#",
"icon": "fw fw-organization", "icon": "fw fw-organization",
"isAdminOnly": false, "isAdminOnly": false,
"target": "_parent", "target": "_parent",
"dropDown": { "dropDown": {
"Organization": { "Organization": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag",
"icon": "fw fw-organization", "icon": "fw fw-organization",
"dropDown": "false", "dropDown": "false",
"target": "_self" "target": "_self"
},
"Members": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag",
"icon": "fa fa-users",
"dropDown": "false",
"target": "_self"
}
}
},
"Account": {
"url": "#",
"icon": "fw fw-resource",
"isAdminOnly": false,
"billingEnabled": true,
"billingApi": {
"username": "admin",
"password": "admin"
},
"cloudMgtIndexPage": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/index.jag",
"dropDown": {
"Upgrade Now": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/payment-plans.jag?cloud-type=device_cloud",
"icon": "fw fw-export",
"dropDown": "true",
"target": "_self"
},
"Request Extension": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud&request-extension=true",
"icon": "fa fa-mail",
"dropDown": "true",
"target": "_self"
}
}
},
"Support": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud",
"icon": "fw fw-mail",
"isAdminOnly": false,
"target": "_self",
"dropDown": "false"
}, },
"Members": { "Documentation": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", "url": "#",
"icon": "fa fa-users", "icon": "fw fw-document",
"dropDown": "false", "isAdminOnly": false,
"target": "_self" "dropDown": {
"Device Cloud": {
"id": "device_cloud",
"url": "https://docs.wso2.com/display/DeviceCloud/WSO2+Device+Cloud+Documentation",
"icon": "fw fw-mobile",
"target": "_blank"
}
}
} }
}
}, },
"Support": { "User": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag", "url": "#",
"icon": "fw fw-mail",
"isAdminOnly": false,
"target": "_self",
"dropDown": "false"
},
"Documentation": {
"url": "#",
"icon": "fw fw-document",
"isAdminOnly": false,
"dropDown": {
"Device Cloud": {
"id": "device_cloud",
"url": "https://docs.wso2.com/display/DeviceCloud/WSO2+Device+Cloud+Documentation",
"icon": "fw fw-mobile",
"target": "_blank"
}
}
}
},
"User": {
"url": "#",
"icon": "fw fw-user",
"dropDown": {
"Profile": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user-profile.jag",
"icon": "fw fw-user", "icon": "fw fw-user",
"dropDown": "true", "dropDown": {
"target": "_self" "Profile": {
}, "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user-profile.jag",
"Change Password": { "icon": "fw fw-user",
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/change-password.jag", "dropDown": "true",
"icon": "fw fw-lock", "target": "_self"
"dropDown": "true", },
"target": "_self" "Change Password": {
}, "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/change-password.jag",
"Logout": { "icon": "fw fw-lock",
"url": "https://api.cloud.wso2.com/publisher/site/pages/logout.jag", "dropDown": "true",
"icon": "fw fw-sign-out", "target": "_self"
"dropDown": "true", },
"target": "_self" "Logout": {
} "url": "https://device.cloud.wso2.com/devicemgt/logout",
} "icon": "fw fw-sign-out",
}, "dropDown": "true",
"Expand": { "target": "_self"
"Clouds": { }
"API Cloud": { }
"id": "api_cloud",
"url": "https://api.cloud.wso2.com/publisher",
"icon": "fw fw-api fw-3x",
"dropDown": "true",
"target": "_self"
},
"Integration Cloud": {
"id": "integration_cloud",
"url": "https://integration.cloud.wso2.com/appmgt",
"icon": "fw fw-service fw-3x",
"dropDown": "true",
"target": "_self"
},
"Identity Cloud": {
"id": "integration_cloud",
"url": "https://identity.cloud.wso2.com/admin",
"icon": "fw fw-security fw-3x",
"dropDown": "true",
"target": "_self"
}
}, },
"Actions": { "Expand": {
"Organization": { "Clouds": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", "API Cloud": {
"icon": "fw fw-organization fw-3x", "id": "api_cloud",
"dropDown": "true", "url": "https://api.cloud.wso2.com/publisher",
"target": "_self" "icon": "fw fw-api fw-3x",
}, "dropDown": "true",
"Members": { "target": "_self"
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", },
"icon": "fa fa-users fa-3x", "Integration Cloud": {
"dropDown": "true", "id": "integration_cloud",
"target": "_self" "url": "https://integration.cloud.wso2.com/appmgt",
} "icon": "fw fw-service fw-3x",
"dropDown": "true",
"target": "_self"
},
"Identity Cloud": {
"id": "integration_cloud",
"url": "https://identity.cloud.wso2.com/admin",
"icon": "fw fw-security fw-3x",
"dropDown": "true",
"target": "_self"
}
},
"Actions": {
"Organization": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag",
"icon": "fw fw-organization fw-3x",
"dropDown": "true",
"target": "_self"
},
"Members": {
"url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag",
"icon": "fa fa-users fa-3x",
"dropDown": "true",
"target": "_self"
}
}
} }
}
} }

@ -79,18 +79,19 @@ var operationModule = function () {
return featuresList; return featuresList;
}; };
publicMethods.getControlOperations = function (deviceType) { publicMethods.getControlOperations = function (device) {
var deviceType = device.type;
var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation"); var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation");
var features = utility.getDeviceTypeConfig(deviceType).deviceType.features; var features = utility.getDeviceTypeConfig(deviceType).deviceType.features;
for (var op in operations) { for (var op in operations) {
var iconIdentifier = operations[op].operation; var iconIdentifier = operations[op].operation;
if (features && features[iconIdentifier]) { if (features && features[iconIdentifier]) {
var icon = features[iconIdentifier].icon; var icon = features[iconIdentifier].icon;
var isCloud = devicemgtProps["isCloud"]; //TODO: need improve this check to get feature availability from agent side
//TODO: remove isCloud check once able to verify features from the device agent var filter = features[iconIdentifier].filter;
var isDisabled = features[iconIdentifier].isDisabled; if (device && filter && filter.property && device[filter.property] !== filter.value) {
if (isDisabled && isCloud) { operations[op]["isDisabled"] = true;
operations[op]["isDisabled"] = isDisabled; operations[op]["disabledText"] = filter.text;
} else { } else {
operations[op]["isDisabled"] = false; operations[op]["isDisabled"] = false;
} }

@ -56,6 +56,8 @@ var conf = function () {
} }
} }
); );
var DeviceConfigurationManager = Packages.org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
conf["serverConfig"] = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
application.put("CONF", conf); application.put("CONF", conf);
} }
return conf; return conf;

@ -209,7 +209,7 @@
data-search="{{platform}}" data-search="{{platform}}"
data-display="{{platform}}"> data-display="{{platform}}">
</td> </td>
<td class="remove-padding-top" <td class="remove-padding-top hidden"
data-search="{{ownershipType}}" data-search="{{ownershipType}}"
data-display="{{ownershipType}}" data-display="{{ownershipType}}"
data-grid-label="Ownership"> data-grid-label="Ownership">

@ -36,7 +36,7 @@
} }
</style> </style>
{{#each control_operations}} {{#each control_operations}}
<a href="javascript:operationSelect('{{operation}}')"> <a class='operation-tile' href="javascript:operationSelect('{{operation}}')">
<i class="fw fw-service"></i> <i class="fw fw-service"></i>
<span>{{name}}</span> <span>{{name}}</span>
</a> </a>
@ -93,7 +93,7 @@
<div class="row"> <div class="row">
<div class="col-lg-5 col-md-6 col-centered"> <div class="col-lg-5 col-md-6 col-centered">
<h3> <h3>
<span class="fw-stack"> <span class="fw-stack center-block">
<i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i> <i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span> </span>

@ -51,6 +51,7 @@ function submitForm(formId) {
var defaultStatusClasses = "fw fw-stack-1x"; var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#operation-response-template").find(".content"); var content = $("#operation-response-template").find(".content");
var title = content.find("#title"); var title = content.find("#title");
title.attr("class","center-block text-center");
var statusIcon = content.find("#status-icon"); var statusIcon = content.find("#status-icon");
var description = content.find("#description"); var description = content.find("#description");
var successCallBack = function (response) { var successCallBack = function (response) {

@ -35,7 +35,7 @@
} }
</style> </style>
{{#each control_operations}} {{#each control_operations}}
<a href="javascript:operationSelect('{{operation}}')"> <a class='operation-tile' href="javascript:operationSelect('{{operation}}')">
{{#if iconFont}} {{#if iconFont}}
<i class="fw {{iconFont}}"></i> <i class="fw {{iconFont}}"></i>
{{else}} {{else}}
@ -79,6 +79,11 @@
<input type="{{type}}" id="{{name}}" placeholder="{{name}}" class="form-control" data-param-type="query" value="{{value}}" /> <input type="{{type}}" id="{{name}}" placeholder="{{name}}" class="form-control" data-param-type="query" value="{{value}}" />
<br /> <br />
{{/each}} {{/each}}
{{#each uiParams}}
<input type="{{type}}" id="{{id}}" name="{{name}}" data-param-type="form" value="{{value}}" />
<label>{{label}}</label>
<br />
{{/each}}
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')" class="btn btn-default">&nbsp;&nbsp;&nbsp;&nbsp;Send <button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')" class="btn btn-default">&nbsp;&nbsp;&nbsp;&nbsp;Send
to Device&nbsp;&nbsp;&nbsp;&nbsp;</button> to Device&nbsp;&nbsp;&nbsp;&nbsp;</button>
<label id="lblSending" class="wr-input-label hidden"><i <label id="lblSending" class="wr-input-label hidden"><i
@ -104,7 +109,7 @@
<div class="row"> <div class="row">
<div class="col-lg-5 col-md-6 col-centered"> <div class="col-lg-5 col-md-6 col-centered">
<h3> <h3>
<span class="fw-stack"> <span class="fw-stack center-block">
<i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i> <i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span> </span>

@ -22,7 +22,7 @@ function onRequest(context) {
var device = context.unit.params.device; var device = context.unit.params.device;
var autoCompleteParams = context.unit.params.autoCompleteParams; var autoCompleteParams = context.unit.params.autoCompleteParams;
var encodedFeaturePayloads=context.unit.params.encodedFeaturePayloads; var encodedFeaturePayloads=context.unit.params.encodedFeaturePayloads;
var controlOperations = operationModule.getControlOperations(device.type); var controlOperations = operationModule.getControlOperations(device);
var queryParams = []; var queryParams = [];
var formParams = []; var formParams = [];
var pathParams = []; var pathParams = [];

@ -33,6 +33,16 @@ function submitForm(formId) {
var uriencodedQueryStr = ""; var uriencodedQueryStr = "";
var uriencodedFormStr = ""; var uriencodedFormStr = "";
var payload = {}; var payload = {};
var isItemSelected;
//setting responses callbacks
var content = $("#operation-response-template").find(".content");
var defaultStatusClasses = "fw fw-stack-1x";
var title = content.find("#title");
title.attr("class","center-block text-center");
var statusIcon = content.find("#status-icon");
var description = content.find("#description");
form.find("input").each(function () { form.find("input").each(function () {
var input = $(this); var input = $(this);
if (input.data("param-type") == "path") { if (input.data("param-type") == "path") {
@ -42,14 +52,31 @@ function submitForm(formId) {
uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val(); uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val();
} else if (input.data("param-type") == "form") { } else if (input.data("param-type") == "form") {
var prefix = (uriencodedFormStr == "") ? "" : "&"; var prefix = (uriencodedFormStr == "") ? "" : "&";
uriencodedFormStr += prefix + input.attr("id") + "=" + input.val(); if (input.attr("type") == "checkbox" || input.attr("type") == "radio"){
//payload[input.attr("id")] = input.val();
if (isItemSelected == undefined){
isItemSelected = false;
}
if (input.is(':checked')){
isItemSelected = true;
uriencodedFormStr += prefix + input.attr("name") + "=" + input.val();
}
}else{
uriencodedFormStr += prefix + input.attr("id") + "=" + input.val();
}
} }
}); });
if (isItemSelected === false){
title.html("Please Select One Option");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
return false;
}
uri += uriencodedQueryStr; uri += uriencodedQueryStr;
var httpMethod = form.attr("method").toUpperCase(); var httpMethod = form.attr("method").toUpperCase();
var contentType = form.attr("enctype"); var contentType = form.attr("enctype");
console.log(payload);
var featurePayload = form.attr("data-payload"); var featurePayload = form.attr("data-payload");
if (featurePayload) { if (featurePayload) {
contentType = "application/json"; contentType = "application/json";
@ -59,12 +86,7 @@ function submitForm(formId) {
contentType = "application/x-www-form-urlencoded"; contentType = "application/x-www-form-urlencoded";
payload = uriencodedFormStr; payload = uriencodedFormStr;
} }
//setting responses callbacks
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#operation-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var description = content.find("#description");
var successCallBack = function (response) { var successCallBack = function (response) {
var res = response; var res = response;
try { try {
@ -78,7 +100,6 @@ function submitForm(formId) {
$(modalPopupContent).html(content.html()); $(modalPopupContent).html(content.html());
}; };
var errorCallBack = function (response) { var errorCallBack = function (response) {
console.log(response);
title.html("An Error Occurred!"); title.html("An Error Occurred!");
statusIcon.attr("class", defaultStatusClasses + " fw-error"); statusIcon.attr("class", defaultStatusClasses + " fw-error");
var reason = (response.responseText == "null")?response.statusText:response.responseText; var reason = (response.responseText == "null")?response.statusText:response.responseText;
@ -105,9 +126,9 @@ function submitForm(formId) {
$(document).on('submit', 'form', function (e) { $(document).on('submit', 'form', function (e) {
e.preventDefault(); e.preventDefault();
var postOperationRequest = $.ajax({ var postOperationRequest = $.ajax({
url: $(this).attr("action") + '&' + $(this).serialize(), url: $(this).attr("action") + '&' + $(this).serialize(),
method: "post" method: "post"
}); });
var btnSubmit = $('#btnSend', this); var btnSubmit = $('#btnSend', this);
btnSubmit.addClass('hidden'); btnSubmit.addClass('hidden');

@ -72,10 +72,6 @@
padding: 20px 0px; padding: 20px 0px;
} }
#location{
height: calc(100vh - 400px);
}
.page-loader{ .page-loader{
position: absolute; position: absolute;
left: 0px; left: 0px;

@ -140,6 +140,10 @@ function loadOperationsLog(update) {
}); });
$("a[data-toggle=\"tab\"]").on("shown.bs.tab", function (e) {
$("#operation-log").DataTable().columns.adjust().responsive.recalc();
});
function renderLogDetails(obj,data) { function renderLogDetails(obj,data) {
var payload = JSON.parse(data); var payload = JSON.parse(data);
var logStream = '<div class="log-data">'; var logStream = '<div class="log-data">';

@ -34,14 +34,14 @@
<div class="col-lg-9"> <div class="col-lg-9">
<div class="device-info"> <div class="device-info">
{{#defineZone "device-details-header"}} {{#defineZone "device-details-header"}}
<h1 data-deviceid="{{device.deviceIdentifier}}" <h1 class="device-id" data-deviceid="{{device.deviceIdentifier}}"
data-type="{{device.type}}" data-type="{{device.type}}"
data-ownership="{{device.ownership}}" data-ownership="{{device.ownership}}"
data-owner="{{device.owner}}"> data-owner="{{device.owner}}">
{{#if device.viewModel.model}} {{#if device.model}}
<h4>{{device.viewModel.vendor}} {{device.viewModel.model}}</h4> <h4>{{device.vendor}} {{device.model}}</h4>
{{/if}} {{/if}}
<h4>Ownership - <strong>{{device.viewModel.ownership}}</strong></h4> <h4>Ownership - <strong>{{device.ownership}}</strong></h4>
<h4>Device is <h4>Device is
<strong> <strong>
{{#equal device.status "ACTIVE"}}Active{{/equal}} {{#equal device.status "ACTIVE"}}Active{{/equal}}

@ -35,10 +35,6 @@ function onRequest(context) {
if (filteredDeviceData["type"]) { if (filteredDeviceData["type"]) {
viewModel["deviceType"] = filteredDeviceData["type"]; viewModel["deviceType"] = filteredDeviceData["type"];
viewModel["type"] = filteredDeviceData["type"]; viewModel["type"] = filteredDeviceData["type"];
viewModel.isNotWindows = true;
if (viewModel["deviceType"] == "windows") {
viewModel.isNotWindows = false;
}
} }
if (filteredDeviceData["deviceIdentifier"]) { if (filteredDeviceData["deviceIdentifier"]) {
viewModel["deviceIdentifier"] = filteredDeviceData["deviceIdentifier"]; viewModel["deviceIdentifier"] = filteredDeviceData["deviceIdentifier"];
@ -65,138 +61,6 @@ function onRequest(context) {
viewModel["ownership"] = filteredDeviceData["enrolmentInfo"]["ownership"]; viewModel["ownership"] = filteredDeviceData["enrolmentInfo"]["ownership"];
} }
} }
if (filteredDeviceData["initialDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = true;
if (filteredDeviceData["initialDeviceInfo"]["IMEI"]) {
viewModel["imei"] = filteredDeviceData["initialDeviceInfo"]["IMEI"];
}
if (!filteredDeviceData["latestDeviceInfo"]) {
if (filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"]) {
if (filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"] != "0") {
viewModel["osBuildDate"] = new Date(filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"] * 1000);
}
}
if (filteredDeviceData["initialDeviceInfo"]["LATITUDE"] && filteredDeviceData["initialDeviceInfo"]["LONGITUDE"]) {
viewModel["location"] = {};
viewModel["location"]["latitude"] = filteredDeviceData["initialDeviceInfo"]["LATITUDE"];
viewModel["location"]["longitude"] = filteredDeviceData["initialDeviceInfo"]["LONGITUDE"];
}
if (filteredDeviceData["initialDeviceInfo"]["VENDOR"] && filteredDeviceData["initialDeviceInfo"]["DEVICE_MODEL"]) {
viewModel["vendor"] = filteredDeviceData["initialDeviceInfo"]["VENDOR"];
viewModel["model"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_MODEL"];
}
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]) {
if (deviceType == "android") {
viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["BATTERY_LEVEL"];
viewModel["internalMemory"] = {};
viewModel["internalMemory"]["total"] = Math.
round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 100) / 100;
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] != 0) {
viewModel["internalMemory"]["usage"] = Math.
round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] -
filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_AVAILABLE_MEMORY"])
/ filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 10000) / 100;
} else {
viewModel["internalMemory"]["usage"] = 0;
}
viewModel["externalMemory"] = {};
viewModel["externalMemory"]["total"] = Math.
round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 100) / 100;
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] != 0) {
viewModel["externalMemory"]["usage"] = Math.
round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] -
filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_AVAILABLE_MEMORY"])
/ filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 10000) / 100;
} else {
viewModel["externalMemory"]["usage"] = 0;
}
} else if (deviceType == "ios") {
viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["BatteryLevel"];
viewModel["internalMemory"] = {};
viewModel["internalMemory"]["total"] = Math.
round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] * 100) / 100;
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] != 0) {
viewModel["internalMemory"]["usage"] = Math.
round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] -
filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["AvailableDeviceCapacity"])
/ filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] * 10000) / 100;
} else {
viewModel["internalMemory"]["usage"] = 0;
}
}
}
}
}
if (filteredDeviceData["latestDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = true;
if (filteredDeviceData["latestDeviceInfo"]["osBuildDate"]) {
if (filteredDeviceData["latestDeviceInfo"]["osBuildDate"] != "0") {
viewModel["osBuildDate"] = new Date(filteredDeviceData["latestDeviceInfo"]["osBuildDate"] * 1000);
}
}
if (filteredDeviceData["latestDeviceInfo"]["location"]["latitude"] &&
filteredDeviceData["latestDeviceInfo"]["location"]["longitude"]) {
viewModel["location"] = {};
viewModel["location"]["latitude"] = filteredDeviceData["latestDeviceInfo"]["location"]["latitude"];
viewModel["location"]["longitude"] = filteredDeviceData["latestDeviceInfo"]["location"]["longitude"];
}
if (filteredDeviceData["latestDeviceInfo"]["vendor"] && filteredDeviceData["latestDeviceInfo"]["deviceModel"]) {
viewModel["vendor"] = filteredDeviceData["latestDeviceInfo"]["vendor"];
viewModel["model"] = filteredDeviceData["latestDeviceInfo"]["deviceModel"];
}
if (filteredDeviceData["latestDeviceInfo"]["updatedTime"]) {
viewModel["lastUpdatedTime"] = filteredDeviceData["latestDeviceInfo"]["updatedTime"].
substr(0, filteredDeviceData["latestDeviceInfo"]["updatedTime"].indexOf("+"));
}
viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = filteredDeviceData["latestDeviceInfo"]["batteryLevel"];
viewModel["cpuUsage"] = {};
viewModel["cpuUsage"]["value"] = filteredDeviceData["latestDeviceInfo"]["cpuUsage"];
viewModel["ramUsage"] = {};
if (filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] != 0) {
viewModel["ramUsage"]["value"] = Math.
round((filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] -
filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"])
/ filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] * 10000) / 100;
} else {
viewModel["ramUsage"]["value"] = 0;
}
viewModel["internalMemory"] = {};
viewModel["internalMemory"]["total"] = Math.
round(filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100;
if (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] != 0) {
viewModel["internalMemory"]["usage"] = Math.
round((filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] -
filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"])
/ filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 10000) / 100;
} else {
viewModel["internalMemory"]["usage"] = 0;
}
viewModel["externalMemory"] = {};
viewModel["externalMemory"]["total"] = Math.
round(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100;
if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) {
viewModel["externalMemory"]["usage"] = Math.
round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] -
filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"])
/ filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 10000) / 100;
} else {
viewModel["externalMemory"]["usage"] = 0;
}
}
if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = false;
}
deviceViewData["device"] = viewModel; deviceViewData["device"] = viewModel;
} else if (response["status"] == "unauthorized") { } else if (response["status"] == "unauthorized") {
deviceViewData["deviceFound"] = true; deviceViewData["deviceFound"] = true;

@ -64,6 +64,12 @@
<div id="" style="height: 63vh;"> <div id="" style="height: 63vh;">
<!-- Sidebar --> <!-- Sidebar -->
<div id="map"></div> <div id="map"></div>
{{#if geoServicesEnabled}}
<div id="ws-alerts">
<i id="ws-alert-stream" class="fw fw-circle text-muted"></i> Alerts Stream&nbsp;
<i id="ws-spatial-stream" class="fw fw-circle text-muted"></i> Spatial Stream
</div>
{{/if}}
</div> </div>
<div id="predictionResults" style="background: darkgray;display: none;border-radius: 13px;height: 94%;padding: 0" <div id="predictionResults" style="background: darkgray;display: none;border-radius: 13px;height: 94%;padding: 0"
@ -479,11 +485,13 @@
<div class="popover-content"> <div class="popover-content">
<h6>Information</h6> <h6>Information</h6>
<p id="information" class="bg-primary" style="margin: 0px;padding: 0px;"></p> <p id="information" class="bg-primary" style="margin: 0px;padding: 0px;"></p>
{{#if geoServicesEnabled}}
<h6>Speed<span class="label label-primary pull-right"><span id="speed"></span> km/h</span></h6> <h6>Speed<span class="label label-primary pull-right"><span id="speed"></span> km/h</span></h6>
<h6>Heading<span id="heading" class="label label-primary pull-right"></span></h6> <h6>Heading<span id="heading" class="label label-primary pull-right"></span></h6>
<button type="button" class="btn btn-info btn-xs" onClick="toggleSpeedGraph();return false;">Speed Graph</button> <button type="button" class="btn btn-info btn-xs" onClick="toggleSpeedGraph();return false;">Speed Graph</button>
<button type="button" class="btn btn-info btn-xs" onClick="focusOnRecentHistorySpatialObject();return false;">Recent History</button> <button type="button" class="btn btn-info btn-xs" onClick="focusOnRecentHistorySpatialObject();return false;">Recent History</button>
<button type="button" class="btn btn-info btn-xs" onClick="popupDateRange();">Full History</button> <button type="button" class="btn btn-info btn-xs" onClick="popupDateRange();">Full History</button>
{{/if}}
</div> </div>
</div> </div>
@ -526,7 +534,7 @@
<div class="form-group"> <div class="form-group">
<label class="text-primary" for="areaName">Fence name</label> <label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Fence name" type="text"> <input class="form-control" id="areaName" placeholder="Fence name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span> <span class="help-block">Name of the selected area(e.g. colombo)</span>
</div> </div>
<div> <div>
<div class="btn-group btn-group-sm btn-group-justified"> <div class="btn-group btn-group-sm btn-group-justified">
@ -557,7 +565,7 @@
<div class="form-group"> <div class="form-group">
<label class="text-primary" for="areaName">Fence name</label> <label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Fence name" type="text"> <input class="form-control" id="areaName" placeholder="Fence name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span> <span class="help-block">Name of the selected area(e.g. colombo)</span>
</div> </div>
<div> <div>
<div class="btn-group btn-group-sm btn-group-justified"> <div class="btn-group btn-group-sm btn-group-justified">
@ -589,7 +597,7 @@
<div class="form-group"> <div class="form-group">
<label class="text-primary" for="areaName">Fence name</label> <label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Stationery name" type="text"> <input class="form-control" id="areaName" placeholder="Stationery name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span> <span class="help-block">Name of the selected area(e.g. colombo)</span>
<label class="text-primary" for="fRadius">Fluctuation radius</label> <label class="text-primary" for="fRadius">Fluctuation radius</label>
<input class="form-control" id="fRadius" onblur="reformatRadius(this.form.fRadius.value);" placeholder="m" type="text"> <input class="form-control" id="fRadius" onblur="reformatRadius(this.form.fRadius.value);" placeholder="m" type="text">
@ -626,7 +634,7 @@
<div class="form-group"> <div class="form-group">
<label class="text-primary" for="areaName">Fence name</label> <label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Area Name" type="text"> <input class="form-control" id="areaName" placeholder="Area Name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span> <span class="help-block">Name of the selected area(e.g. colombo)</span>
</div> </div>
<div> <div>
<div class="btn-group btn-group-sm btn-group-justified"> <div class="btn-group btn-group-sm btn-group-justified">
@ -688,11 +696,11 @@
var geoLocationLink = $(".initGeoLocationLink"); var geoLocationLink = $(".initGeoLocationLink");
if (geoLocationLink) { if (geoLocationLink) {
geoLocationLink.on('click', function () { geoLocationLink.on('click', function () {
initializeGeoLocation() initializeGeoLocation({{geoServicesEnabled}});
}); });
{{#if showGeoFencingTools}} geoPublicUri = $("#geo-charts").data("geo-public-uri");
{{#if geoServicesEnabled}}
var geoToolsMenu = $('#location-action-bar'); var geoToolsMenu = $('#location-action-bar');
geoPublicUri = $("#geo-charts").data("geo-public-uri");
var realtTime = createGeoToolListItem('javascript:enableRealTime()', var realtTime = createGeoToolListItem('javascript:enableRealTime()',
'Return to Real Time View', 'fw fw-undo', geoToolsMenu); 'Return to Real Time View', 'fw fw-undo', geoToolsMenu);
realtTime.css("display", "none"); realtTime.css("display", "none");

@ -52,6 +52,6 @@ function onRequest(context) {
} else { } else {
viewModel.lastLocation = stringify({}); viewModel.lastLocation = stringify({});
} }
viewModel.showGeoFencingTools = true; viewModel.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
return viewModel; return viewModel;
} }

@ -34,7 +34,7 @@
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">&times;</button> <button class="close" type="button" data-dismiss="modal" aria-hidden="true">&times;</button>
<div class="col-lg-5 col-md-6 col-centered"> <div class="col-lg-5 col-md-6 col-centered">
<h4> <h4>
Set 'Stationery' alerts Set 'Stationary' alerts
<br> <br>
</h4> </h4>
</div> </div>
@ -46,8 +46,8 @@
<table class="table table-hover" id="stationary-alert-table"> <table class="table table-hover" id="stationary-alert-table">
<thead> <thead>
<tr> <tr>
<th>Stationery Name</th> <th>Stationary Name</th>
<th>Stationery Time</th> <th>Stationary Time</th>
<th>Fluctuation Radius</th> <th>Fluctuation Radius</th>
<th>Query Name</th> <th>Query Name</th>
<th>Created On</th> <th>Created On</th>

@ -40,38 +40,11 @@ function initialLoad() {
setTimeout(initialLoad, 500); // give everything some time to render setTimeout(initialLoad, 500); // give everything some time to render
} else { } else {
initializeMap(); initializeMap();
// getTileServers();
// loadWms();
processAfterInitializationMap(); processAfterInitializationMap();
//Access gps and make zoom to server location as map center
//navigator.geolocation.getCurrentPosition(success, error);
$("#loading").hide(); $("#loading").hide();
} }
} }
//function success(position) {
// var browserLatitude = position.coords.latitude;
// var browserLongitude = position.coords.longitude;
// map.setView([browserLatitude, browserLongitude]);
// map.setZoom(14);
// $.UIkit.notify({
// message: "Map view set to browser's location",
// status: 'info',
// timeout: ApplicationOptions.constance.NOTIFY_INFO_TIMEOUT,
// pos: 'top-center'
// });
//}
//
//function error() {
// $.UIkit.notify({
// message: "Unable to find browser location!",
// status: 'warning',
// timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
// pos: 'top-center'
// });
//}
function initializeMap() { function initializeMap() {
if (typeof(map) !== 'undefined') { if (typeof(map) !== 'undefined') {
map.remove(); map.remove();
@ -83,7 +56,7 @@ function initializeMap() {
map = L.map("map", { map = L.map("map", {
zoom: 14, zoom: 14,
center: [6.927078, 79.861243], center: [6.927078, 79.861243],
layers: [defaultOSM, defaultTFL], layers: [defaultOSM],
zoomControl: true, zoomControl: true,
attributionControl: false, attributionControl: false,
maxZoom: 20, maxZoom: 20,
@ -147,28 +120,20 @@ function processAfterInitializationMap() {
div.innerHTML = "<a href='#' onclick='$(\"#attributionModal\").modal(\"show\"); return false;'>Attribution</a>"; div.innerHTML = "<a href='#' onclick='$(\"#attributionModal\").modal(\"show\"); return false;'>Attribution</a>";
return div; return div;
}; };
// map.addControl(attributionControl);
map.addControl(L.control.fullscreen({position: 'bottomright'})); map.addControl(L.control.fullscreen({position: 'bottomright'}));
geoAlertsBar = L.control.geoAlerts({position: 'topright'}); geoAlertsBar = L.control.geoAlerts({position: 'topright'});
map.addControl(geoAlertsBar); map.addControl(geoAlertsBar);
//L.control.fullscreen({
// position: 'bottomright'
//}).addTo(map);
// L.control.zoom({
// position: "bottomright"
// }).addTo(map);
groupedOverlays = { groupedOverlays = {
"Web Map Service layers": {} "Web Map Service layers": {}
}; };
layerControl = L.control.groupedLayers(baseLayers, groupedOverlays, { layerControl = L.control.groupedLayers(baseLayers, groupedOverlays, {
collapsed: true collapsed: true,
position: 'bottomleft'
}).addTo(map); }).addTo(map);
//L.control.layers(baseLayers).addTo(map);
//map.addLayer(defaultTFL);
} }
/* Highlight search box text on click */ /* Highlight search box text on click */
@ -308,35 +273,43 @@ var getProviderData = function (timeFrom, timeTo) {
deviceId = deviceDetails.data("deviceid"); deviceId = deviceDetails.data("deviceid");
deviceType = deviceDetails.data("type"); deviceType = deviceDetails.data("type");
var serviceUrl = '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + timeFrom + '&to=' + timeTo; if (geoFencingEnabled) {
invokerUtil.get(serviceUrl, var serviceUrl = '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + timeFrom + '&to=' + timeTo;
function (data) { invokerUtil.get(serviceUrl,
tableData = JSON.parse(data); function (data) {
if (tableData.length === 0) { tableData = JSON.parse(data);
var geoCharts = $("#geo-charts"); if (tableData.length === 0) {
var location = geoCharts.data("device-location"); showCurrentLocation(tableData);
location.heading = 0; }
location.id = deviceId; }, function (message) {
location.values = {}; showCurrentLocation(tableData);
location.values.id = deviceId; });
location.values.information = "Last seen " + timeSince(new Date(location.updatedTime)); } else {
location.values.notify = false; showCurrentLocation(tableData);
location.values.speed = 0; }
location.values.state = "NORMAL";
location.values.longitude = location.longitude;
location.values.latitude = location.latitude;
location.timestamp = location.updatedTime;
location.values.timeStamp = location.updatedTime;
location.values.type = deviceType;
location._version = "1.0.0";
tableData.push(location);
}
}, function (message) {
console.log(message);
});
return tableData; return tableData;
}; };
function showCurrentLocation(tableData){
var geoCharts = $("#geo-charts");
var location = geoCharts.data("device-location");
location.heading = 0;
location.id = deviceId;
location.values = {};
location.values.id = deviceId;
location.values.information = "Last seen " + timeSince(new Date(location.updatedTime));
location.values.notify = false;
location.values.speed = 0;
location.values.state = "NORMAL";
location.values.longitude = location.longitude;
location.values.latitude = location.latitude;
location.timestamp = location.updatedTime;
location.values.timeStamp = location.updatedTime;
location.values.type = deviceType;
location._version = "1.0.0";
tableData.push(location);
}
function timeSince(date) { function timeSince(date) {
if (!date) { if (!date) {
@ -399,12 +372,10 @@ function enableRealTime() {
isBatchModeOn = false; isBatchModeOn = false;
} }
function InitSpatialObject() { var geoFencingEnabled = true;
function InitSpatialObject(geoFencingIsEnabled) {
geoFencingEnabled = geoFencingIsEnabled;
var spatialObject = drawSpatialObject(); var spatialObject = drawSpatialObject();
setTimeout(function () {
map.setView(spatialObject.marker.getLatLng(), spatialObject.marker.zoomLevel, {animate: true});
}, 1000
);
map.addControl(L.control.focus({position: 'bottomright', marker: spatialObject.marker, zoomLevel: zoomLevel})); map.addControl(L.control.focus({position: 'bottomright', marker: spatialObject.marker, zoomLevel: zoomLevel}));
} }
@ -455,13 +426,19 @@ function drawSpatialObject() {
return true; return true;
} }
map.setView(spatialObject.marker.getLatLng(), zoomLevel, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly if (geoFencingEnabled) {
var alertsFromDate = new Date();
alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours
getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf());
}
setTimeout(function () {
map.invalidateSize();
map.setView(spatialObject.marker.getLatLng(), spatialObject.marker.zoomLevel, {animate: true});
spatialObject.marker.openPopup();
spatialObject.drawPath();
}, 500);
var alertsFromDate = new Date();
alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours
getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf());
spatialObject.marker.openPopup();
spatialObject.drawPath();
if (speedGraphControl) { if (speedGraphControl) {
setTimeout(function () { setTimeout(function () {
createChart(); createChart();

@ -34,6 +34,7 @@ function initializeExit() {
} }
} else{ } else{
$(".fence-not-exist").show(); $(".fence-not-exist").show();
$("#exit-alert").hide();
} }
$('.viewGeoFenceRow td:not(:last-child)').click(function () { $('.viewGeoFenceRow td:not(:last-child)').click(function () {
viewFence(this.parentElement,'Exit'); viewFence(this.parentElement,'Exit');

@ -65,17 +65,7 @@ var defaultOSM = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
maxZoom: 19 maxZoom: 19
}); });
//var defaultTFL = L.tileLayer('https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{
// maxZoom: 19,
// subdomains:['mt0','mt1','mt2','mt3']
//});
var defaultTFL = L.tileLayer("", {
maxZoom: 19,
attribution: '| London Traffic and London Buses data Powered by TfL Open Data'
});
var baseLayers = { var baseLayers = {
//"Google Maps": defaultTFL,
"Open Street Maps": defaultOSM "Open Street Maps": defaultOSM
}; };
@ -564,7 +554,6 @@ function getAlertsHistory(deviceType, deviceId, timeFrom, timeTo) {
} }
}); });
}, function (message) { }, function (message) {
console.log(message);
}); });
} }

@ -38,6 +38,7 @@ function initStationaryAlert() {
} }
} else{ } else{
$(".fence-not-exist").show(); $(".fence-not-exist").show();
$("#stationary-alert-table").hide();
} }
$('.viewGeoFenceRow td:not(:last-child)').click(function () { $('.viewGeoFenceRow td:not(:last-child)').click(function () {
viewFence(this.parentElement,'Stationery'); viewFence(this.parentElement,'Stationery');

@ -34,6 +34,7 @@ function initializeWithin() {
} }
} else{ } else{
$(".fence-not-exist").show(); $(".fence-not-exist").show();
$("#within-alert").hide();
} }
$('.viewGeoFenceRow td:not(:last-child)').click(function () { $('.viewGeoFenceRow td:not(:last-child)').click(function () {
viewFence(this.parentElement,'WithIn'); viewFence(this.parentElement,'WithIn');

@ -20,7 +20,7 @@ var debugObject; // assign object and debug from browser console, this is for de
var showPathFlag = false; // Flag to hold the status of draw objects path var showPathFlag = false; // Flag to hold the status of draw objects path
var currentSpatialObjects = {}; var currentSpatialObjects = {};
var selectedSpatialObject; // This is set when user search for an object from the search box var selectedSpatialObject; // This is set when user search for an object from the search box
var websocket; var spatialWebsocket;
var onAlertWebsocket; var onAlertWebsocket;
var onTrafficStreamWebsocket; var onTrafficStreamWebsocket;
var currentPredictions = {}; var currentPredictions = {};
@ -506,36 +506,11 @@ function LocalStorageArray(id) {
}; };
} }
var webSocketOnTrafficStreamOpen = function () { var initLoading = true;
onTrafficStreamWebsocket.set_opened();
noty({text: 'You Are Connected to Traffic Stream !!', type: 'success'});
};
var webSocketOnTrafficStreamMessage = function processMessage(message) {
var json = $.parseJSON(message.data);
if (json.messageType == "Traffic") {
processTrafficMessage(json);
} else {
console.log("Message type not supported.");
}
};
var webSocketOnTrafficStreamClose = function (e) {
if (onTrafficStreamWebsocket.get_opened()) {
noty({text: 'Connection lost with Traffic Stream Stream !!', type: 'error'});
}
waitForSocketConnection(onTrafficStreamWebsocket, initializeOnTrafficStreamWebSocket);
};
var webSocketOnTrafficStreamError = function (e) {
if (!onTrafficStreamWebsocket.get_opened()) return;
noty({text: 'Something went wrong when trying to connect to <b>' + trafficStreamWebSocketURL + '<b/>', type: 'error'});
};
var webSocketOnAlertOpen = function () { var webSocketOnAlertOpen = function () {
onAlertWebsocket.set_opened(); onAlertWebsocket.set_opened();
noty({text: 'You Are Connected to Alert Stream !!', type: 'success'}); $('#ws-alert-stream').removeClass('text-muted text-danger text-success').addClass('text-success');
}; };
var webSocketOnAlertMessage = function processMessage(message) { var webSocketOnAlertMessage = function processMessage(message) {
@ -551,7 +526,7 @@ var webSocketOnAlertMessage = function processMessage(message) {
var webSocketOnAlertClose = function (e) { var webSocketOnAlertClose = function (e) {
if (onAlertWebsocket.get_opened()) { if (onAlertWebsocket.get_opened()) {
noty({text: 'Connection lost with Alert Stream !!', type: 'error'}); $('#ws-alert-stream').removeClass('text-muted text-danger text-success').addClass('text-danger');
} }
waitForSocketConnection(onAlertWebsocket, initializeOnAlertWebSocket); waitForSocketConnection(onAlertWebsocket, initializeOnAlertWebSocket);
}; };
@ -561,18 +536,15 @@ var webSocketOnAlertError = function (e) {
noty({text: 'Something went wrong when trying to connect to <b>' + alertWebSocketURL + '<b/>', type: 'error'}); noty({text: 'Something went wrong when trying to connect to <b>' + alertWebSocketURL + '<b/>', type: 'error'});
}; };
var initLoading = true; var webSocketSpatialOnOpen = function () {
var webSocketOnOpen = function () { spatialWebsocket.set_opened();
websocket.set_opened();
if (initLoading) { if (initLoading) {
initialLoad();
InitSpatialObject();
initLoading = false; initLoading = false;
} }
noty({text: 'You Are Connected to Spatial Stream !!', type: 'success'}); $('#ws-spatial-stream').removeClass('text-muted text-danger text-success').addClass('text-success');
}; };
var webSocketOnMessage = function (message) { var webSocketSpatialOnMessage = function (message) {
if (!isBatchModeOn) { if (!isBatchModeOn) {
var json = $.parseJSON(message.data); var json = $.parseJSON(message.data);
if (json.messageType == "Point") { if (json.messageType == "Point") {
@ -585,15 +557,15 @@ var webSocketOnMessage = function (message) {
} }
}; };
var webSocketOnClose = function (e) { var webSocketSpatialOnClose = function (e) {
if (websocket.get_opened()) { if (spatialWebsocket.get_opened()) {
noty({text: 'Connection lost with server!!', type: 'error'}); $('#ws-spatial-stream').removeClass('text-muted text-danger text-success').addClass('text-danger');
} }
waitForSocketConnection(websocket, initializeWebSocket); waitForSocketConnection(spatialWebsocket, initializeSpatialStreamWebSocket);
}; };
var webSocketOnError = function (err) { var webSocketSpatialOnError = function (err) {
if (!websocket.get_opened()) return; if (!spatialWebsocket.get_opened()) return;
noty({text: 'Something went wrong when trying to connect to <b>' + webSocketURL + '<b/>', type: 'error'}); noty({text: 'Something went wrong when trying to connect to <b>' + webSocketURL + '<b/>', type: 'error'});
}; };
@ -622,13 +594,13 @@ function waitForSocketConnection(socket, callback) {
} }
function initializeWebSocket() { function initializeSpatialStreamWebSocket() {
if(websocket) websocket.close(); if(spatialWebsocket) spatialWebsocket.close();
websocket = new WebSocket(webSocketURL); spatialWebsocket = new WebSocket(webSocketURL);
websocket.onopen = webSocketOnOpen; spatialWebsocket.onopen = webSocketSpatialOnOpen;
websocket.onmessage = webSocketOnMessage; spatialWebsocket.onmessage = webSocketSpatialOnMessage;
websocket.onclose = webSocketOnClose; spatialWebsocket.onclose = webSocketSpatialOnClose;
websocket.onerror = webSocketOnError; spatialWebsocket.onerror = webSocketSpatialOnError;
} }
function initializeOnAlertWebSocket() { function initializeOnAlertWebSocket() {
@ -640,7 +612,7 @@ function initializeOnAlertWebSocket() {
onAlertWebsocket.onopen = webSocketOnAlertOpen; onAlertWebsocket.onopen = webSocketOnAlertOpen;
} }
function initializeGeoLocation() { function initializeGeoLocation(geoFencingEnabled) {
var deviceDetails = $(".device-id"); var deviceDetails = $(".device-id");
deviceId = deviceDetails.data("deviceid"); deviceId = deviceDetails.data("deviceid");
deviceType = deviceDetails.data("type"); deviceType = deviceDetails.data("type");
@ -657,11 +629,17 @@ function initializeGeoLocation() {
alertWebSocketURL = wsEndPoint + userDomain + "/org.wso2.geo.AlertsNotifications/1.0.0?" alertWebSocketURL = wsEndPoint + userDomain + "/org.wso2.geo.AlertsNotifications/1.0.0?"
+ "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken; + "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken;
$("#proximity_alert").hide(); $("#proximity_alert").hide();
initializeWebSocket();
initializeOnAlertWebSocket(); initialLoad();
window.onbeforeunload = function () { InitSpatialObject(geoFencingEnabled);
websocket.close();
onAlertWebsocket.close(); if (geoFencingEnabled) {
initializeSpatialStreamWebSocket();
initializeOnAlertWebSocket();
window.onbeforeunload = function () {
spatialWebsocket.close();
onAlertWebsocket.close();
}
} }
} else { } else {
noty({text: 'Invalid Access! No device information provided to track!', type: 'error'}); noty({text: 'Invalid Access! No device information provided to track!', type: 'error'});

@ -1,7 +1,7 @@
{{#zone "content"}} {{#zone "content"}}
{{#if isAuthorized}} {{#if isAuthorized}}
<span id="logged-in-user" class="hidden" data-username="{{@user.username}}" data-domain="{{@user.domain}}" <span id="logged-in-user" class="hidden" data-username="{{@user.username}}" data-domain="{{@user.domain}}"
data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}"></span> data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}" data-isDeviceOwnerEnabled="{{isDeviceOwnerEnabled}}"></span>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

@ -88,13 +88,15 @@ function onRequest(context) {
} }
} }
var roles = userModule.getRoles(); var roles = userModule.getRoles();
if (roles["status"] == "success") { if (roles["status"] == "success") {
types["roles"] = roles["content"]; types["roles"] = roles["content"];
} }
types["groups"] = groupModule.getGroups(); types["groups"] = groupModule.getGroups();
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
types["isCloud"] = devicemgtProps.isCloud; types["isCloud"] = devicemgtProps.isCloud;
types["isDeviceOwnerEnabled"] = devicemgtProps.isDeviceOwnerEnabled;
return types; return types;
} }

@ -66,7 +66,7 @@ var disableInlineError = function (inputField, errorMsg, errorSign) {
*/ */
function loadGroups(callback) { function loadGroups(callback) {
invokerUtil.get( invokerUtil.get(
"/api/device-mgt/v1.0/groups", "/api/device-mgt/v1.0/admin/groups",
function (data) { function (data) {
data = JSON.parse(data); data = JSON.parse(data);
callback(data.deviceGroups); callback(data.deviceGroups);
@ -146,7 +146,7 @@ stepForwardFrom["policy-platform"] = function (actionButton) {
if (policyOperationsTemplateSrc) { if (policyOperationsTemplateSrc) {
$.template(policyOperationsTemplateCacheKey, context + policyOperationsTemplateSrc, function (template) { $.template(policyOperationsTemplateCacheKey, context + policyOperationsTemplateSrc, function (template) {
var content = template({"iscloud" : $("#logged-in-user").data("iscloud")}); var content = template({"iscloud" : $("#logged-in-user").data("iscloud"), "isDeviceOwnerEnabled" : $("#logged-in-user").data("isdeviceownerenabled")});
$("#device-type-policy-operations").html(content).removeClass("hidden"); $("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden"); $(".policy-platform").addClass("hidden");
}); });

@ -0,0 +1,24 @@
/*
* Copyright (c) 2017, 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.
*/
$(document).ready(function(){
var expireModal = $('#expire-modal-content');
modalDialog.content(expireModal.find('.modal-body'));
modalDialog.header(expireModal.find('.modal-header .modal-title'));
modalDialog.footer(expireModal.find('.modal-footer'));
modalDialog.show();
});

@ -15,6 +15,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{unit "cdmf.unit.ui.modal"}}
<ul class="nav navbar-right float-remove-xs text-center-xs"> <ul class="nav navbar-right float-remove-xs text-center-xs">
{{#each Main}} {{#each Main}}
<li class="visible-inline-block"> <li class="visible-inline-block">
@ -26,23 +27,35 @@
{{#if this.isDomain }} {{#if this.isDomain }}
{{@user.domain}} {{@user.domain}}
{{else}} {{else}}
{{@key}} {{#if this.label}}
{{this.label}}
{{else}}
{{@key}}
{{/if}}
{{/if}} {{/if}}
"> ">
<span class="icon fw-stack fw-lg" {{#if this.isSupport}} style="color: #ff8c27;" {{/if}}> <span class="icon fw-stack fw-lg" {{#if this.isSupport}} style="color: #ff8c27;" {{/if}} {{#if this.color}} style="color: {{this.color}};" {{/if}}>
<i class="{{this.icon}} fw-stack-1x" title=" <i class="{{this.icon}} fw-stack-1x" title="
{{#if this.isDomain }} {{#if this.isDomain }}
{{@user.domain}} {{@user.domain}}
{{else}} {{else}}
{{@key}} {{#if this.label}}
{{this.label}}
{{else}}
{{@key}}
{{/if}}
{{/if}} {{/if}}
"></i> "></i>
</span> </span>
<span class="hidden-xs {{#if this.isDomain }} username {{/if}}"> <span class="hidden-xs {{#if this.isDomain }} username {{/if}}" {{#if this.color}} style="color: {{this.color}};" {{/if}}>
{{#if this.isDomain }} {{#if this.isDomain }}
{{@user.domain}} {{@user.domain}}
{{else}} {{else}}
{{@key}} {{#if this.label}}
{{this.label}}
{{else}}
{{@key}}
{{/if}}
{{/if}} {{/if}}
</span> </span>
{{#if this.dropDownVisible}} {{#if this.dropDownVisible}}
@ -136,6 +149,42 @@
</div> </div>
</div> </div>
{{#if Main.Account.isExpired}}
<div id="expire-modal-content" class="hide">
<div class="modal-header">
<h3 class="pull-left modal-title">
<span>
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-alert fw-stack-1x"></i>
</span> Trial Expired
</span>
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i
class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div id="user-groups">Was it a successful trial? Your trial unfortunately expired, however it is really easy to upgrade to a paid plan and keep using WSO2 Device Cloud</div>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="{{Main.Account.dropDown.[Upgrade Now].url}}" id="expire-upgrade-now-link" class="btn-operations">
Upgrade Now
</a>
<a href="{{Main.Account.dropDown.[Request Extension].url}}" id="expire-req-ext-link" class="btn-operations">
Request Exception
</a>
</div>
</div>
</div>
{{/if}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
{{#if Main.Account.isExpired}}
{{js "/js/monetize.js"}}
{{/if}}
{{js "/js/user-menu.js"}} {{js "/js/user-menu.js"}}
{{/zone}} {{/zone}}

@ -20,6 +20,10 @@ function onRequest(context) {
var constants = require("/app/modules/constants.js"); var constants = require("/app/modules/constants.js");
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
var cloudProps = require("/app/modules/conf-reader/cloud.js")["conf"]; var cloudProps = require("/app/modules/conf-reader/cloud.js")["conf"];
var log = new Log("user-menu.js");
var sqlDateFormatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
var user = context.user; var user = context.user;
var isSuperTenant = false; var isSuperTenant = false;
if (user.tenantId == -1234) { if (user.tenantId == -1234) {
@ -32,6 +36,79 @@ function onRequest(context) {
viewModal.Main.Domain.isDomain = true; viewModal.Main.Domain.isDomain = true;
viewModal.Main.Support.isSupport = true; viewModal.Main.Support.isSupport = true;
//get billing info
var type = {PAID: "PAID", TRIAL: "TRIAL", FREE: "FREE"};
var status = {
ACTIVE: "ACTIVE",
INACTIVE: "INACTIVE",
EXTENDED: "EXTENDED",
PENDING_DISABLED: "PENDING_DISABLED",
DISABLED: "DISABLED"
};
var BILLING_INFO_KEY = 'BILLING_INFO_' + context.user.domain;
var BILLING_INFO_RETRY_COUNT_KEY = 'BILLING_INFO_RETRY_COUNT_' + context.user.domain;
if (viewModal.Main.Account.billingEnabled) {
if (!session.get(BILLING_INFO_KEY) || daysAfterLastCheck(session.get(BILLING_INFO_KEY).lastChecked) > 1) {
session.put(BILLING_INFO_RETRY_COUNT_KEY, 0);
getBillingData(getLoginCookie());
}
var billingInfo = session.get(BILLING_INFO_KEY);
var isExpired = false;
var isTrial = false;
var trialPeriod = 14;
var cloudMgtIndexPage = viewModal.Main.Account.cloudMgtIndexPage;
if (!billingInfo) {
log.info("Access denied for tenant: " + context.user.domain
+ " with a NULL subscription. Redirected to CloudMgt");
response.sendRedirect(cloudMgtIndexPage);
exit(0);
} else if (billingInfo.isPaidAccount && (billingInfo.billingPlanStatus === status.ACTIVE
|| billingInfo.billingPlanStatus === status.PENDING_DISABLED)) {
isExpired = false;
//change menu item name
delete viewModal.Main.Account.color;
delete viewModal.Main.Account["Request Extension"];
} else if (!billingInfo.isPaidAccount) {
var accountContent = "Account";
if (billingInfo.billingPlanStatus === status.ACTIVE || billingInfo.billingPlanStatus === status.EXTENDED) {
var currDate = new java.util.Date();
var endDate = sqlDateFormatter.parse(billingInfo.endDate);
var diff = endDate.getTime() - currDate.getTime();
isTrial = true;
if (diff > 0) {
noOfDays = java.util.concurrent.TimeUnit.MILLISECONDS.toDays(diff);
accountContent = "Trial - " + (noOfDays + 1) + " days to upgrade";
} else {
isExpired = true;
accountContent = "Trial Expired";
}
} else if (billingInfo.billingPlanStatus === status.INACTIVE) {
isExpired = false;
isTrial = true;
accountContent = "Trial " + (trialPeriod) + " days tade";
}
//change menu item name
viewModal.Main.Account.label = accountContent;
viewModal.Main.Account.isDomain = false;
viewModal.Main.Account.color = "red";
viewModal.Main.Account.isExpired = isExpired;
} else if (billingInfo.billingPlanStatus === status.DISABLED) {
log.info(
"Access denied for tenant: " + context.user.domain
+ " with a DISABLED subscription. Redirected to CloudMgt");
response.sendRedirect(cloudMgtIndexPage);
exit(0);
}
} else {
// delete viewModal.Main.Account;
viewModal.Main.Account = {"billingEnabled": false}
}
for (var key in viewModal.Main) { for (var key in viewModal.Main) {
var tempDropDownCheck = false; var tempDropDownCheck = false;
@ -80,4 +157,63 @@ function onRequest(context) {
viewModal.USER_SESSION_KEY = session.get(constants["USER_SESSION_KEY"]); viewModal.USER_SESSION_KEY = session.get(constants["USER_SESSION_KEY"]);
viewModal.isCloud = mdmProps.isCloud; viewModal.isCloud = mdmProps.isCloud;
return viewModal; return viewModal;
function getBillingData(cookie, attempt) {
serviceUrl = "https://cloudmgt.cloudstaging.wso2.com/cloudmgt/site/blocks/admin/admin.jag";
result = post(serviceUrl,
'action=getBillingStatusOfTenant&tenantDomain=' + context.user.domain + '&cloudType=device_cloud',
{"Cookie": cookie});
if (result.data) {
var billing = JSON.parse(result.data).data;
if (!billing.isPaidAccount && billing.billingPlanStatus === status.INACTIVE) {
var rv = post(serviceUrl,
'action=informFirstLogin&tenantDomain=' + context.user.domain + '&cloudType=device_cloud',
{"Cookie": cookie});
if (!attempt) attempt = 1;
var failStr = "First login capturing failed";
var successStr = "First login captured successfully";
if (rv.data.substring(0, failStr.length) === failStr && attempt < 3) {
getBillingData(cookie, ++attempt); //retry
} else if(rv.data.substring(0, successStr.length) === successStr) {
getBillingData(cookie); //get expiry details
}
} else {
session.put(BILLING_INFO_KEY, JSON.parse(result.data).data);
session.put(BILLING_INFO_RETRY_COUNT_KEY, 0);
}
}
}
function getLoginCookie(){
var retryCount = session.get(BILLING_INFO_RETRY_COUNT_KEY) || 0;
if (retryCount <= 3) {
retryCount++;
session.put(BILLING_INFO_RETRY_COUNT_KEY, retryCount);
var username = viewModal.Main.Account.billingApi.username;
var password = viewModal.Main.Account.billingApi.password;
var serviceUrl = "https://cloudmgt.cloudstaging.wso2.com/cloudmgt/site/blocks/user/authenticate/ajax/login.jag";
var result = post(serviceUrl, 'action=login&userName=' + username + '&password=' + password,
{"Content-Type": "application/x-www-form-urlencoded"});
if (result.data && result.data.trim() === "true") {
var cookieHeader = result.xhr.getResponseHeader("Set-Cookie");
if (cookieHeader) {
var cookie = cookieHeader.split(";")[0];
return cookie;
}
}
} else {
log.error("Billing info api failed after " + session.get(BILLING_INFO_RETRY_COUNT_KEY) + " attempts!");
}
}
function daysAfterLastCheck(checkedDate){
if(!checkedDate) return 0;
var currDate = new java.util.Date();
var endDate = sqlDateFormatter.parse(checkedDate);
var diff = endDate.getTime() - currDate.getTime();
if (diff > 0) {
return java.util.concurrent.TimeUnit.MILLISECONDS.toDays(diff);
}
return 0;
}
} }

@ -2844,6 +2844,31 @@ a.ast-type-item:hover {
} }
/* operations panel/board */ /* operations panel/board */
.operation-tile{
width: 88px;
height: 100px;
background-color: #ebebeb;
float: left;
margin: 0px 10px 10px 0px;
cursor: pointer;
position: relative;
}
.operation-tile i{
padding: 15px 0px 0px 0px;
display: block;
min-height: 65px;
margin: -5px !important;
font-size: 36px !important;
}
.operation-tile span{
height: 35px;
line-height: 15px;
vertical-align: middle;
display: table-cell !important;
width: inherit;
}
.wr-operations-board { .wr-operations-board {
background: #fafafa; background: #fafafa;
margin-bottom: 10px; margin-bottom: 10px;
@ -6863,6 +6888,12 @@ select > option:hover {
/*background:url('http://cdn-sg1.pgimgs.com/images/pg/close-button.png') no-repeat center center;*/ /*background:url('http://cdn-sg1.pgimgs.com/images/pg/close-button.png') no-repeat center center;*/
} }
.device-owner-operations {
pointer-events: none;
opacity: 0.5;
background: #b6b4bb;
}
.label-bold { .label-bold {
font-weight: 400; font-weight: 400;
} }
@ -6973,3 +7004,4 @@ header.header-default {
.header .fw-user{ .header .fw-user{
color: #333 !important; color: #333 !important;
} }

@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender</artifactId> <artifactId>email-sender</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId> <artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - OAuth Extensions</name> <name>WSO2 Carbon - OAuth Extensions</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

@ -3,14 +3,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.policy.decision.point</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.information.point</artifactId> <artifactId>org.wso2.carbon.policy.information.point</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Information Point</name> <name>WSO2 Carbon - Policy Information Point</name>
<description>WSO2 Carbon - Policy Information Point</description> <description>WSO2 Carbon - Policy Information Point</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId> <artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Common</name> <name>WSO2 Carbon - Policy Management Common</name>
<description>WSO2 Carbon - Policy Management Common</description> <description>WSO2 Carbon - Policy Management Common</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId> <artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Core</name> <name>WSO2 Carbon - Policy Management Core</name>
<description>WSO2 Carbon - Policy Management Core</description> <description>WSO2 Carbon - Policy Management Core</description>

@ -23,13 +23,18 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.common.policy.mgt.DeviceGroupWrapper; import org.wso2.carbon.device.mgt.common.policy.mgt.DeviceGroupWrapper;
import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; import org.wso2.carbon.device.mgt.common.policy.mgt.Policy;
import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyCriterion; import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyCriterion;
import org.wso2.carbon.device.mgt.common.policy.mgt.Profile; import org.wso2.carbon.device.mgt.common.policy.mgt.Profile;
import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature;
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMgtConstants;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
@ -37,6 +42,10 @@ import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderServiceImp
import org.wso2.carbon.policy.mgt.common.*; import org.wso2.carbon.policy.mgt.common.*;
import org.wso2.carbon.policy.mgt.core.cache.impl.PolicyCacheManagerImpl; import org.wso2.carbon.policy.mgt.core.cache.impl.PolicyCacheManagerImpl;
import org.wso2.carbon.policy.mgt.core.dao.*; import org.wso2.carbon.policy.mgt.core.dao.*;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyDelegationException;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegator;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegatorImpl;
import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder;
import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager; import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
import org.wso2.carbon.policy.mgt.core.mgt.ProfileManager; import org.wso2.carbon.policy.mgt.core.mgt.ProfileManager;
import org.wso2.carbon.policy.mgt.core.mgt.bean.UpdatedPolicyDeviceListBean; import org.wso2.carbon.policy.mgt.core.mgt.bean.UpdatedPolicyDeviceListBean;
@ -317,6 +326,22 @@ public class PolicyManagerImpl implements PolicyManager {
@Override @Override
public boolean deletePolicy(int policyId) throws PolicyManagementException { public boolean deletePolicy(int policyId) throws PolicyManagementException {
boolean bool; boolean bool;
List<Policy> policies = this.getPolicies();
Policy pol = null;
for (Policy p : policies) {
if (policyId == p.getId()) {
pol = p;
}
}
String deviceType = pol.getProfile().getDeviceType();
List<Policy> deviceTypePolicyList = this.getPoliciesOfDeviceType(deviceType);
if (deviceTypePolicyList.size() == 1) {
List<Device> devices = this.getPolicyAppliedDevicesIds(policyId);
List<DeviceIdentifier> deviceIdentifiers = this.convertDevices(devices);
this.addPolicyRevokeOperation(deviceIdentifiers);
}
try { try {
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
@ -836,6 +861,7 @@ public class PolicyManagerImpl implements PolicyManager {
List<String> changedDeviceTypes = new ArrayList<>(); List<String> changedDeviceTypes = new ArrayList<>();
List<Policy> updatedPolicies = new ArrayList<>(); List<Policy> updatedPolicies = new ArrayList<>();
List<Integer> updatedPolicyIds = new ArrayList<>(); List<Integer> updatedPolicyIds = new ArrayList<>();
boolean transactionDone = false;
try { try {
//HashMap<Integer, Integer> map = policyDAO.getUpdatedPolicyIdandDeviceTypeId(); //HashMap<Integer, Integer> map = policyDAO.getUpdatedPolicyIdandDeviceTypeId();
// List<Policy> activePolicies = new ArrayList<>(); // List<Policy> activePolicies = new ArrayList<>();
@ -859,6 +885,7 @@ public class PolicyManagerImpl implements PolicyManager {
// } // }
} }
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
transactionDone = true;
policyDAO.markPoliciesAsUpdated(updatedPolicyIds); policyDAO.markPoliciesAsUpdated(updatedPolicyIds);
policyDAO.removeRecordsAboutUpdatedPolicies(); policyDAO.removeRecordsAboutUpdatedPolicies();
PolicyManagementDAOFactory.commitTransaction(); PolicyManagementDAOFactory.commitTransaction();
@ -866,7 +893,9 @@ public class PolicyManagerImpl implements PolicyManager {
PolicyManagementDAOFactory.rollbackTransaction(); PolicyManagementDAOFactory.rollbackTransaction();
throw new PolicyManagementException("Error occurred while applying the changes to policy operations.", e); throw new PolicyManagementException("Error occurred while applying the changes to policy operations.", e);
} finally { } finally {
PolicyManagementDAOFactory.closeConnection(); if(transactionDone) {
PolicyManagementDAOFactory.closeConnection();
}
} }
return new UpdatedPolicyDeviceListBean(updatedPolicies, updatedPolicyIds, changedDeviceTypes); return new UpdatedPolicyDeviceListBean(updatedPolicies, updatedPolicyIds, changedDeviceTypes);
} }
@ -1045,4 +1074,44 @@ public class PolicyManagerImpl implements PolicyManager {
return groupWrappers; return groupWrappers;
} }
private List<DeviceIdentifier> convertDevices(List<Device> devices) {
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
for (Device device : devices) {
DeviceIdentifier identifier = new DeviceIdentifier();
identifier.setId(device.getDeviceIdentifier());
identifier.setType(device.getType());
deviceIdentifiers.add(identifier);
}
return deviceIdentifiers;
}
private void addPolicyRevokeOperation(List<DeviceIdentifier> deviceIdentifiers) throws PolicyManagementException {
try {
String type = null;
if (deviceIdentifiers.size() > 0) {
type = deviceIdentifiers.get(0).getType();
}
PolicyManagementDataHolder.getInstance().getDeviceManagementService().addOperation(type,
this.getPolicyRevokeOperation(), deviceIdentifiers);
} catch (InvalidDeviceException e) {
String msg = "Invalid DeviceIdentifiers found.";
log.error(msg, e);
throw new PolicyManagementException(msg, e);
} catch (OperationManagementException e) {
String msg = "Error occurred while adding the operation to device.";
log.error(msg, e);
throw new PolicyManagementException(msg, e);
}
}
private Operation getPolicyRevokeOperation() {
CommandOperation policyRevokeOperation = new CommandOperation();
policyRevokeOperation.setEnabled(true);
policyRevokeOperation.setCode(OperationMgtConstants.OperationCodes.POLICY_REVOKE);
policyRevokeOperation.setType(Operation.Type.COMMAND);
return policyRevokeOperation;
}
} }

@ -23,13 +23,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Policy Management Component</name> <name>WSO2 Carbon - Policy Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId> <artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name> <name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name>
<description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description> <description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Webapp Authenticator Framework</name> <name>WSO2 Carbon - Webapp Authenticator Framework</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Application Extension Feature</name> <name>WSO2 Carbon - API Management Application Extension Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a api application registration, which takes care of subscription <description>This feature contains an implementation of a api application registration, which takes care of subscription

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management - APIM handler Server Feature</name> <name>WSO2 Carbon - Device Management - APIM handler Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the handler for the api authentications <description>This feature contains the handler for the api authentications

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - APIM Integration Client Feature</name> <name>WSO2 Carbon - APIM Integration Client Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Webapp Publisher Feature</name> <name>WSO2 Carbon - API Management Webapp Publisher Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing <description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Feature</name> <name>WSO2 Carbon - API Management Extensions Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - Certificate Management Server Feature</name> <name>WSO2 Carbon - Certificate Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the core bundles required for back-end Certificate Management functionality <description>This feature contains the core bundles required for back-end Certificate Management functionality

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Feature</name> <name>WSO2 Carbon - Certificate Management Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - Device Type Deployer Feature</name> <name>WSO2 Carbon - Device Type Deployer Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - Device Type Deployer Feature</description> <description>WSO2 Carbon - Device Type Deployer Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name> <name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name> <name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name> <name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - XMPP Based Push Notification Provider Feature</name> <name>WSO2 Carbon - XMPP Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - XMPP Based Push Notification Provider Feature</description> <description>WSO2 Carbon - XMPP Based Push Notification Provider Feature</description>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -3,13 +3,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.dashboard.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.analytics.dashboard.feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Dashboard Analytics Feature</name> <name>WSO2 Carbon - Device Management Dashboard Analytics Feature</name>
<description>WSO2 Carbon - Device Management Dashboard Analytics Feature</description> <description>WSO2 Carbon - Device Management Dashboard Analytics Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name> <name>WSO2 Carbon - Device Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains bundles related to device analytics data publisher</description> <description>This feature contains bundles related to device analytics data publisher</description>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -4,14 +4,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Extensions Feature</name> <name>WSO2 Carbon - Device Management Extensions Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains common extensions used by key device management functionalities <description>This feature contains common extensions used by key device management functionalities

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>3.0.20-SNAPSHOT</version> <version>3.0.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save