revert-70aa11f8
Pasindu 7 years ago
commit 922f8f3cc5

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

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

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

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

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

@ -22,11 +22,16 @@ import feign.RequestInterceptor;
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import java.util.HashMap;
import java.util.Map;
public class IntegrationClientServiceImpl implements IntegrationClientService {
private static StoreClient storeClient;
private static PublisherClient publisherClient;
private static Map<String, AccessTokenInfo> tenantUserTokenMap = new HashMap<>();
public IntegrationClientServiceImpl() {
RequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor();
@ -42,4 +47,8 @@ public class IntegrationClientServiceImpl implements IntegrationClientService {
public PublisherClient getPublisherClient() {
return publisherClient;
}
public static Map<String, AccessTokenInfo> getTenantUserTokenMap() {
return tenantUserTokenMap;
}
}

@ -55,7 +55,6 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
private static final long DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS = 100000;
private DCRClient dcrClient;
private static OAuthApplication oAuthApplication;
private static Map<String, AccessTokenInfo> tenantUserTokenMap = new HashMap<>();
private static final Log log = LogFactory.getLog(OAuthRequestInterceptor.class);
/**
@ -89,7 +88,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
username = username + "@" + tenantDomain;
}
AccessTokenInfo tenantBasedAccessTokenInfo = tenantUserTokenMap.get(username);
AccessTokenInfo tenantBasedAccessTokenInfo = IntegrationClientServiceImpl.getTenantUserTokenMap().get(username);
if ((tenantBasedAccessTokenInfo == null ||
((System.currentTimeMillis() + DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS) >
tenantBasedAccessTokenInfo.getExpiresIn()))) {
@ -106,7 +105,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
if (tenantBasedAccessTokenInfo.getScopes().contains(APIM_SUBSCRIBE_SCOPE)) {
tenantUserTokenMap.put(username, tenantBasedAccessTokenInfo);
IntegrationClientServiceImpl.getTenantUserTokenMap().put(username, tenantBasedAccessTokenInfo);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.74-SNAPSHOT</version>
<version>3.0.89-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -362,6 +362,11 @@
<artifactId>org.wso2.carbon.event.stream.persistence.stub</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

@ -24,7 +24,6 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.Feature;
@ -66,7 +65,6 @@ import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import javax.security.auth.login.Configuration;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import javax.ws.rs.Consumes;
@ -92,8 +90,8 @@ import java.util.List;
@Consumes(MediaType.APPLICATION_JSON)
public class DeviceManagementServiceImpl implements DeviceManagementService {
private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class);
public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class);
@GET
@Path("/{type}/{id}/status")
@ -499,15 +497,13 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@QueryParam("offset") int offset,
@QueryParam("limit") int limit) {
List<Application> applications;
//ApplicationList appList;
ApplicationManagementProviderService amc;
try {
RequestValidationUtil.validateDeviceIdentifier(type, id);
amc = DeviceMgtAPIUtils.getAppManagementService();
applications = amc.getApplicationListForDevice(new DeviceIdentifier(id, type));
//TODO: return app list
return Response.status(Response.Status.OK).entity(applications).build();
} catch (ApplicationManagementException e) {
String msg = "Error occurred while fetching the apps of the '" + type + "' device, which carries " +
"the id '" + id + "'";
@ -515,7 +511,6 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
}
return Response.status(Response.Status.OK).entity(applications).build();
}
@GET

@ -20,7 +20,10 @@ package org.wso2.carbon.device.mgt.jaxrs.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.integration.client.IntegrationClientServiceImpl;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper;
import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper;
@ -63,6 +66,9 @@ public class CredentialManagementResponseBuilder {
username = CarbonContext.getThreadLocalCarbonContext().getUsername();
userStoreManager.updateCredential(username, credentials.getNewPassword(),
credentials.getOldPassword());
IntegrationClientServiceImpl integrationClientService = (IntegrationClientServiceImpl) PrivilegedCarbonContext.
getThreadLocalCarbonContext().getOSGiService(IntegrationClientService.class, null);
integrationClientService.getTenantUserTokenMap().remove(username);
return Response.status(Response.Status.OK).entity("UserImpl password by username: " +
username + " was successfully changed.").build();
} catch (UserStoreException e) {

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

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

@ -198,17 +198,17 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
public void updateApplicationListInstalledInDevice(
DeviceIdentifier deviceIdentifier,
List<Application> applications) throws ApplicationManagementException {
if (log.isDebugEnabled()) {
log.debug("Updating application list for device: " + deviceIdentifier.toString());
}
List<Application> installedAppList = getApplicationListForDevice(deviceIdentifier);
try {
Device device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier,
false);
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
if (log.isDebugEnabled()) {
log.debug("Device:" + device.getId() + ":identifier:" + deviceIdentifier.getId());
}
if (log.isDebugEnabled()) {
log.debug("num of apps installed:" + installedAppList.size());
log.debug("Number of apps installed:" + installedAppList.size());
}
List<Application> appsToAdd = new ArrayList<>();
List<Integer> appIdsToRemove = new ArrayList<>(installedAppList.size());
@ -227,10 +227,11 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
List<Integer> applicationIds = new ArrayList<>();
for (Application application : applications) {
/*
Truncating the application version if length of the version is greater than maximum allowed length.
*/
if (application.getVersion().length() >
// Adding N/A if application doesn't have a version. Also truncating the application version,
// if length of the version is greater than maximum allowed length.
if (application.getVersion() == null) {
application.setVersion("N/A");
} else if (application.getVersion().length() >
DeviceManagementConstants.OperationAttributes.APPLIST_VERSION_MAX_LENGTH) {
application.setVersion(StringUtils.abbreviate(application.getVersion(),
DeviceManagementConstants.OperationAttributes.APPLIST_VERSION_MAX_LENGTH));
@ -258,24 +259,34 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
if (log.isDebugEnabled()) {
log.debug("num of remove app Ids:" + appIdsToRemove.size());
}
DeviceManagementDAOFactory.commitTransaction();
} catch (DeviceManagementDAOException e) {
DeviceManagementDAOFactory.rollbackTransaction();
throw new ApplicationManagementException("Error occurred saving application list to the device", e);
String msg = "Error occurred saving application list of the device " + deviceIdentifier.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new ApplicationManagementException("Error occurred while initializing transaction", e);
String msg = "Error occurred while initializing transaction for saving application list to the device "
+ deviceIdentifier.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (DeviceManagementException e) {
throw new ApplicationManagementException("Error occurred obtaining the device object.", e);
String msg = "Error occurred obtaining the device object for device " + deviceIdentifier.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (Exception e) {
String msg = "Exception occurred saving application list of the device " + deviceIdentifier.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
}
@Override
public List<Application> getApplicationListForDevice(
DeviceIdentifier deviceId) throws ApplicationManagementException {
Device device = null;
public List<Application> getApplicationListForDevice(DeviceIdentifier deviceId)
throws ApplicationManagementException {
Device device;
try {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceId,
false);
@ -286,18 +297,26 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
if (device == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() +
"' and type '" + deviceId.getType() + "'. Therefore returning null");
"' and type '" + deviceId.getType() + "'. Therefore returning empty app list");
}
return null;
return new ArrayList<>();
}
try {
DeviceManagementDAOFactory.openConnection();
return applicationDAO.getInstalledApplications(device.getId());
} catch (DeviceManagementDAOException e) {
throw new ApplicationManagementException("Error occurred while fetching the Application List of '" +
deviceId.getType() + "' device carrying the identifier'" + deviceId.getId(), e);
String msg = "Error occurred while fetching the Application List of device " + deviceId.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (SQLException e) {
throw new ApplicationManagementException("Error occurred while opening a connection to the data source", e);
String msg = "Error occurred while opening a connection to the data source to get application " +
"list of the device " + deviceId.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (Exception e) {
String msg = "Exception occurred getting application list of the device " + deviceId.toString();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}

@ -1,5 +1,5 @@
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright WSO2, Inc. (http://wso2.com)
~ Copyright WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2005-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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
<!--
~ Copyright WSO2, Inc. (http://wso2.com)
~ Copyright WSO2 Inc. (http://wso2.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

@ -1,6 +1,6 @@
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ 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

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

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

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

@ -12,6 +12,7 @@
specific language governing permissions and limitations
under the License.
-->
{{unit "cdmf.unit.ui.title" pageTitle="Advanced Search"}}
{{unit "cdmf.unit.ui.modal"}}
{{unit "cdmf.unit.data-tables-extended"}}
{{#zone "breadcrumbs"}}
@ -81,7 +82,7 @@
required.</label>
</div>
<div class="col-md-2 form-group wr-input-control col-fixed-right">
<button id="device-search-btn" class="wr-btn-search ">Search</button>
<button id="device-search-btn add-custom-param" class="wr-btn">Search</button>
</div>
</div>

@ -259,7 +259,7 @@ function loadDevices(searchType, searchParam) {
var columns = [
{
targets: 0,
data: 'name',
data: 'namePattern',
class: 'remove-padding icon-only content-fill viewEnabledIcon',
render: function (data, type, row, meta) {
return '<div class="thumbnail icon"><img class="square-element text fw " src="'
@ -471,7 +471,8 @@ function loadDevices(searchType, searchParam) {
ownership: data.devices[index].enrolmentInfo.ownership,
deviceType: data.devices[index].type,
deviceIdentifier: data.devices[index].deviceIdentifier,
name: data.devices[index].name
name: data.devices[index].name,
namePattern: data.devices[index].name
}
);
});
@ -500,12 +501,12 @@ function loadDevices(searchType, searchParam) {
if ($('.advance-search').length < 1) {
$(this).closest('.dataTables_wrapper').find('div[id$=_filter] input')
.after('<a href="' + context + '/devices/search"' +
' class="advance-search add-padding-3x">Advance Search</a>');
' class="advance-search add-padding-3x">Advanced Search</a>');
}
}, {
"placeholder": "Search By Device Name",
"searchKey": "name"
"placeholder": "Top-Device-Name-Search",
"searchKey": "namePattern"
}
);
@ -567,6 +568,9 @@ $(document).ready(function () {
}
});
//Hide the search by device-name input
$("input[placeholder='Top-Device-Name-Search']").hide();
});
var modalPopup = ".modal";
@ -891,7 +895,7 @@ function removeDevices(deviceIdentifiers) {
var serviceURL = "/api/device-mgt/v1.0/devices/type/" + deviceIdentifiers[0].type + "/id/" + deviceIdentifiers[0].id;
invokerUtil.delete(serviceURL, function (message) {
if (deviceIdentifiers.length > 1) {
deviceIdentifiers.slice(1, deviceIdentifiers.length);
deviceIdentifiers.shift();
removeDevices(deviceIdentifiers);
} else {
$(modalPopupContent).html($('#remove-device-200-content').html());

@ -73,18 +73,7 @@
<div class="wr-form">
<p class="page-sub-title">Group was created successfully.</p>
<br>Please click <b>"Add Another Group"</b>, if you wish to add another group or click
<b>"View Group List"</b> to complete the process and go back to the group list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/groups'">View Group List
</button>
<a href="{{@app.context}}/group/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Group
</a>
<br>You will be redirected to the Group Listing page in a moment.
</div>
</div>

@ -47,6 +47,9 @@ $(function () {
if (resp.status == 201) {
$("#group-create-form").addClass("hidden");
$("#group-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/groups";
}, 1000);
} else {
displayErrors(resp.status);
}

@ -87,7 +87,7 @@
<h3 class="text-muted">
<i class="fw fw-group fw-3x"></i>
</h3>
<h3 class="text-muted">You don't have any device group. Let's add a new device group!</h3>
<h3 class="text-muted">You don't have any device groups. Let's add a new device group!</h3>
{{#if permissions.ADD_GROUP}}
<h3>
<!--suppress HtmlUnknownTarget -->
@ -236,7 +236,7 @@
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Do you really want to remove this group from your Group List?</h3>
<h3>Do you really want to remove this group?</h3>
<div class="buttons">
<a href="#" id="remove-group-yes-link" class="btn-operations">
@ -257,7 +257,7 @@
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Group was successfully removed.</h3>
<h3>Successfully removed the group.</h3>
</div>
</div>
</div>
@ -284,11 +284,15 @@
<h4>
Enter new name and description for the group
<br><br>
Name:
<br/>
<input type="text" id="edit-group-name"
class="form-control modal-input operationDataKeys" placeholder="Group Name"
value="">
</input>
<br>
Description:
<br/>
<input type="text" id="edit-group-description"
class="form-control modal-input operationDataKeys"
placeholder="Group Description" value="">

@ -1,3 +1,3 @@
.dataTablesTop .dataTables_toolbar ul li:nth-child(1), .dataTables_toolbar ul li:nth-child(2){
.dataTablesTop .dataTables_toolbar ul li:nth-child(1), .dataTables_toolbar ul li:nth-child(2) {
display: none;
}

@ -140,7 +140,7 @@ function loadRoles() {
}
},
{
class: "text-right content-fill text-left-on-grid-view no-wrap",
class: "text-right content-fill text-left-on-grid-view no-wrap tooltip-overflow-fix",
data: null,
render: function (data, type, row, meta) {
var isCloud = false;
@ -153,7 +153,9 @@ function loadRoles() {
var editLink = '<a onclick="javascript:loadRoleBasedActionURL(\'edit\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-role-link">' +
'data-toggle="tooltip" ' +
'data-original-title="Edit Role"' +
'class="btn padding-reduce-on-grid-view edit-role-link"> ' +
'<span class="fw-stack">' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-bookmark fw-stack-1x"></i>' +
@ -167,7 +169,9 @@ function loadRoles() {
var editPermissionLink = '<a onclick="javascript:loadRoleBasedActionURL(\'edit-permission\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
'data-click-event="edit-form" ' +
'data-click-event="edit-form " ' +
'data-toggle="tooltip" ' +
'data-original-title="Edit Permission"' +
'class="btn padding-reduce-on-grid-view edit-permission-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
@ -182,6 +186,8 @@ function loadRoles() {
var removeLink = '<a data-role="' + data.name + '" ' +
'data-click-event="remove-form" ' +
'data-toggle="tooltip" ' +
'data-original-title="Remove"' +
'class="btn padding-reduce-on-grid-view remove-role-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
@ -272,4 +278,7 @@ $("#role-grid").on("click", ".remove-role-link", function () {
$(document).ready(function () {
loadRoles();
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
});

@ -16,7 +16,7 @@
under the License.
}}
{{unit "cdmf.unit.ui.title" pageTitle="User Management | Add User"}}
{{unit "cdmf.unit.ui.modal"}}
{{#zone "breadcrumbs"}}
<li>
<a href="{{@app.context}}/">
@ -122,26 +122,14 @@
<button id="add-user-btn" class="wr-btn">Add User</button>
</div>
</div>
<div id="user-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">User was added successfully.</p>
<p>
An invitation mail will be sent to this user to initiate device enrollment.
</p>
<br>Please click <b>"Add Another User"</b>, if you wish to add another user or click
<b>"View User List"</b> to complete the process and go back to the user list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List
</button>
<a href="{{@app.context}}/user/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another User
</a>
<div id="modal-content-user-created" class="hide">
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<h4>
An invitation mail will be sent to this user to initiate device enrollment.
</h4>
</div>
<!-- /content -->
</div>

@ -226,7 +226,7 @@ $(document).ready(function () {
var firstname = firstnameInput.val();
var lastname = lastnameInput.val();
var emailAddress = $("input#emailAddress").val();
var roles ;
var roles;
if ($("#roles").length > 0) {
roles = $("select#roles").val();
}
@ -282,7 +282,13 @@ $(document).ready(function () {
}
// Refreshing with success message
$("#user-create-form").addClass("hidden");
$("#user-created-msg").removeClass("hidden");
modalDialog.header('<span class="fw-stack">' +
'<i class="fw fw-info fw-stack-1x"></i> </span> User was added successfully');
modalDialog.content($("#modal-content-user-created").html());
modalDialog.footer('<div class="buttons"> ' +
'<a href="/devicemgt/users" id="reset-password-yes-link" class="btn-operations"> OK' +
'</a></div>');
modalDialog.show();
generateQRCode("#user-created-msg .qr-code");
}

@ -123,18 +123,7 @@
<div class="wr-form">
<p class="page-sub-title">User was updated successfully.</p>
<br>Please click <b>"View Updated User"</b>, if you wish to view the updated user or click
<b>"View User List"</b> to complete the process and go back to the user list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List
</button>
<a href="{{@app.context}}/user/view?username={{editUser.username}}" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View Updated User
</a>
<br>You will be redirected to User Listing Page in a moment.
</div>
</div>
<!-- /content -->

@ -248,6 +248,10 @@ $(document).ready(function () {
// Refreshing with success message
$("#user-create-form").addClass("hidden");
$("#user-created-msg").removeClass("hidden");
setTimeout(function () {
window.location.href = "/devicemgt/users"
}, 1000);
}
}, function (jqXHR) {
var payload = JSON.parse(jqXHR.responseText);

@ -157,7 +157,7 @@ function resetPassword(username) {
domain = username.substr(0, username.indexOf('/'));
username = username.substr(username.indexOf('/') + 1);
}
var resetPasswordServiceURL = apiBasePath + "/admin/users/" + username + "/credentials";
var resetPasswordServiceURL = apiBasePath + "/admin/users/" + encodeURIComponent(username) + "/credentials";
if (domain) {
resetPasswordServiceURL += '?domain=' + encodeURIComponent(domain);
}

@ -142,6 +142,7 @@
}
.tab-actions {
margin: 0px;
margin-bottom: 10px;
}
.tab-actions .action-prop{
padding: 10px;

@ -33,7 +33,6 @@ $(document).ready(function() {
loadPolicyCompliance();
}
$("#refresh-policy").click(function() {
$('#policy-spinner').removeClass('hidden');
loadPolicyCompliance();
@ -44,6 +43,11 @@ $(document).ready(function() {
loadOperationsLog(true);
});
$("#refresh-apps").click(function() {
$('#apps-spinner').removeClass('hidden');
loadApplicationsList();
});
});
function getLogStatusIcon(entry) {
@ -159,13 +163,19 @@ function loadOperationsLog(update) {
function renderLogDetails(obj,data) {
var payload = JSON.parse(data);
var logStream = '<div class="log-data">';
var activityStatus = payload.activityStatus;
var responseMsg = null;
Object.entries(payload.activityStatus).forEach(
if (activityStatus['0'].status == "ERROR") {
responseMsg = activityStatus['0'].responses['0'].response;
}
Object.entries(activityStatus).forEach(
([key, entry]) => {
logStream += '<div class="row log-entry">' +
'<div class="col-lg-8">' +
'<div class="log-status"><i class="icon fw ' + getLogStatusIcon(entry.status) + ' "></i>' +
'<span>' + entry.status + '</span></div>' +
'<span>' + ((responseMsg == null) ? entry.status : responseMsg) + '</span></div>' +
'</div>' +
'<div class="col-lg-4">' +
'<div class="log-time text-right"><span>' + entry.updatedTimestamp + '</span></div>' +
@ -267,3 +277,47 @@ function loadPolicyCompliance() {
}
);
}
function loadApplicationsList() {
var applicationsList = $("#applications-list");
var applicationListingTemplate = applicationsList.attr("src");
var deviceId = applicationsList.data("device-id");
var deviceType = applicationsList.data("device-type");
$.template("application-list", applicationListingTemplate, function (template) {
var serviceURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/applications";
invokerUtil.get(
serviceURL,
// success-callback
function (data, textStatus, jqXHR) {
if (jqXHR.status == 200 && data) {
data = JSON.parse(data);
$("#apps-spinner").addClass("hidden");
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
data[i]["name"] = decodeURIComponent(data[i]["name"]);
data[i]["platform"] = deviceType;
}
var viewModel = {};
viewModel["applications"] = data;
viewModel["deviceType"] = deviceType;
viewModel["deviceId"] = deviceId;
viewModel["appContext"] = context;
var content = template(viewModel);
$("#applications-list-container").html(content);
var iconSource = $("#applications-list-container").data("public-uri") + "/img/android_app_icon.png";
$("#applications-list-container img").attr("src",iconSource);
} else {
$("#applications-list-container").html("<div class='message message-info'><h4><i class='icon fw fw-info'></i>No applications found.</h4>" +
"<p>Please try refreshing the list in a while.</p></div>");
}
}
},
// error-callback
function () {
$("#applications-list-container").html("<div class='panel-body'><br><p class='fw-warning'>&nbsp;Loading application list " +
"was not successful. please try refreshing the list in a while.<p></div>");
});
});
}

@ -431,3 +431,76 @@ function viewFence(geoFenceElement,id) {
}
closeAll();
}
function viewFenceByData(geoJson, queryName, areaName, stationeryTime, id) {
var matchResults = /(?:"geoFenceGeoJSON"):"{(.*)}"/g.exec(geoJson);
if (matchResults && matchResults.length > 1) {
geoJson = "{" + matchResults[1] + "}";
}
geoJson = JSON.parse(geoJson.replace(/'/g, '"'));
var geometryShape;
if(geoJson.type=="Point"){
var circleOptions = {
color: '#ff0043'
};
geometryShape= new L.circle([geoJson.coordinates[1],geoJson.coordinates[0]], geoJson.radius,circleOptions);
// var marker=new L.marker([geoJson.coordinates[1],geoJson.coordinates[0]]);
map.addLayer(geometryShape);
// map.addLayer(marker);
} else if(geoJson.type=="Polygon"){
geoJson.coordinates[0].pop(); // popout the last coordinate set(lat,lng pair) due to circular chain
var leafletLatLngs = [];
$.each(geoJson.coordinates[0], function (idx, pItem) {
leafletLatLngs.push({lat: pItem[1], lng: pItem[0]});
});
geometryShape = new L.Polygon(leafletLatLngs);
map.addLayer(geometryShape);
}
var geoPublicUri = $("#geo-charts").data("geo-public-uri");
if(id=="Stationery"){
$('#templateLoader').load(geoPublicUri + "/assets/html_templates/view_fence_popup.html #viewStationeryAlert", function () {
var popupTemplate = $('#templateLoader').find('#viewStationeryAlert');
popupTemplate.find('#exportGeoJson').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#hideViewFence').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#viewAreaTime').html(stationeryTime);
geometryShape.bindPopup(popupTemplate.html(), {closeButton: true}).openPopup();
// transparent the layer .leaflet-popup-content-wrapper
$(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)");
});
} else if(id=="WithIn"){
$('#templateLoader').load(geoPublicUri + "/assets/html_templates/view_fence_popup.html #viewWithinAlert", function () {
var popupTemplate = $('#templateLoader').find('#viewWithinAlert');
popupTemplate.find('#exportGeoJson').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#hideViewFence').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#viewAreaName').html(areaName);
popupTemplate.find('#withinAlertForm').attr('area-name', areaName);
popupTemplate.find('#withinAlertForm').attr('query-name', queryName);
geometryShape.bindPopup(popupTemplate.html(), {closeButton: true}).openPopup();
// transparent the layer .leaflet-popup-content-wrapper
$(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)");
});
} else if(id=="Exit"){
$('#templateLoader').load(geoPublicUri + "/assets/html_templates/view_fence_popup.html #viewExitAlert", function () {
var popupTemplate = $('#templateLoader').find('#viewExitAlert');
popupTemplate.find('#exportGeoJson').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#hideViewFence').attr('leaflet_id', geometryShape._leaflet_id);
popupTemplate.find('#viewAreaName').html(areaName);
popupTemplate.find('#exitAlertForm').attr('area-name', areaName);
popupTemplate.find('#exitAlertForm').attr('query-name', queryName);
geometryShape.bindPopup(popupTemplate.html(), {closeButton: true}).openPopup();
// transparent the layer .leaflet-popup-content-wrapper
$(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)");
});
} else if(id=="Traffic"){
}
closeAll();
}

@ -278,6 +278,7 @@ function setWithinAlert(leafletId) {
responseHandler, function (xhr) {
responseHandler(xhr.responseText, xhr.statusText, xhr);
});
viewFenceByData(selectedAreaGeoJson, queryName, areaName, null, 'Within');
}
}
@ -335,6 +336,7 @@ function setExitAlert(leafletId) {
responseHandler, function (xhr) {
responseHandler(xhr.responseText, xhr.statusText, xhr);
});
viewFenceByData(selectedAreaGeoJson, queryName, areaName, null, 'Exit');
}
}
@ -407,6 +409,7 @@ function setStationeryAlert(leafletId) {
responseHandler, function (xhr) {
responseHandler(xhr.responseText, xhr.statusText, xhr);
});
viewFenceByData(selectedProcessedAreaGeoJson, queryName, areaName, time, 'Stationery');
}

@ -38,23 +38,10 @@
<div class="col-centered policy-message hidden">
<div class="wr-form">
<h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy creation is
successful.</h1>
<br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click
<b>"View policy list"</b> to complete the process and go back to the policy list.
<h1 id="policy-message-page-wizard-title" class="page-sub-title">
Policy creation is successful.</h1>
<br>You will be redirected to Policy Listing Page in a moment.
<hr>
<button class="wr-btn wizard-stepper" data-current="policy-message"
data-direct="{{@app.context}}/policies/">
View policy list
</button>
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add another policy
</a>
</div>
</div>
@ -82,9 +69,7 @@
<!--suppress HtmlFormInputWithoutLabel -->
<input id="policy-name-input" class="form-control" type="text" value=""/>
<label class="error nameEmpty hidden" for="summary">Policy name is required
&
Should be be 1-to-30
characters long.</label>
and should be 1-to-30 characters long.</label>
</div>
<br class="c-both"/>
</div>

@ -428,6 +428,10 @@ var savePolicy = function (policy, isActive, serviceURL) {
$(".add-policy").addClass("hidden");
$(".policy-naming").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
},
function (data) {
}

@ -35,20 +35,8 @@
<div class="wr-form">
<h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy is successfully
re-configured.</h1>
<br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click
<b>"View policy list"</b> to complete the process and go back to the policy list.
<hr>
<button class="wr-btn wizard-stepper" data-current="policy-message"
data-direct="{{@app.context}}/policies/">
View policy list
</button>
<a href="{{@app.context}}/policies/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add another policy
</a>
<br>You will be redirected to Policy Listing page in a moment.
</div>
</div>
</div>

@ -495,6 +495,9 @@ var updatePolicy = function (policy, state) {
if (jqXHR.status == 200) {
$(".add-policy").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
}
},
// on error
@ -513,6 +516,9 @@ var updatePolicy = function (policy, state) {
$(".add-policy").addClass("hidden");
$(".policy-naming").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
}
},
// on error

@ -69,19 +69,8 @@
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Permissions were assigned to the role successfully.</p>
<br>Please click <b>"Add Another Role"</b>, if you wish to add another role or click
<b>"View Role List"</b> to complete the process and go back to the role list.
<br>You will be redirected to Roles Listing Page in a moment.
<hr />
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
View Role List
</button>
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Role
</a>
</div>
</div>
<!-- /content -->

@ -184,6 +184,9 @@ $(document).ready(function () {
// Refreshing with success message
$("#role-create-form").addClass("hidden");
$("#role-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/roles";
}, 1000);
}
}, function (data) {
var payload = JSON.parse(data.responseText);

@ -73,20 +73,7 @@
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Role was updated successfully.</p>
<br>Please click <b>"View Updated Role"</b>, if you wish to view the updated role or click
<b>"View Role List"</b> to complete the process and go back to the role list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
View Role List
</button>
<a href="{{@app.context}}/roles/edit-role/{{role.roleName}}"
class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
View Updated Role
</a>
<br>You will be redirected to Roles Listing Page in a moment.
</div>
</div>
<!-- /content -->

@ -210,6 +210,9 @@ $(document).ready(function () {
// Refreshing with success message
$("#role-create-form").addClass("hidden");
$("#role-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/roles";
}, 1000);
}
}, function (data) {

@ -86,7 +86,9 @@ $(document).ready(function () {
$("#change-password-success-link").click(function () {
hidePopup();
});
setTimeout(function(){
window.location.href = "/devicemgt/logout";
},10000);
}
}, function (jqXHR) {
if (jqXHR.status == 400) {

@ -104,7 +104,7 @@
<hr>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h5 class="text-center">
You can now try to login using your new password.
You will be logged out automatically, Please login using your new password.
</h5>
</div>
<div class="modal-footer">

@ -1443,6 +1443,8 @@ footer a, footer a:hover {
}
.message h4 .icon {
display: block;
float: left;
padding-bottom: 3px;
margin-right: 5px;
}
@ -6874,10 +6876,11 @@ select > option:hover {
}
.dynamic-search-param {
background-color: lightgrey;
background-color: #ffffff;
padding: 25px;
border: 5px solid navy;
border: 1px solid #bdbdbd;
margin: 25px;
border-radius: 10px;
}
.close-button-div {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save