Add application create fixes
6
.gitignore
vendored
@ -29,7 +29,7 @@ components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/r
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package-lock.json
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/npm-debug.log
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/dist/
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/node_modules/
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/public/dist/
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/package-lock.json
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/node_modules/
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/dist/
|
||||
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package-lock.json
|
||||
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.application.mgt.api.services;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.Extension;
|
||||
import io.swagger.annotations.ExtensionProperty;
|
||||
import io.swagger.annotations.Info;
|
||||
import io.swagger.annotations.SwaggerDefinition;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||
import org.wso2.carbon.device.application.mgt.common.ErrorResponse;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* APIs to handle application management related tasks.
|
||||
*/
|
||||
@SwaggerDefinition(
|
||||
info = @Info(
|
||||
version = "1.0.0",
|
||||
title = "ApplicationEntity Management Common Service",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = "name", value = "ApplicationManagementArtifactDownloadService"),
|
||||
@ExtensionProperty(name = "context", value = "/api/application-mgt/v1.0/artifact"),
|
||||
})
|
||||
}
|
||||
)
|
||||
)
|
||||
@Path("/artifact")
|
||||
@Api(value = "ApplicationEntity Management Artifact Downloading Service", description = "This API carries all application management artifact downloading services")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface ArtifactDownloadAPI {
|
||||
|
||||
@GET
|
||||
@Path("/download-artifact/{md5sum}/{fileName}")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_OCTET_STREAM,
|
||||
httpMethod = "GET",
|
||||
value = "get application management UI configuration",
|
||||
notes = "This will get all UI configuration of application management"
|
||||
)
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully got UI config.",
|
||||
response = ApplicationList.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. There doesn't have an defined UI config." +
|
||||
"query."),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while getting the UI config.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
Response getArtifact(
|
||||
@ApiParam(
|
||||
name = "md5sum",
|
||||
value = "md5sum of the application release installer",
|
||||
required = true)
|
||||
@PathParam("md5sum") String md5sum,
|
||||
@ApiParam(
|
||||
name = "fileName",
|
||||
value = "Name of the artifact",
|
||||
required = true)
|
||||
@PathParam("fileName") String fileName);
|
||||
|
||||
}
|
||||
@ -40,19 +40,19 @@ import javax.ws.rs.core.Response;
|
||||
@SwaggerDefinition(
|
||||
info = @Info(
|
||||
version = "1.0.0",
|
||||
title = "Application Management Common Service",
|
||||
title = "ApplicationEntity Management Common Service",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = "name", value = "ApplicationManagementCommonService"),
|
||||
@ExtensionProperty(name = "context", value = "/api/application-mgt/v1.0/app-mgt"),
|
||||
@ExtensionProperty(name = "context", value = "/api/application-mgt/v1.0/configt"),
|
||||
})
|
||||
}
|
||||
)
|
||||
)
|
||||
@Path("/app-mgt")
|
||||
@Api(value = "Application Management Common Service", description = "This API carries all application management common services")
|
||||
@Path("/config")
|
||||
@Api(value = "ApplicationEntity Management Common Service", description = "This API carries all application management common services")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface AppMgtAPI {
|
||||
public interface ConfigRetrieveAPI {
|
||||
|
||||
@GET
|
||||
@Path("/ui-config")
|
||||
@ -0,0 +1,63 @@
|
||||
/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.application.mgt.api.services.impl;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.application.mgt.api.services.ArtifactDownloadAPI;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.APIUtil;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* Implementation of ApplicationEntity Management related APIs.
|
||||
*/
|
||||
@Produces({"application/json"})
|
||||
@Path("/artifact")
|
||||
public class ArtifactDownloadAPIImpl implements ArtifactDownloadAPI {
|
||||
|
||||
private static Log log = LogFactory.getLog(ArtifactDownloadAPIImpl.class);
|
||||
|
||||
@GET
|
||||
@Override
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
@Path("/download-artifact/{md5sum}/{fileName}")
|
||||
public Response getArtifact(
|
||||
@PathParam("md5sum") String md5sum,
|
||||
@PathParam("fileName") String fileName) {
|
||||
AppmDataHandler dataHandler = APIUtil.getDataHandler();
|
||||
try {
|
||||
UIConfiguration uiConfiguration = dataHandler.getUIConfiguration();
|
||||
return Response.status(Response.Status.OK).entity(uiConfiguration).build();
|
||||
|
||||
}catch (ApplicationManagementException e) {
|
||||
String msg = "Error occurred while getting the application list for publisher ";
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,9 +19,9 @@ package org.wso2.carbon.device.application.mgt.api.services.impl;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.application.mgt.api.services.AppMgtAPI;
|
||||
import org.wso2.carbon.device.application.mgt.api.services.ConfigRetrieveAPI;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ConfigManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.APIUtil;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
|
||||
@ -32,22 +32,22 @@ import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* Implementation of Application Management related APIs.
|
||||
* Implementation of ApplicationEntity Management related APIs.
|
||||
*/
|
||||
@Produces({"application/json"})
|
||||
@Path("/app-mgt")
|
||||
public class AppMgtAPIImpl implements AppMgtAPI {
|
||||
@Path("/config")
|
||||
public class ConfigRetrieveAPIImpl implements ConfigRetrieveAPI {
|
||||
|
||||
private static Log log = LogFactory.getLog(AppMgtAPIImpl.class);
|
||||
private static Log log = LogFactory.getLog(ConfigRetrieveAPIImpl.class);
|
||||
|
||||
@GET
|
||||
@Override
|
||||
@Consumes("application/json")
|
||||
@Path("/ui-config")
|
||||
public Response getUiConfig() {
|
||||
ConfigManager configManager = APIUtil.getConfigManager();
|
||||
AppmDataHandler dataHandler = APIUtil.getDataHandler();
|
||||
try {
|
||||
UIConfiguration uiConfiguration = configManager.getUIConfiguration();
|
||||
UIConfiguration uiConfiguration = dataHandler.getUIConfiguration();
|
||||
return Response.status(Response.Status.OK).entity(uiConfiguration).build();
|
||||
|
||||
}catch (ApplicationManagementException e) {
|
||||
@ -25,7 +25,8 @@
|
||||
|
||||
<jaxrs:server id="applicationMgtCommonService" address="/">
|
||||
<jaxrs:serviceBeans>
|
||||
<ref bean="applicationMgtCommonServiceBean"/>
|
||||
<ref bean="applicationMgtConfigService"/>
|
||||
<ref bean="applicationMgtArtifactService"/>
|
||||
<ref bean="swaggerResource"/>
|
||||
</jaxrs:serviceBeans>
|
||||
<jaxrs:providers>
|
||||
@ -52,7 +53,8 @@
|
||||
<bean id="swaggerWriter" class="io.swagger.jaxrs.listing.SwaggerSerializers" />
|
||||
<bean id="swaggerResource" class="io.swagger.jaxrs.listing.ApiListingResource" />
|
||||
|
||||
<bean id="applicationMgtCommonServiceBean" class="org.wso2.carbon.device.application.mgt.api.services.impl.AppMgtAPIImpl"/>
|
||||
<bean id="applicationMgtConfigService" class="org.wso2.carbon.device.application.mgt.api.services.impl.ConfigRetrieveAPIImpl"/>
|
||||
<bean id="applicationMgtArtifactService" class="org.wso2.carbon.device.application.mgt.api.services.impl.ArtifactDownloadAPIImpl"/>
|
||||
<bean id="jsonProvider" class="org.wso2.carbon.device.application.mgt.addons.JSONMessageHandler"/>
|
||||
<bean id="multipartProvider" class="org.wso2.carbon.device.application.mgt.addons.MultipartCustomProvider"/>
|
||||
|
||||
|
||||
@ -18,11 +18,13 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
|
||||
public class AppOperation {
|
||||
|
||||
private static final long serialVersionUID = 7603215716452548282L;
|
||||
|
||||
private Application application;
|
||||
private ApplicationEntity application;
|
||||
private int tenantId;
|
||||
private String activityId;
|
||||
private String scheduledDateTime;
|
||||
@ -71,11 +73,11 @@ public class AppOperation {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Application getApplication() {
|
||||
public ApplicationEntity getApplication() {
|
||||
return application;
|
||||
}
|
||||
|
||||
public void setApplication(Application application) {
|
||||
public void setApplication(ApplicationEntity application) {
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. 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.
|
||||
*/
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
|
||||
public class ApplicationArtifact {
|
||||
|
||||
private String installerName;
|
||||
|
||||
private InputStream installerStream;
|
||||
|
||||
private String bannername;
|
||||
|
||||
private InputStream bannerStream;
|
||||
|
||||
private String iconName;
|
||||
|
||||
private InputStream iconStream;
|
||||
|
||||
private Map<String , InputStream> screenshots;
|
||||
|
||||
public String getInstallerName() {
|
||||
return installerName;
|
||||
}
|
||||
|
||||
public void setInstallerName(String installerName) {
|
||||
this.installerName = installerName;
|
||||
}
|
||||
|
||||
public InputStream getInstallerStream() {
|
||||
return installerStream;
|
||||
}
|
||||
|
||||
public void setInstallerStream(InputStream installerStream) {
|
||||
this.installerStream = installerStream;
|
||||
}
|
||||
|
||||
public String getBannername() {
|
||||
return bannername;
|
||||
}
|
||||
|
||||
public void setBannername(String bannername) {
|
||||
this.bannername = bannername;
|
||||
}
|
||||
|
||||
public InputStream getBannerStream() {
|
||||
return bannerStream;
|
||||
}
|
||||
|
||||
public void setBannerStream(InputStream bannerStream) {
|
||||
this.bannerStream = bannerStream;
|
||||
}
|
||||
|
||||
public String getIconName() {
|
||||
return iconName;
|
||||
}
|
||||
|
||||
public void setIconName(String iconName) {
|
||||
this.iconName = iconName;
|
||||
}
|
||||
|
||||
public InputStream getIconStream() {
|
||||
return iconStream;
|
||||
}
|
||||
|
||||
public void setIconStream(InputStream iconStream) {
|
||||
this.iconStream = iconStream;
|
||||
}
|
||||
|
||||
public Map<String, InputStream> getScreenshots() {
|
||||
return screenshots;
|
||||
}
|
||||
|
||||
public void setScreenshots(Map<String, InputStream> screenshots) {
|
||||
this.screenshots = screenshots;
|
||||
}
|
||||
}
|
||||
@ -18,22 +18,24 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a list of {@link Application}.
|
||||
* Represents a list of {@link ApplicationEntity}.
|
||||
*/
|
||||
public class ApplicationList {
|
||||
|
||||
private List<Application> applications;
|
||||
private List<ApplicationEntity> applications;
|
||||
|
||||
private Pagination pagination;
|
||||
|
||||
public List<Application> getApplications() {
|
||||
public List<ApplicationEntity> getApplications() {
|
||||
return applications;
|
||||
}
|
||||
|
||||
public void setApplications(List<Application> applications) {
|
||||
public void setApplications(List<ApplicationEntity> applications) {
|
||||
this.applications = applications;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. 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.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ApplicationReleaseArtifactPaths {
|
||||
|
||||
private String installerPath;
|
||||
private String iconPath;
|
||||
private String bannerPath;
|
||||
private List<String> screenshotPaths;
|
||||
|
||||
public String getInstallerPath() { return installerPath; }
|
||||
|
||||
public void setInstallerPath(String installerPath) { this.installerPath = installerPath; }
|
||||
|
||||
public String getIconPath() { return iconPath; }
|
||||
|
||||
public void setIconPath(String iconPath) { this.iconPath = iconPath; }
|
||||
|
||||
public String getBannerPath() { return bannerPath; }
|
||||
|
||||
public void setBannerPath(String bannerPath) { this.bannerPath = bannerPath; }
|
||||
|
||||
public List<String> getScreenshotPaths() { return screenshotPaths; }
|
||||
|
||||
public void setScreenshotPaths(List<String> screenshotPaths) { this.screenshotPaths = screenshotPaths; }
|
||||
}
|
||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.application.mgt.common;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This class represents the Enterprise Application information.
|
||||
* This class represents the Enterprise ApplicationEntity information.
|
||||
*/
|
||||
public class EnterpriseApplication extends AndroidApplication implements Serializable {
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ public class EnterpriseInstallationDetails {
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "applicationUUID",
|
||||
value = "Application ID",
|
||||
value = "ApplicationEntity ID",
|
||||
required = true,
|
||||
example = "4354c752-109f-11e8-b642-0ed5f89f718b"
|
||||
)
|
||||
|
||||
@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
|
||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
||||
|
||||
/**
|
||||
* Filter represents a criteria that can be used for searching applications.
|
||||
*/
|
||||
@ -68,7 +66,7 @@ public class Filter {
|
||||
/***
|
||||
* Supported device type for the application. i.e Android, iOS, Windows etc
|
||||
*/
|
||||
private DeviceType deviceType;
|
||||
private int deviceTypeId;
|
||||
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
@ -132,7 +130,7 @@ public class Filter {
|
||||
this.currentAppReleaseState = currentAppReleaseState;
|
||||
}
|
||||
|
||||
public DeviceType getDeviceType() { return deviceType; }
|
||||
public int getDeviceTypeId() { return deviceTypeId; }
|
||||
|
||||
public void setDeviceType(DeviceType deviceType) { this.deviceType = deviceType; }
|
||||
public void setDeviceTypeId(int deviceTypeId) { this.deviceTypeId = deviceTypeId; }
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
|
||||
/**
|
||||
* Represents an user of {@link Application}.
|
||||
* Represents an user.
|
||||
*/
|
||||
public class User {
|
||||
|
||||
|
||||
@ -16,17 +16,18 @@
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
package org.wso2.carbon.device.application.mgt.common.entity;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.wso2.carbon.device.application.mgt.common.User;
|
||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "Application", description = "Application represents the an Application in Application Store")
|
||||
public class Application {
|
||||
@ApiModel(value = "ApplicationEntity", description = "ApplicationEntity represents the an ApplicationEntity in ApplicationEntity Store")
|
||||
public class ApplicationEntity {
|
||||
|
||||
@ApiModelProperty(name = "id",
|
||||
value = "The ID given to the application when it is stored in the APPM database")
|
||||
@ -43,7 +44,7 @@ public class Application {
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(name = "appCategory",
|
||||
value = "Category of the application",
|
||||
value = "CategoryEntity of the application",
|
||||
required = true,
|
||||
example = "Educational, Gaming, Travel, Entertainment etc")
|
||||
private String appCategory;
|
||||
@ -70,45 +71,36 @@ public class Application {
|
||||
value = "List of application tags")
|
||||
private List<String> tags;
|
||||
|
||||
@ApiModelProperty(name = "user",
|
||||
value = "Application creating user")
|
||||
private User user;
|
||||
|
||||
@ApiModelProperty(name = "unrestrictedRoles",
|
||||
value = "List of roles that users should have to access the application")
|
||||
private List<String> unrestrictedRoles;
|
||||
|
||||
@ApiModelProperty(name = "isRestricted",
|
||||
value = "If unrestricted roles are defined then isRestricted value is true otherwise it is false")
|
||||
private boolean isRestricted;
|
||||
|
||||
@ApiModelProperty(name = "deviceTypeId",
|
||||
value = "Id of the Related device type of the application",
|
||||
example = "1, 2, 3")
|
||||
private int deviceTypeId;
|
||||
|
||||
@ApiModelProperty(name = "deviceTypeName",
|
||||
value = "Related device type of the application",
|
||||
required = true,
|
||||
example = "IoS, Android, Arduino, RaspberryPi etc")
|
||||
private String deviceTypeName;
|
||||
|
||||
@ApiModelProperty(name = "appRating",
|
||||
value = "Rating of the aplication")
|
||||
private int appRating;
|
||||
|
||||
@ApiModelProperty(name = "deviceType",
|
||||
value = "Related device type of the application",
|
||||
required = true,
|
||||
example = "IoS, Android, Arduino, RaspberryPi etc")
|
||||
private String deviceType;
|
||||
|
||||
@ApiModelProperty(name = "status",
|
||||
value = "Application status",
|
||||
value = "ApplicationEntity status",
|
||||
required = true,
|
||||
example = "REMOVED, ACTIVE")
|
||||
private String status;
|
||||
|
||||
private DeviceType deviceTypeObj;
|
||||
|
||||
@ApiModelProperty(name = "applicationReleases",
|
||||
value = "List of application releases",
|
||||
required = true)
|
||||
private List<ApplicationRelease> applicationReleases;
|
||||
private List<ApplicationReleaseEntity> applicationReleases;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@ -138,14 +130,6 @@ public class Application {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -170,19 +154,11 @@ public class Application {
|
||||
this.paymentCurrency = paymentCurrency;
|
||||
}
|
||||
|
||||
public boolean getIsRestricted() {
|
||||
return isRestricted;
|
||||
}
|
||||
|
||||
public void setIsRestricted(boolean isRestricted) {
|
||||
this.isRestricted = isRestricted;
|
||||
}
|
||||
|
||||
public List<ApplicationRelease> getApplicationReleases() {
|
||||
public List<ApplicationReleaseEntity> getApplicationReleases() {
|
||||
return applicationReleases;
|
||||
}
|
||||
|
||||
public void setApplicationReleases(List<ApplicationRelease> applicationReleases) {
|
||||
public void setApplicationReleases(List<ApplicationReleaseEntity> applicationReleases) {
|
||||
this.applicationReleases = applicationReleases;
|
||||
}
|
||||
|
||||
@ -194,11 +170,11 @@ public class Application {
|
||||
this.unrestrictedRoles = unrestrictedRoles;
|
||||
}
|
||||
|
||||
public String getDeviceType() {
|
||||
return deviceType;
|
||||
public String getDeviceTypeName() {
|
||||
return deviceTypeName;
|
||||
}
|
||||
|
||||
public void setDeviceType(String deviceType) { this.deviceType = deviceType; }
|
||||
public void setDeviceTypeName(String deviceTypeName) { this.deviceTypeName = deviceTypeName; }
|
||||
|
||||
public int getDeviceTypeId() {
|
||||
return deviceTypeId;
|
||||
@ -219,8 +195,4 @@ public class Application {
|
||||
public int getAppRating() { return appRating; }
|
||||
|
||||
public void setAppRating(int appRating) { this.appRating = appRating; }
|
||||
|
||||
public DeviceType getDeviceTypeObj() { return deviceTypeObj; }
|
||||
|
||||
public void setDeviceTypeObj(DeviceType deviceTypeObj) { this.deviceTypeObj = deviceTypeObj; }
|
||||
}
|
||||
@ -16,14 +16,14 @@
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
package org.wso2.carbon.device.application.mgt.common.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel(value = "ApplicationRelease", description = "This class holds the details when releasing an Application to application store")
|
||||
public class ApplicationRelease {
|
||||
@ApiModel(value = "ApplicationReleaseEntity", description = "This class holds the details when releasing an ApplicationEntity to application store")
|
||||
public class ApplicationReleaseEntity {
|
||||
|
||||
@JsonIgnore
|
||||
@ApiModelProperty(name = "id",
|
||||
@ -42,29 +42,29 @@ public class ApplicationRelease {
|
||||
value = "UUID of the application release")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(name = "appStoredLoc",
|
||||
value = "Application storing location")
|
||||
private String appStoredLoc;
|
||||
@ApiModelProperty(name = "installerName",
|
||||
value = "ApplicationEntity storing location")
|
||||
private String installerName;
|
||||
|
||||
@ApiModelProperty(name = "bannerLoc",
|
||||
@ApiModelProperty(name = "bannerName",
|
||||
value = "Banner file storing location")
|
||||
private String bannerLoc;
|
||||
private String bannerName;
|
||||
|
||||
@ApiModelProperty(name = "screenshotLoc1",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotLoc1;
|
||||
|
||||
@ApiModelProperty(name = "screenshotLoc2",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotLoc2;
|
||||
|
||||
@ApiModelProperty(name = "screenshotLoc3",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotLoc3;
|
||||
|
||||
@ApiModelProperty(name = "iconLoc",
|
||||
@ApiModelProperty(name = "iconName",
|
||||
value = "icon file storing location")
|
||||
private String iconLoc;
|
||||
private String iconName;
|
||||
|
||||
@ApiModelProperty(name = "screenshotName1",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotName1;
|
||||
|
||||
@ApiModelProperty(name = "screenshotName2",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotName2;
|
||||
|
||||
@ApiModelProperty(name = "screenshotName3",
|
||||
value = "Screenshot storing location")
|
||||
private String screenshotName3;
|
||||
|
||||
@ApiModelProperty(name = "releaseType",
|
||||
value = "Release type of the application release",
|
||||
@ -81,7 +81,6 @@ public class ApplicationRelease {
|
||||
value = "Hash value of the application release")
|
||||
private String appHashValue;
|
||||
|
||||
// todo change this to boolean
|
||||
@ApiModelProperty(name = "isSharedWithAllTenants",
|
||||
value = "If application release is shared with all tenants it is eqal to 1 otherwise 0",
|
||||
required = true)
|
||||
@ -104,13 +103,8 @@ public class ApplicationRelease {
|
||||
value = "URL which is used for WEB-CLIP")
|
||||
private String url;
|
||||
|
||||
//todo remove and add string called current state
|
||||
@ApiModelProperty(name = "lifecycleState",
|
||||
value = "Latest Lifecycle state of the application release")
|
||||
private LifecycleState lifecycleState;
|
||||
|
||||
@ApiModelProperty(name = "supportedOsVersions",
|
||||
value = "Application release supported OS versions")
|
||||
value = "ApplicationEntity release supported OS versions")
|
||||
private String supportedOsVersions;
|
||||
|
||||
@ApiModelProperty(name = "currentState",
|
||||
@ -118,10 +112,10 @@ public class ApplicationRelease {
|
||||
private String currentState;
|
||||
|
||||
@ApiModelProperty(name = "packageName",
|
||||
value = "Application bundle identifier")
|
||||
value = "ApplicationEntity bundle identifier")
|
||||
private String packageName;
|
||||
|
||||
public ApplicationRelease() {
|
||||
public ApplicationReleaseEntity() {
|
||||
}
|
||||
|
||||
public int getRatedUsers() {
|
||||
@ -202,52 +196,52 @@ public class ApplicationRelease {
|
||||
return metaData;
|
||||
}
|
||||
|
||||
public String getAppStoredLoc() {
|
||||
return appStoredLoc;
|
||||
public String getInstallerName() {
|
||||
return installerName;
|
||||
}
|
||||
|
||||
public void setAppStoredLoc(String appStoredLoc) {
|
||||
this.appStoredLoc = appStoredLoc;
|
||||
public void setInstallerName(String installerName) {
|
||||
this.installerName = installerName;
|
||||
}
|
||||
|
||||
public String getBannerLoc() {
|
||||
return bannerLoc;
|
||||
public String getBannerName() {
|
||||
return bannerName;
|
||||
}
|
||||
|
||||
public void setBannerLoc(String bannerLoc) {
|
||||
this.bannerLoc = bannerLoc;
|
||||
public void setBannerName(String bannerName) {
|
||||
this.bannerName = bannerName;
|
||||
}
|
||||
|
||||
public String getScreenshotLoc1() {
|
||||
return screenshotLoc1;
|
||||
public String getScreenshotName1() {
|
||||
return screenshotName1;
|
||||
}
|
||||
|
||||
public void setScreenshotLoc1(String screenshotLoc1) {
|
||||
this.screenshotLoc1 = screenshotLoc1;
|
||||
public void setScreenshotName1(String screenshotName1) {
|
||||
this.screenshotName1 = screenshotName1;
|
||||
}
|
||||
|
||||
public String getScreenshotLoc2() {
|
||||
return screenshotLoc2;
|
||||
public String getScreenshotName2() {
|
||||
return screenshotName2;
|
||||
}
|
||||
|
||||
public void setScreenshotLoc2(String screenshotLoc2) {
|
||||
this.screenshotLoc2 = screenshotLoc2;
|
||||
public void setScreenshotName2(String screenshotName2) {
|
||||
this.screenshotName2 = screenshotName2;
|
||||
}
|
||||
|
||||
public String getScreenshotLoc3() {
|
||||
return screenshotLoc3;
|
||||
public String getScreenshotName3() {
|
||||
return screenshotName3;
|
||||
}
|
||||
|
||||
public void setScreenshotLoc3(String screenshotLoc3) {
|
||||
this.screenshotLoc3 = screenshotLoc3;
|
||||
public void setScreenshotName3(String screenshotName3) {
|
||||
this.screenshotName3 = screenshotName3;
|
||||
}
|
||||
|
||||
public String getIconLoc() {
|
||||
return iconLoc;
|
||||
public String getIconName() {
|
||||
return iconName;
|
||||
}
|
||||
|
||||
public void setIconLoc(String iconLoc) {
|
||||
this.iconLoc = iconLoc;
|
||||
public void setIconName(String iconName) {
|
||||
this.iconName = iconName;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
@ -258,14 +252,6 @@ public class ApplicationRelease {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public LifecycleState getLifecycleState() {
|
||||
return lifecycleState;
|
||||
}
|
||||
|
||||
public void setLifecycleState(LifecycleState lifecycleState) {
|
||||
this.lifecycleState = lifecycleState;
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
package org.wso2.carbon.device.application.mgt.common.entity;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
@ -15,7 +15,7 @@ package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Ent
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
public class Category {
|
||||
public class CategoryEntity {
|
||||
int id;
|
||||
|
||||
String categoryName;
|
||||
@ -16,7 +16,7 @@
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common;
|
||||
package org.wso2.carbon.device.application.mgt.common.entity;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -24,8 +24,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "LifecycleState", description = "LifecycleState represents the Lifecycle state for an application release")
|
||||
public class LifecycleState {
|
||||
@ApiModel(value = "LifecycleStateEntity", description = "LifecycleStateEntity represents the Lifecycle state for an application release")
|
||||
public class LifecycleStateEntity {
|
||||
|
||||
@ApiModelProperty(name = "id",
|
||||
value = "ID of the application release lifecycle",
|
||||
@ -1,4 +1,4 @@
|
||||
package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
package org.wso2.carbon.device.application.mgt.common.entity;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
@ -15,7 +15,7 @@ package org.wso2.carbon.device.application.mgt.common;/* Copyright (c) 2019, Ent
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
public class Tag {
|
||||
public class TagEntity {
|
||||
|
||||
int id;
|
||||
|
||||
@ -0,0 +1,124 @@
|
||||
package org.wso2.carbon.device.application.mgt.common.response;/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. 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.
|
||||
*/
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Application {
|
||||
@ApiModelProperty(name = "name",
|
||||
value = "Name of the application",
|
||||
required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "description",
|
||||
value = "Description of the application",
|
||||
required = true)
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(name = "appCategory",
|
||||
value = "CategoryEntity of the application",
|
||||
required = true,
|
||||
example = "Educational, Gaming, Travel, Entertainment etc")
|
||||
private String appCategory;
|
||||
|
||||
@ApiModelProperty(name = "type",
|
||||
value = "Type of the application",
|
||||
required = true,
|
||||
example = "ENTERPRISE, PUBLIC, WEB, WEB_CLIP etc")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(name = "subType",
|
||||
value = "Subscription type of the application",
|
||||
required = true,
|
||||
example = "PAID, FREE")
|
||||
private String subType;
|
||||
|
||||
@ApiModelProperty(name = "paymentCurrency",
|
||||
value = "Payment currency of the application",
|
||||
required = true,
|
||||
example = "$")
|
||||
private String paymentCurrency;
|
||||
|
||||
@ApiModelProperty(name = "tags",
|
||||
value = "List of application tags")
|
||||
private List<String> tags;
|
||||
|
||||
@ApiModelProperty(name = "unrestrictedRoles",
|
||||
value = "List of roles that users should have to access the application")
|
||||
private List<String> unrestrictedRoles;
|
||||
|
||||
@ApiModelProperty(name = "deviceType",
|
||||
value = "Related device type of the application",
|
||||
required = true,
|
||||
example = "IoS, Android, Arduino, RaspberryPi etc")
|
||||
private String deviceType;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "applicationReleases",
|
||||
value = "List of application releases",
|
||||
required = true)
|
||||
private List<ApplicationRelease> applicationReleases;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getAppCategory() {
|
||||
return appCategory;
|
||||
}
|
||||
|
||||
public void setAppCategory(String appCategory) {
|
||||
this.appCategory = appCategory;
|
||||
}
|
||||
|
||||
public List<String> getTags() { return tags; }
|
||||
|
||||
public void setTags(List<String> tags) { this.tags = tags; }
|
||||
|
||||
public String getType() { return type; }
|
||||
|
||||
public void setType(String type) { this.type = type; }
|
||||
|
||||
public String getSubType() { return subType; }
|
||||
|
||||
public void setSubType(String subType) { this.subType = subType; }
|
||||
|
||||
public String getPaymentCurrency() { return paymentCurrency; }
|
||||
|
||||
public void setPaymentCurrency(String paymentCurrency) { this.paymentCurrency = paymentCurrency; }
|
||||
|
||||
public List<ApplicationRelease> getApplicationReleases() { return applicationReleases; }
|
||||
|
||||
public void setApplicationReleases(List<ApplicationRelease> applicationReleases) {
|
||||
this.applicationReleases = applicationReleases; }
|
||||
|
||||
public List<String> getUnrestrictedRoles() { return unrestrictedRoles; }
|
||||
|
||||
public void setUnrestrictedRoles(List<String> unrestrictedRoles) { this.unrestrictedRoles = unrestrictedRoles; }
|
||||
|
||||
public String getDeviceType() { return deviceType; }
|
||||
|
||||
public void setDeviceType(String deviceType) { this.deviceType = deviceType; }
|
||||
|
||||
public String getDescription() { return description; }
|
||||
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel(value = "ApplicationReleaseEntity", description = "This class holds the details when releasing an ApplicationEntity to application store")
|
||||
public class ApplicationRelease {
|
||||
|
||||
@ApiModelProperty(name = "description",
|
||||
value = "Description of the application release")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(name = "releaseType",
|
||||
value = "Release type of the application release",
|
||||
required = true,
|
||||
example = "alpha, beta etc")
|
||||
private String releaseType;
|
||||
|
||||
@ApiModelProperty(name = "price",
|
||||
value = "Price of the application release",
|
||||
required = true)
|
||||
private Double price;
|
||||
|
||||
@ApiModelProperty(name = "isSharedWithAllTenants",
|
||||
value = "If application release is shared with all tenants it is eqal to 1 otherwise 0",
|
||||
required = true)
|
||||
private boolean isSharedWithAllTenants;
|
||||
|
||||
@ApiModelProperty(name = "metaData",
|
||||
value = "Meta data of the application release",
|
||||
required = true)
|
||||
private String metaData;
|
||||
|
||||
@ApiModelProperty(name = "url",
|
||||
value = "URL which is used for WEB-CLIP")
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(name = "supportedOsVersions",
|
||||
value = "ApplicationEntity release supported OS versions")
|
||||
private String supportedOsVersions;
|
||||
|
||||
public String getReleaseType() {
|
||||
return releaseType;
|
||||
}
|
||||
|
||||
public void setReleaseType(String releaseType) {
|
||||
this.releaseType = releaseType;
|
||||
}
|
||||
|
||||
public void setIsSharedWithAllTenants(boolean isSharedWithAllTenants) {
|
||||
this.isSharedWithAllTenants = isSharedWithAllTenants;
|
||||
}
|
||||
|
||||
public void setMetaData(String metaData) {
|
||||
this.metaData = metaData;
|
||||
}
|
||||
|
||||
public Double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public boolean getIsSharedWithAllTenants() {
|
||||
return isSharedWithAllTenants;
|
||||
}
|
||||
|
||||
public String getMetaData() {
|
||||
return metaData;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getDescription() { return description; }
|
||||
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getSupportedOsVersions() { return supportedOsVersions; }
|
||||
|
||||
public void setSupportedOsVersions(String supportedOsVersions) { this.supportedOsVersions = supportedOsVersions; }
|
||||
}
|
||||
@ -19,16 +19,20 @@
|
||||
package org.wso2.carbon.device.application.mgt.common.services;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationArtifact;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.Filter;
|
||||
import org.wso2.carbon.device.application.mgt.common.LifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.LifecycleStateEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException;
|
||||
import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationReleaseWrapper;
|
||||
import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This interface manages the application creation, deletion and editing of the application.
|
||||
@ -38,29 +42,28 @@ public interface ApplicationManager {
|
||||
/**
|
||||
* Creates an application.
|
||||
*
|
||||
* @param application Application that need to be created.
|
||||
* @param applicationWrapper ApplicationEntity that need to be created.
|
||||
* @return Created application
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
Application createApplication(Application application, Attachment binaryFile, Attachment iconFile,
|
||||
Attachment bannerFile, List<Attachment> attachmentList)
|
||||
ApplicationEntity createApplication(ApplicationWrapper applicationWrapper, ApplicationArtifact applicationArtifact)
|
||||
throws ApplicationManagementException, RequestValidatingException;
|
||||
|
||||
/**
|
||||
* Updates an already existing application.
|
||||
*
|
||||
* @param application Application that need to be updated.
|
||||
* @param application ApplicationEntity that need to be updated.
|
||||
* @param applicationId ID of the application
|
||||
* @return Updated Application
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @return Updated ApplicationEntity
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
Application updateApplication(int applicationId, Application application) throws ApplicationManagementException;
|
||||
ApplicationEntity updateApplication(int applicationId, ApplicationEntity application) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* Delete an application identified by the unique ID.
|
||||
*
|
||||
* @param applicationId ID for tha application
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
List<String> deleteApplication(int applicationId) throws ApplicationManagementException;
|
||||
|
||||
@ -69,7 +72,7 @@ public interface ApplicationManager {
|
||||
*
|
||||
* @param applicationId ID of tha application
|
||||
* @param releaseUuid UUID of tha application release
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
String deleteApplicationRelease(int applicationId, String releaseUuid) throws ApplicationManagementException;
|
||||
|
||||
@ -78,69 +81,69 @@ public interface ApplicationManager {
|
||||
*
|
||||
* @param filter Search filter
|
||||
* @return Applications that matches the given filter criteria.
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
ApplicationList getApplications(Filter filter) throws ApplicationManagementException;
|
||||
ApplicationList getApplications(Filter filter, String deviceTypeName) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To get the Application for given Id.
|
||||
* To get the ApplicationEntity for given Id.
|
||||
*
|
||||
* @param id id of the Application
|
||||
* @param state state of the Application
|
||||
* @return the Application identified by the ID
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @param id id of the ApplicationEntity
|
||||
* @param state state of the ApplicationEntity
|
||||
* @return the ApplicationEntity identified by the ID
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
Application getApplicationById(int id, String state) throws ApplicationManagementException;
|
||||
ApplicationEntity getApplicationById(int id, String state) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To get the Application for given application relase UUID.
|
||||
* To get the ApplicationEntity for given application relase UUID.
|
||||
*
|
||||
* @param uuid UUID of the Application
|
||||
* @param state state of the Application
|
||||
* @return the Application identified by the ID
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @param uuid UUID of the ApplicationEntity
|
||||
* @param state state of the ApplicationEntity
|
||||
* @return the ApplicationEntity identified by the ID
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
Application getApplicationByUuid(String uuid, String state) throws ApplicationManagementException;
|
||||
ApplicationEntity getApplicationByUuid(String uuid, String state) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To get an application associated with the release.
|
||||
*
|
||||
* @param appReleaseUUID UUID of the app release
|
||||
* @return {@link Application} associated with the release
|
||||
* @throws ApplicationManagementException If unable to retrieve {@link Application} associated with the given UUID
|
||||
* @return {@link ApplicationEntity} associated with the release
|
||||
* @throws ApplicationManagementException If unable to retrieve {@link ApplicationEntity} associated with the given UUID
|
||||
*/
|
||||
Application getApplicationByRelease(String appReleaseUUID) throws ApplicationManagementException;
|
||||
ApplicationEntity getApplicationByRelease(String appReleaseUUID) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To get all the releases of a particular Application.
|
||||
* To get all the releases of a particular ApplicationEntity.
|
||||
*
|
||||
* @param applicationId ID of the Application .
|
||||
* @param releaseUuid UUID of the Application Release.
|
||||
* @return the LifecycleState of the Application releases related with the particular Application.
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @param applicationId ID of the ApplicationEntity .
|
||||
* @param releaseUuid UUID of the ApplicationEntity Release.
|
||||
* @return the LifecycleStateEntity of the ApplicationEntity releases related with the particular ApplicationEntity.
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
LifecycleState getLifecycleState(int applicationId, String releaseUuid) throws ApplicationManagementException;
|
||||
LifecycleStateEntity getLifecycleState(int applicationId, String releaseUuid) throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To get all the releases of a particular Application.
|
||||
* To get all the releases of a particular ApplicationEntity.
|
||||
*
|
||||
* @param applicationId ID of the Application.
|
||||
* @param releaseUuid UUID of the Application Release.
|
||||
* @param applicationId ID of the ApplicationEntity.
|
||||
* @param releaseUuid UUID of the ApplicationEntity Release.
|
||||
* @param state Lifecycle state to change the app
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
void changeLifecycleState(int applicationId, String releaseUuid, LifecycleState state)
|
||||
void changeLifecycleState(int applicationId, String releaseUuid, LifecycleStateEntity state)
|
||||
throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To update release images such as icons, banner and screenshots.
|
||||
*
|
||||
* @param appId ID of the Application
|
||||
* @param uuid uuid of the Application
|
||||
* @param appId ID of the ApplicationEntity
|
||||
* @param uuid uuid of the ApplicationEntity
|
||||
* @param iconFileStream icon file of the release
|
||||
* @param bannerFileStream bannerFileStream of the release.
|
||||
* @param attachments screenshot attachments of the release
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
void updateApplicationImageArtifact(int appId, String uuid, InputStream iconFileStream, InputStream
|
||||
bannerFileStream, List<InputStream> attachments) throws ApplicationManagementException;
|
||||
@ -149,23 +152,23 @@ public interface ApplicationManager {
|
||||
/**
|
||||
* To update release images.
|
||||
*
|
||||
* @param appId ID of the Application
|
||||
* @param appId ID of the ApplicationEntity
|
||||
* @param deviceType Applicable device type of the application
|
||||
* @param uuid uuid of the Application
|
||||
* @param uuid uuid of the ApplicationEntity
|
||||
* @param binaryFile binaryFile of the release.
|
||||
* @throws ApplicationManagementException Application Management Exception.
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception.
|
||||
*/
|
||||
void updateApplicationArtifact(int appId, String deviceType, String uuid, InputStream binaryFile)
|
||||
throws ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* To create an application release for an Application.
|
||||
* To create an application release for an ApplicationEntity.
|
||||
*
|
||||
* @param applicationId ID of the Application
|
||||
* @param applicationId ID of the ApplicationEntity
|
||||
* @param applicationRelease ApplicatonRelease that need to be be created.
|
||||
* @return the unique id of the application release, if the application release succeeded else -1
|
||||
*/
|
||||
ApplicationRelease createRelease(int applicationId, ApplicationRelease applicationRelease)
|
||||
ApplicationReleaseEntity createRelease(int applicationId, ApplicationReleaseEntity applicationRelease)
|
||||
throws ApplicationManagementException;
|
||||
|
||||
/***
|
||||
@ -173,28 +176,24 @@ public interface ApplicationManager {
|
||||
* @param applicationId ID of the application
|
||||
* @param releaseUuid UUID of the application release
|
||||
* @param deviceType Supported device type of the application
|
||||
* @param applicationRelease {@link ApplicationRelease}
|
||||
* @param applicationRelease {@link ApplicationReleaseEntity}
|
||||
* @param binaryFileStram {@link InputStream} of the binary file
|
||||
* @param iconFileStream {@link InputStream} of the icon
|
||||
* @param bannerFileStream {@link InputStream} of the banner
|
||||
* @param attachments {@link List} of {@link InputStream} of attachments
|
||||
* @return If the application release is updated correctly True returns, otherwise retuen False
|
||||
*/
|
||||
boolean updateRelease(int applicationId, String releaseUuid, String deviceType, ApplicationRelease applicationRelease,
|
||||
boolean updateRelease(int applicationId, String releaseUuid, String deviceType, ApplicationReleaseEntity applicationRelease,
|
||||
InputStream binaryFileStram, InputStream iconFileStream, InputStream bannerFileStream,
|
||||
List<InputStream> attachments) throws ApplicationManagementException;
|
||||
|
||||
/***
|
||||
*
|
||||
* @param release {@link ApplicationRelease}
|
||||
* @param applicationType Type of the application
|
||||
* @param binaryFile Uploading binary fila. i.e .apk or .ipa
|
||||
* @param iconFile Icon file for the application.
|
||||
* @param bannerFile Banner file for the application.
|
||||
* @param attachmentList Screenshot list.
|
||||
* @throws RequestValidatingException
|
||||
*/
|
||||
void validateReleaseCreatingRequest(ApplicationRelease release, String applicationType, Attachment binaryFile,
|
||||
Attachment iconFile, Attachment bannerFile, List<Attachment> attachmentList)
|
||||
void validateAppCreatingRequest(ApplicationWrapper applicationWrapper, Attachment binaryFile, Attachment iconFile,
|
||||
Attachment bannerFile, List<Attachment> attachmentList) throws RequestValidatingException;
|
||||
|
||||
void validateReleaseCreatingRequest(ApplicationReleaseWrapper applicationReleaseWrapper, String applicationType,
|
||||
Attachment binaryFile, Attachment iconFile, Attachment bannerFile, List<Attachment> attachmentList)
|
||||
throws RequestValidatingException;
|
||||
}
|
||||
|
||||
void addAplicationCategories(List<String> categories) throws ApplicationManagementException;
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
package org.wso2.carbon.device.application.mgt.common.services;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException;
|
||||
@ -29,25 +29,22 @@ import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This manages all the storage related requirements of Application.
|
||||
* This manages all the storage related requirements of ApplicationEntity.
|
||||
*/
|
||||
public interface ApplicationStorageManager {
|
||||
/**
|
||||
* To upload image artifacts related with an Application.
|
||||
* To upload image artifacts related with an ApplicationEntity.
|
||||
*
|
||||
* @param applicationRelease ApplicationRelease Object
|
||||
* @param applicationRelease ApplicationReleaseEntity Object
|
||||
* @param iconFile Icon File input stream
|
||||
* @param bannerFile Banner File input stream
|
||||
* @throws ResourceManagementException Resource Management Exception.
|
||||
*/
|
||||
ApplicationRelease uploadImageArtifacts(ApplicationRelease applicationRelease,
|
||||
ApplicationReleaseEntity uploadImageArtifacts(ApplicationReleaseEntity applicationRelease,
|
||||
InputStream iconFile, InputStream bannerFile, List<InputStream> screenshots) throws ResourceManagementException;
|
||||
|
||||
ApplicationRelease uploadImageArtifactsTmp(ApplicationRelease applicationRelease,
|
||||
Attachment iconFile, Attachment bannerFile, List<Attachment> screenshots) throws ResourceManagementException;
|
||||
|
||||
/**
|
||||
* To upload image artifacts related with an Application.
|
||||
* To upload image artifacts related with an ApplicationEntity.
|
||||
*
|
||||
* @param applicationRelease Release of the application
|
||||
* @param iconFile Icon File input stream
|
||||
@ -55,38 +52,35 @@ public interface ApplicationStorageManager {
|
||||
* @param screenshots Input Streams of screenshots
|
||||
* @throws ResourceManagementException Resource Management Exception.
|
||||
*/
|
||||
ApplicationRelease updateImageArtifacts(ApplicationRelease applicationRelease, InputStream iconFile,
|
||||
ApplicationReleaseEntity updateImageArtifacts(ApplicationReleaseEntity applicationRelease, InputStream iconFile,
|
||||
InputStream bannerFile, List<InputStream> screenshots) throws ResourceManagementException;
|
||||
|
||||
/**
|
||||
* To upload release artifacts for an Application.
|
||||
* To upload release artifacts for an ApplicationEntity.
|
||||
*
|
||||
* @param applicationRelease Application Release Object.
|
||||
* @param appType Application Type.
|
||||
* @param applicationRelease ApplicationEntity Release Object.
|
||||
* @param appType ApplicationEntity Type.
|
||||
* @param deviceType Compatible device tipe of the application.
|
||||
* @param binaryFile Binary File for the release.
|
||||
* @throws ResourceManagementException Resource Management Exception.
|
||||
*/
|
||||
ApplicationRelease uploadReleaseArtifact(ApplicationRelease applicationRelease, String appType, String deviceType,
|
||||
ApplicationReleaseEntity uploadReleaseArtifact(ApplicationReleaseEntity applicationRelease, String appType, String deviceType,
|
||||
InputStream binaryFile) throws ResourceManagementException, RequestValidatingException;
|
||||
|
||||
ApplicationRelease uploadReleaseArtifactTmp(ApplicationRelease applicationRelease, String appType, String deviceType,
|
||||
Attachment binaryFile) throws ResourceManagementException, RequestValidatingException;
|
||||
|
||||
/**
|
||||
* To upload release artifacts for an Application.
|
||||
* To upload release artifacts for an ApplicationEntity.
|
||||
*
|
||||
* @param applicationRelease applicationRelease Application release of a particular application.
|
||||
* @param applicationRelease applicationRelease ApplicationEntity release of a particular application.
|
||||
* @param appType Type of the application.
|
||||
* @param deviceType Compatible device tipe of the application.
|
||||
* @param binaryFile Binary File for the release.
|
||||
* @throws ApplicationStorageManagementException Resource Management Exception.
|
||||
*/
|
||||
ApplicationRelease updateReleaseArtifacts(ApplicationRelease applicationRelease, String appType, String deviceType,
|
||||
ApplicationReleaseEntity updateReleaseArtifacts(ApplicationReleaseEntity applicationRelease, String appType, String deviceType,
|
||||
InputStream binaryFile) throws ApplicationStorageManagementException, RequestValidatingException;
|
||||
|
||||
/**
|
||||
* To delete the artifacts related with particular Application Release.
|
||||
* To delete the artifacts related with particular ApplicationEntity Release.
|
||||
*
|
||||
* @param directoryPath Hash value of the application artifact.
|
||||
* @throws ApplicationStorageManagementException Not Found Exception.
|
||||
@ -94,11 +88,20 @@ public interface ApplicationStorageManager {
|
||||
void deleteApplicationReleaseArtifacts(String directoryPath) throws ApplicationStorageManagementException;
|
||||
|
||||
/**
|
||||
* To delete all release artifacts related with particular Application Release.
|
||||
* To delete all release artifacts related with particular ApplicationEntity Release.
|
||||
*
|
||||
* @param directoryPaths Hash values of the Application.
|
||||
* @throws ApplicationStorageManagementException Application Storage Management Exception
|
||||
* @param directoryPaths Hash values of the ApplicationEntity.
|
||||
* @throws ApplicationStorageManagementException ApplicationEntity Storage Management Exception
|
||||
*/
|
||||
void deleteAllApplicationReleaseArtifacts(List<String> directoryPaths) throws ApplicationStorageManagementException;
|
||||
|
||||
}
|
||||
/***
|
||||
* Get the InputStream of the file which is located in filePath
|
||||
* @param path file path
|
||||
* @return {@link InputStream}
|
||||
* @throws ApplicationStorageManagementException throws if an error occurs when accessing the file.
|
||||
*/
|
||||
InputStream getFileSttream (String path) throws ApplicationStorageManagementException;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -20,12 +20,16 @@ package org.wso2.carbon.device.application.mgt.common.services;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
|
||||
public interface ConfigManager {
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface AppmDataHandler {
|
||||
/**
|
||||
* Get all review with pagination
|
||||
* Get UI configuration which is defined in the app-manager.xml
|
||||
*
|
||||
* @return {@link UIConfiguration} UI configuration
|
||||
* @throws ApplicationManagementException Exceptions of the Application managementt.
|
||||
* @throws ApplicationManagementException Exceptions of the ApplicationEntity management.
|
||||
*/
|
||||
UIConfiguration getUIConfiguration() throws ApplicationManagementException;
|
||||
|
||||
InputStream getArtifactStream(String md5sum, String artifactName) throws ApplicationManagementException;
|
||||
}
|
||||
@ -25,7 +25,7 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface manages all the operations related with Application Subscription.
|
||||
* This interface manages all the operations related with ApplicationEntity Subscription.
|
||||
*/
|
||||
public interface SubscriptionManager {
|
||||
/**
|
||||
@ -70,10 +70,10 @@ public interface SubscriptionManager {
|
||||
|
||||
/**
|
||||
* To uninstall an application from a given list of devices.
|
||||
* @param applicationUUID Application ID
|
||||
* @param applicationUUID ApplicationEntity ID
|
||||
* @param deviceList Device list
|
||||
* @return Failed Device List which the application was unable to uninstall
|
||||
* @throws ApplicationManagementException Application Management Exception
|
||||
* @throws ApplicationManagementException ApplicationEntity Management Exception
|
||||
*/
|
||||
List<DeviceIdentifier> uninstallApplication(String applicationUUID, List<DeviceIdentifier> deviceList)
|
||||
throws ApplicationManagementException;
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common.wrappers;
|
||||
package org.wso2.carbon.device.application.mgt.common.wrapper;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel(value = "ApplicationRelease", description = "This class holds the details when releasing an Application to application store")
|
||||
@ApiModel(value = "ApplicationReleaseEntity", description = "This class holds the details when releasing an ApplicationEntity to application store")
|
||||
public class ApplicationReleaseWrapper {
|
||||
|
||||
@ApiModelProperty(name = "description",
|
||||
@ -54,7 +54,7 @@ public class ApplicationReleaseWrapper {
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(name = "supportedOsVersions",
|
||||
value = "Application release supported OS versions")
|
||||
value = "ApplicationEntity release supported OS versions")
|
||||
private String supportedOsVersions;
|
||||
|
||||
public String getReleaseType() {
|
||||
@ -16,15 +16,14 @@
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.common.wrappers;
|
||||
package org.wso2.carbon.device.application.mgt.common.wrapper;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "Application", description = "Application represents the an Application in Application Store")
|
||||
@ApiModel(value = "ApplicationWrapper", description = "ApplicationWrapper represents the an ApplicationEntity in ApplicationEntity Store")
|
||||
public class ApplicationWrapper {
|
||||
|
||||
|
||||
@ -39,7 +38,7 @@ public class ApplicationWrapper {
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(name = "appCategory",
|
||||
value = "Category of the application",
|
||||
value = "CategoryEntity of the application",
|
||||
required = true,
|
||||
example = "Educational, Gaming, Travel, Entertainment etc")
|
||||
private String appCategory;
|
||||
@ -76,11 +75,10 @@ public class ApplicationWrapper {
|
||||
example = "IoS, Android, Arduino, RaspberryPi etc")
|
||||
private String deviceType;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "applicationReleases",
|
||||
@ApiModelProperty(name = "applicationReleaseWrappers",
|
||||
value = "List of application releases",
|
||||
required = true)
|
||||
private List<ApplicationRelease> applicationReleases;
|
||||
private List<ApplicationReleaseWrapper> applicationReleaseWrappers;
|
||||
|
||||
|
||||
public String getName() {
|
||||
@ -113,10 +111,10 @@ public class ApplicationWrapper {
|
||||
|
||||
public void setPaymentCurrency(String paymentCurrency) { this.paymentCurrency = paymentCurrency; }
|
||||
|
||||
public List<ApplicationRelease> getApplicationReleases() { return applicationReleases; }
|
||||
public List<ApplicationReleaseWrapper> getApplicationReleaseWrappers() { return applicationReleaseWrappers; }
|
||||
|
||||
public void setApplicationReleases(List<ApplicationRelease> applicationReleases) {
|
||||
this.applicationReleases = applicationReleases; }
|
||||
public void setApplicationReleaseWrappers(List<ApplicationReleaseWrapper> applicationReleaseWrappers) {
|
||||
this.applicationReleaseWrappers = applicationReleaseWrappers; }
|
||||
|
||||
public List<String> getUnrestrictedRoles() { return unrestrictedRoles; }
|
||||
|
||||
@ -201,6 +201,12 @@
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib-nodep</artifactId>
|
||||
<version>3.2.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
|
||||
@ -44,6 +44,8 @@ public class Configuration {
|
||||
|
||||
private UIConfiguration uiConfiguration;
|
||||
|
||||
private List<String> appCategories;
|
||||
|
||||
@XmlElement(name = "DatasourceName", required = true)
|
||||
public String getDatasourceName() {
|
||||
return datasourceName;
|
||||
@ -74,8 +76,7 @@ public class Configuration {
|
||||
return lifecycleStates;
|
||||
}
|
||||
|
||||
public void setLifecycleStates(
|
||||
List<LifecycleState> lifecycleStates) {
|
||||
public void setLifecycleStates(List<LifecycleState> lifecycleStates) {
|
||||
this.lifecycleStates = lifecycleStates;
|
||||
}
|
||||
|
||||
@ -87,5 +88,15 @@ public class Configuration {
|
||||
public void setUiConfiguration(UIConfiguration uiConfiguration) {
|
||||
this.uiConfiguration = uiConfiguration;
|
||||
}
|
||||
|
||||
@XmlElementWrapper(name = "AppCategories")
|
||||
@XmlElement(name = "Category")
|
||||
public List<String> getAppCategories() {
|
||||
return appCategories;
|
||||
}
|
||||
|
||||
public void setAppCategories(List<String> appCategories) {
|
||||
this.appCategories = appCategories;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,57 +19,56 @@
|
||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.*;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.CategoryEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.TagEntity;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ApplicationDAO is responsible for handling all the Database related operations related with Application Management.
|
||||
* ApplicationDAO is responsible for handling all the Database related operations related with ApplicationEntity Management.
|
||||
*/
|
||||
public interface ApplicationDAO {
|
||||
|
||||
/**
|
||||
* To create an application.
|
||||
*
|
||||
* @param application Application that need to be created.
|
||||
* @param application ApplicationEntity that need to be created.
|
||||
* @return Created Application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
int createApplication(Application application, int tenantId) throws ApplicationManagementDAOException;
|
||||
int createApplication(ApplicationEntity application, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To add tags for a particular application.
|
||||
*
|
||||
* @param tags tags that need to be added for a application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
void addTags(List<String> tags, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
List<Tag> getAllTags(int tenantId) throws ApplicationManagementDAOException;
|
||||
List<TagEntity> getAllTags(int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
List<Integer> getTagIdsForTagNames (List<String> tagNames, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
void addTagMapping (List<Integer> tagIds, int applicationId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
|
||||
List<Category> getAllCategories(int tenantId) throws ApplicationManagementDAOException;
|
||||
List<CategoryEntity> getAllCategories(int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
void addCategories(List<String> categories, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
void addCategoryMapping (List<Integer> categoryIds, int applicationId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* To check application existence.
|
||||
*
|
||||
* @param appName appName that need to identify application.
|
||||
* @param type type that need to identify application.
|
||||
* @param tenantId tenantId that need to identify application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
boolean isExistApplication(String appName, String type, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -78,8 +77,8 @@ public interface ApplicationDAO {
|
||||
*
|
||||
* @param filter Filter criteria.
|
||||
* @param tenantId Id of the tenant.
|
||||
* @return Application list
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @return ApplicationEntity list
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
ApplicationList getApplications(Filter filter, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -87,7 +86,7 @@ public interface ApplicationDAO {
|
||||
* To get the UUID of latest app release that satisfy the given criteria.
|
||||
*
|
||||
* @param appId application id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
String getUuidOfLatestRelease(int appId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -98,9 +97,9 @@ public interface ApplicationDAO {
|
||||
* @param tenantId ID of the tenant.
|
||||
* @param appType Type of the application.
|
||||
* @return the application
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Application getApplication(String appName, String appType, int tenantId) throws ApplicationManagementDAOException;
|
||||
ApplicationEntity getApplication(String appName, String appType, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the application with the given id
|
||||
@ -108,9 +107,9 @@ public interface ApplicationDAO {
|
||||
* @param id ID of the application.
|
||||
* @param tenantId ID of the tenant.
|
||||
* @return the application
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Application getApplicationById(String id, int tenantId) throws
|
||||
ApplicationEntity getApplicationById(String id, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
@ -119,9 +118,9 @@ public interface ApplicationDAO {
|
||||
* @param applicationId Id of the application to be retrieved.
|
||||
* @param tenantId ID of the tenant.
|
||||
* @return the application
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Application getApplicationById(int applicationId, int tenantId) throws ApplicationManagementDAOException;
|
||||
ApplicationEntity getApplicationById(int applicationId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the application with the given uuid
|
||||
@ -129,9 +128,9 @@ public interface ApplicationDAO {
|
||||
* @param releaseUuid UUID of the application release.
|
||||
* @param tenantId ID of the tenant.
|
||||
* @return the application
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Application getApplicationByUUID(String releaseUuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
ApplicationEntity getApplicationByUUID(String releaseUuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the application with the given uuid
|
||||
@ -139,7 +138,7 @@ public interface ApplicationDAO {
|
||||
* @param appId ID of the application
|
||||
* @param tenantId Tenant Id
|
||||
* @return the boolean value
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
boolean verifyApplicationExistenceById(int appId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -149,36 +148,36 @@ public interface ApplicationDAO {
|
||||
* @param appName name of the application.
|
||||
* @param appType type of the application.
|
||||
* @param tenantId ID of the tenant.
|
||||
* @return ID of the Application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @return ID of the ApplicationEntity.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
int getApplicationId(String appName, String appType, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To edit the given application.
|
||||
*
|
||||
* @param application Application that need to be edited.
|
||||
* @param tenantId Tenant ID of the Application.
|
||||
* @return Updated Application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @param application ApplicationEntity that need to be edited.
|
||||
* @param tenantId Tenant ID of the ApplicationEntity.
|
||||
* @return Updated ApplicationEntity.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Application editApplication(Application application, int tenantId) throws ApplicationManagementDAOException;
|
||||
ApplicationEntity editApplication(ApplicationEntity application, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To delete the application
|
||||
*
|
||||
* @param appId ID of the application.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
void deleteApplication(int appId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the application count that satisfies gives search query.
|
||||
*
|
||||
* @param filter Application Filter.
|
||||
* @param filter ApplicationEntity Filter.
|
||||
* @param tenantId Id of the tenant
|
||||
* @return count of the applications
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
int getApplicationCount(Filter filter, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -188,18 +187,18 @@ public interface ApplicationDAO {
|
||||
* @param tags Tags which are going to delete.
|
||||
* @param applicationId ID of the application to delete the tags.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
void deleteTags(List<String> tags, int applicationId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get an {@link Application} associated with the given release
|
||||
* To get an {@link ApplicationEntity} associated with the given release
|
||||
*
|
||||
* @param appReleaseUUID UUID of the {@link ApplicationRelease}
|
||||
* @param appReleaseUUID UUID of the {@link ApplicationReleaseEntity}
|
||||
* @param tenantId ID of the tenant
|
||||
* @return {@link Application} associated with the given release UUID
|
||||
* @throws ApplicationManagementDAOException if unable to fetch the Application from the data store.
|
||||
* @return {@link ApplicationEntity} associated with the given release UUID
|
||||
* @throws ApplicationManagementDAOException if unable to fetch the ApplicationEntity from the data store.
|
||||
*/
|
||||
Application getApplicationByRelease(String appReleaseUUID, int tenantId) throws ApplicationManagementDAOException;
|
||||
ApplicationEntity getApplicationByRelease(String appReleaseUUID, int tenantId) throws ApplicationManagementDAOException;
|
||||
}
|
||||
|
||||
|
||||
@ -18,25 +18,26 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationReleaseArtifactPaths;
|
||||
import org.wso2.carbon.device.application.mgt.common.Rating;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is responsible for Application Release related DAO operations.
|
||||
* This is responsible for ApplicationEntity Release related DAO operations.
|
||||
*/
|
||||
public interface ApplicationReleaseDAO {
|
||||
|
||||
/**
|
||||
* To create an Application release.
|
||||
* To create an ApplicationEntity release.
|
||||
*
|
||||
* @param applicationRelease Application Release that need to be created.
|
||||
* @param applicationRelease ApplicationEntity Release that need to be created.
|
||||
* @return Unique ID of the relevant release.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
ApplicationRelease createRelease(ApplicationRelease applicationRelease, int appId, int tenantId) throws
|
||||
ApplicationReleaseEntity createRelease(ApplicationReleaseEntity applicationRelease, int appId, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
@ -47,54 +48,54 @@ public interface ApplicationReleaseDAO {
|
||||
* @param releaseType type of the release
|
||||
* @param tenantId tenantId of the application
|
||||
|
||||
* @return ApplicationRelease for the particular version of the given application
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @return ApplicationReleaseEntity for the particular version of the given application
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
ApplicationRelease getRelease(String applicationName,String applicationType, String versionName,
|
||||
ApplicationReleaseEntity getRelease(String applicationName,String applicationType, String versionName,
|
||||
String releaseType, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get all the releases of a particular application.
|
||||
*
|
||||
* @param applicationId Id of the Application
|
||||
* @param applicationId Id of the ApplicationEntity
|
||||
* @param tenantId tenant id of the application
|
||||
* @return list of the application releases
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
List<ApplicationRelease> getReleases(int applicationId, int tenantId) throws
|
||||
List<ApplicationReleaseEntity> getReleases(int applicationId, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the release by state.
|
||||
*
|
||||
* @param appId Id of the Application
|
||||
* @param appId Id of the ApplicationEntity
|
||||
* @param tenantId tenant id of the application
|
||||
* @param state state of the application
|
||||
* @return list of the application releases
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
List<ApplicationRelease> getReleaseByState(int appId, int tenantId, String state)
|
||||
List<ApplicationReleaseEntity> getReleaseByState(int appId, int tenantId, String state)
|
||||
throws ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To update an Application release.
|
||||
* To update an ApplicationEntity release.
|
||||
*
|
||||
* @param applicationRelease ApplicationRelease that need to be updated.
|
||||
* @param applicationRelease ApplicationReleaseEntity that need to be updated.
|
||||
* @param applicationId Id of the application.
|
||||
* @param tenantId Id of the tenant
|
||||
* @return the updated Application Release
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception
|
||||
* @return the updated ApplicationEntity Release
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception
|
||||
*/
|
||||
ApplicationRelease updateRelease(int applicationId, ApplicationRelease applicationRelease, int tenantId) throws
|
||||
ApplicationReleaseEntity updateRelease(int applicationId, ApplicationReleaseEntity applicationRelease, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
* To update an Application release.
|
||||
* @param uuid UUID of the ApplicationRelease that need to be updated.
|
||||
* To update an ApplicationEntity release.
|
||||
* @param uuid UUID of the ApplicationReleaseEntity that need to be updated.
|
||||
* @param rating given stars for the application.
|
||||
* @param ratedUsers number of users who has rated for the application release.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception
|
||||
*/
|
||||
void updateRatingValue(String uuid, double rating, int ratedUsers) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -103,7 +104,7 @@ public interface ApplicationReleaseDAO {
|
||||
*
|
||||
* @param uuid UUID of the application Release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
Rating getRating(String uuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -111,9 +112,9 @@ public interface ApplicationReleaseDAO {
|
||||
/**
|
||||
* To delete a particular release.
|
||||
*
|
||||
* @param id ID of the Application which the release need to be deleted.
|
||||
* @param version Version of the Application Release
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @param id ID of the ApplicationEntity which the release need to be deleted.
|
||||
* @param version Version of the ApplicationEntity Release
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
void deleteRelease(int id, String version) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -123,9 +124,9 @@ public interface ApplicationReleaseDAO {
|
||||
* @param applicationId ID of the application.
|
||||
* @param releaseUuid UUID of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
ApplicationRelease getReleaseByIds(int applicationId, String releaseUuid, int tenantId) throws
|
||||
ApplicationReleaseEntity getReleaseByIds(int applicationId, String releaseUuid, int tenantId) throws
|
||||
ApplicationManagementDAOException;
|
||||
|
||||
/**
|
||||
@ -134,7 +135,7 @@ public interface ApplicationReleaseDAO {
|
||||
* @param appId ID of the application.
|
||||
* @param uuid UUID of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
boolean verifyReleaseExistence(int appId, String uuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -144,7 +145,7 @@ public interface ApplicationReleaseDAO {
|
||||
* @param appId ID of the application.
|
||||
* @param hashVal Hash value of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
boolean verifyReleaseExistenceByHash(int appId, String hashVal, int tenantId)
|
||||
throws ApplicationManagementDAOException;
|
||||
@ -154,7 +155,7 @@ public interface ApplicationReleaseDAO {
|
||||
*
|
||||
* @param appId ID of the application.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
String getPackageName(int appId, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
@ -163,8 +164,10 @@ public interface ApplicationReleaseDAO {
|
||||
*
|
||||
* @param uuid UUID of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
boolean verifyReleaseExistenceByUuid(String uuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
ApplicationReleaseArtifactPaths getReleaseArtifactPaths(String uuid, int tenantId) throws ApplicationManagementDAOException;
|
||||
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.LifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.LifecycleStateEntity;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.LifeCycleManagementDAOException;
|
||||
|
||||
import java.util.List;
|
||||
@ -35,7 +35,7 @@ public interface LifecycleStateDAO {
|
||||
* @return Latest Lifecycle State for the given application release
|
||||
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
|
||||
*/
|
||||
LifecycleState getLatestLifeCycleStateByReleaseID(int applicationReleaseId) throws LifeCycleManagementDAOException;
|
||||
LifecycleStateEntity getLatestLifeCycleStateByReleaseID(int applicationReleaseId) throws LifeCycleManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get the latest lifecycle state for the given application id and the application release UUID.
|
||||
@ -45,7 +45,7 @@ public interface LifecycleStateDAO {
|
||||
* @return Latest Lifecycle State for the given application release
|
||||
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
|
||||
*/
|
||||
LifecycleState getLatestLifeCycleState(int appId, String uuid) throws LifeCycleManagementDAOException;
|
||||
LifecycleStateEntity getLatestLifeCycleState(int appId, String uuid) throws LifeCycleManagementDAOException;
|
||||
|
||||
/**
|
||||
* To get all changed lifecycle states for the given application release id.
|
||||
@ -54,23 +54,23 @@ public interface LifecycleStateDAO {
|
||||
* @return Lifecycle States for the given application release
|
||||
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
|
||||
*/
|
||||
List<LifecycleState> getLifecycleStates(int appReleaseId) throws LifeCycleManagementDAOException;
|
||||
List<LifecycleStateEntity> getLifecycleStates(int appReleaseId) throws LifeCycleManagementDAOException;
|
||||
|
||||
/**
|
||||
* To add new lifecycle states for the given application release.
|
||||
* @param uuid Id of the application release.
|
||||
* @param appId Id of the application.
|
||||
* @param state LifecycleState.
|
||||
* @param state LifecycleStateEntity.
|
||||
* @param tenantId Tenant id
|
||||
*
|
||||
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
|
||||
*/
|
||||
void addLifecycleState(LifecycleState state, int appId, String uuid, int tenantId)
|
||||
void addLifecycleState(LifecycleStateEntity state, int appId, String uuid, int tenantId)
|
||||
throws LifeCycleManagementDAOException;
|
||||
|
||||
/**
|
||||
* To delete a specific lifecycle state for application release.
|
||||
* @param identifier Id of the LifecycleState.
|
||||
* @param identifier Id of the LifecycleStateEntity.
|
||||
*
|
||||
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
|
||||
*/
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
*/
|
||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
||||
import org.wso2.carbon.device.mgt.common.Device;
|
||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
||||
@ -37,8 +38,8 @@ public interface SubscriptionDAO {
|
||||
* @param tenantId id of the tenant
|
||||
* @param subscribedBy username of the user who subscribe the application
|
||||
* @param deviceList List of {@link Device} which the application is installed on
|
||||
* @param appId id of the {@link Application} which installs
|
||||
* @param releaseId id of the {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease}
|
||||
* @param appId id of the {@link ApplicationEntity} which installs
|
||||
* @param releaseId id of the {@link ApplicationReleaseEntity}
|
||||
* @throws ApplicationManagementDAOException If unable to add a mapping between device and application
|
||||
*/
|
||||
void subscribeDeviceToApplication(int tenantId, String subscribedBy, List<Device> deviceList, int appId,
|
||||
@ -51,8 +52,8 @@ public interface SubscriptionDAO {
|
||||
* @param tenantId id of the tenant
|
||||
* @param subscribedBy username of the user who subscribe the application
|
||||
* @param userList list of user names of the users whose devices are subscribed to the application
|
||||
* @param appId id of the {@link Application} which installs
|
||||
* @param releaseId id of the {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease}
|
||||
* @param appId id of the {@link ApplicationEntity} which installs
|
||||
* @param releaseId id of the {@link ApplicationReleaseEntity}
|
||||
* @throws ApplicationManagementDAOException If unable to add a mapping between device and application
|
||||
*/
|
||||
void subscribeUserToApplication(int tenantId, String subscribedBy, List<String> userList, int appId, int releaseId)
|
||||
@ -65,8 +66,8 @@ public interface SubscriptionDAO {
|
||||
* @param tenantId id of the tenant
|
||||
* @param subscribedBy username of the user who subscribe the application
|
||||
* @param roleList list of roles which belongs devices are subscribed to the application
|
||||
* @param appId id of the {@link Application} which installs
|
||||
* @param releaseId id of the {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease}
|
||||
* @param appId id of the {@link ApplicationEntity} which installs
|
||||
* @param releaseId id of the {@link ApplicationReleaseEntity}
|
||||
* @throws ApplicationManagementDAOException If unable to add a mapping between device and application
|
||||
*/
|
||||
void subscribeRoleToApplication(int tenantId, String subscribedBy, List<String> roleList, int appId, int releaseId)
|
||||
@ -79,8 +80,8 @@ public interface SubscriptionDAO {
|
||||
* @param tenantId id of the tenant
|
||||
* @param subscribedBy username of the user who subscribe the application
|
||||
* @param groupList list of {@link DeviceGroup} which belongs the devices that are subscribed to the application
|
||||
* @param appId id of the {@link Application} which installs
|
||||
* @param releaseId id of the {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease}
|
||||
* @param appId id of the {@link ApplicationEntity} which installs
|
||||
* @param releaseId id of the {@link ApplicationReleaseEntity}
|
||||
* @throws ApplicationManagementDAOException If unable to add a mapping between device and application
|
||||
*/
|
||||
void subscribeGroupToApplication(int tenantId, String subscribedBy, List<DeviceGroup> groupList, int appId,
|
||||
|
||||
@ -22,17 +22,16 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONException;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.*;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.PaginationRequest;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
|
||||
import org.wso2.carbon.device.application.mgt.core.config.Configuration;
|
||||
import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager;
|
||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
@ -56,10 +55,10 @@ public class Util {
|
||||
// * @throws SQLException SQL Exception
|
||||
// * @throws JSONException JSONException.
|
||||
// */
|
||||
// public static List<Application> loadApplications(ResultSet rs) throws SQLException, JSONException {
|
||||
// public static List<ApplicationEntity> loadApplications(ResultSet rs) throws SQLException, JSONException {
|
||||
//
|
||||
// List<Application> applications = new ArrayList<>();
|
||||
// Application application = null;
|
||||
// List<ApplicationEntity> applications = new ArrayList<>();
|
||||
// ApplicationEntity application = null;
|
||||
// int applicationId = -1;
|
||||
// boolean hasNext = rs.next();
|
||||
//
|
||||
@ -69,7 +68,7 @@ public class Util {
|
||||
// applications.add(application);
|
||||
// }
|
||||
// applicationId = rs.getInt("APP_ID");
|
||||
// application = new Application();
|
||||
// application = new ApplicationEntity();
|
||||
// application.setTags(new ArrayList<>());
|
||||
// application.setUnrestrictedRoles(new ArrayList<>());
|
||||
// application.setId(applicationId);
|
||||
@ -116,10 +115,10 @@ public class Util {
|
||||
* @throws SQLException SQL Exception
|
||||
* @throws JSONException JSONException.
|
||||
*/
|
||||
public static List<Application> loadApplications(ResultSet rs) throws SQLException, JSONException {
|
||||
public static List<ApplicationEntity> loadApplications(ResultSet rs) throws SQLException, JSONException {
|
||||
|
||||
List<Application> applications = new ArrayList<>();
|
||||
Application application = null;
|
||||
List<ApplicationEntity> applications = new ArrayList<>();
|
||||
ApplicationEntity application = null;
|
||||
int applicationId = -1;
|
||||
boolean hasNext = rs.next();
|
||||
|
||||
@ -128,7 +127,7 @@ public class Util {
|
||||
if (application != null) {
|
||||
applications.add(application);
|
||||
}
|
||||
application = new Application();
|
||||
application = new ApplicationEntity();
|
||||
application.setApplicationReleases(new ArrayList<>());
|
||||
applicationId = rs.getInt("APP_ID");
|
||||
application.setId(applicationId);
|
||||
@ -139,19 +138,18 @@ public class Util {
|
||||
application.setPaymentCurrency(rs.getString("APP_CURRENCY"));
|
||||
application.setStatus(rs.getString("APP_STATUS"));
|
||||
application.setAppRating(rs.getInt("APP_RATING)"));
|
||||
DeviceType deviceType = new DeviceType();
|
||||
application.setDeviceTypeObj(deviceType);
|
||||
application.setDeviceTypeId(rs.getInt("APP_DEVICE_TYPE_ID"));
|
||||
} else {
|
||||
ApplicationRelease appRelease = new ApplicationRelease();
|
||||
ApplicationReleaseEntity appRelease = new ApplicationReleaseEntity();
|
||||
appRelease.setDescription(rs.getString("RELEASE_DESCRIPTION"));
|
||||
appRelease.setUuid(rs.getString("RELEASE_UUID"));
|
||||
appRelease.setReleaseType(rs.getString("RELEASE_TYPE"));
|
||||
appRelease.setVersion(rs.getString("RELEASE_VERSION"));
|
||||
appRelease.setAppStoredLoc(rs.getString("AP_RELEASE_STORED_LOC"));
|
||||
appRelease.setBannerLoc(rs.getString("RELEASE_BANNER_LOC"));
|
||||
appRelease.setScreenshotLoc1("RELEASE_SC1");
|
||||
appRelease.setScreenshotLoc2("RELEASE_SC2");
|
||||
appRelease.setScreenshotLoc3("RELEASE_SC3");
|
||||
appRelease.setInstallerName(rs.getString("AP_RELEASE_STORED_LOC"));
|
||||
appRelease.setBannerName(rs.getString("RELEASE_BANNER_LOC"));
|
||||
appRelease.setScreenshotName1("RELEASE_SC1");
|
||||
appRelease.setScreenshotName2("RELEASE_SC2");
|
||||
appRelease.setScreenshotName3("RELEASE_SC3");
|
||||
appRelease.setPrice(rs.getDouble(" RELEASE_PRICE"));
|
||||
appRelease.setMetaData(rs.getString("RELEASE.META_INFO"));
|
||||
appRelease.setSupportedOsVersions(rs.getString("RELEASE_SUP_OS_VERSIONS"));
|
||||
@ -175,19 +173,19 @@ public class Util {
|
||||
* To create application object from the result set retrieved from the Database.
|
||||
*
|
||||
* @param rs ResultSet
|
||||
* @return Application that is retrieved from the Database.
|
||||
* @return ApplicationEntity that is retrieved from the Database.
|
||||
* @throws SQLException SQL Exception
|
||||
* @throws JSONException JSONException.
|
||||
*/
|
||||
public static Application loadApplication(ResultSet rs) throws SQLException, JSONException {
|
||||
public static ApplicationEntity loadApplication(ResultSet rs) throws SQLException, JSONException {
|
||||
|
||||
Application application = null;
|
||||
ApplicationEntity application = null;
|
||||
int applicatioId;
|
||||
int iteration = 0;
|
||||
if (rs != null) {
|
||||
while (rs.next()) {
|
||||
if (iteration == 0) {
|
||||
application = new Application();
|
||||
application = new ApplicationEntity();
|
||||
application.setTags(new ArrayList<>());
|
||||
application.setUnrestrictedRoles(new ArrayList<>());
|
||||
applicatioId = rs.getInt("APP_ID");
|
||||
@ -197,7 +195,7 @@ public class Util {
|
||||
application.setAppCategory(rs.getString("APP_CATEGORY"));
|
||||
application.setSubType(rs.getString("SUB_TYPE"));
|
||||
application.setPaymentCurrency(rs.getString("CURRENCY"));
|
||||
application.setIsRestricted(rs.getBoolean("RESTRICTED"));
|
||||
// application.setIsRestricted(rs.getBoolean("RESTRICTED"));
|
||||
application.setDeviceTypeId(rs.getInt("DEVICE_TYPE_ID"));
|
||||
}
|
||||
|
||||
@ -217,26 +215,26 @@ public class Util {
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates {@link ApplicationRelease} object with the result obtained from the database.
|
||||
* Populates {@link ApplicationReleaseEntity} object with the result obtained from the database.
|
||||
*
|
||||
* @param resultSet {@link ResultSet} from obtained from the database
|
||||
* @return {@link ApplicationRelease} object populated with the data
|
||||
* @throws SQLException If unable to populate {@link ApplicationRelease} object with the data
|
||||
* @return {@link ApplicationReleaseEntity} object populated with the data
|
||||
* @throws SQLException If unable to populate {@link ApplicationReleaseEntity} object with the data
|
||||
*/
|
||||
public static ApplicationRelease loadApplicationRelease(ResultSet resultSet) throws SQLException {
|
||||
ApplicationRelease applicationRelease = new ApplicationRelease();
|
||||
public static ApplicationReleaseEntity loadApplicationRelease(ResultSet resultSet) throws SQLException {
|
||||
ApplicationReleaseEntity applicationRelease = new ApplicationReleaseEntity();
|
||||
applicationRelease.setId(resultSet.getInt("RELEASE_ID"));
|
||||
applicationRelease.setVersion(resultSet.getString("RELEASE_VERSION"));
|
||||
applicationRelease.setUuid(resultSet.getString("UUID"));
|
||||
applicationRelease.setReleaseType(resultSet.getString("RELEASE_TYPE"));
|
||||
applicationRelease.setPackageName(resultSet.getString("PACKAGE_NAME"));
|
||||
applicationRelease.setPrice(resultSet.getDouble("APP_PRICE"));
|
||||
applicationRelease.setAppStoredLoc(resultSet.getString("STORED_LOCATION"));
|
||||
applicationRelease.setBannerLoc(resultSet.getString("BANNER_LOCATION"));
|
||||
applicationRelease.setIconLoc(resultSet.getString("ICON_LOCATION"));
|
||||
applicationRelease.setScreenshotLoc1(resultSet.getString("SCREEN_SHOT_1"));
|
||||
applicationRelease.setScreenshotLoc2(resultSet.getString("SCREEN_SHOT_2"));
|
||||
applicationRelease.setScreenshotLoc3(resultSet.getString("SCREEN_SHOT_3"));
|
||||
applicationRelease.setInstallerName(resultSet.getString("STORED_LOCATION"));
|
||||
applicationRelease.setBannerName(resultSet.getString("BANNER_LOCATION"));
|
||||
applicationRelease.setIconName(resultSet.getString("ICON_LOCATION"));
|
||||
applicationRelease.setScreenshotName1(resultSet.getString("SCREEN_SHOT_1"));
|
||||
applicationRelease.setScreenshotName2(resultSet.getString("SCREEN_SHOT_2"));
|
||||
applicationRelease.setScreenshotName3(resultSet.getString("SCREEN_SHOT_3"));
|
||||
applicationRelease.setAppHashValue(resultSet.getString("HASH_VALUE"));
|
||||
applicationRelease.setIsSharedWithAllTenants(resultSet.getBoolean("SHARED"));
|
||||
applicationRelease.setMetaData(resultSet.getString("APP_META_INFO"));
|
||||
@ -276,7 +274,7 @@ public class Util {
|
||||
commentManagementConfig.getPaginationConfiguration().getCommentListPageSize());
|
||||
} else {
|
||||
throw new ReviewManagementException(
|
||||
"Application Management configuration has not initialized. Please check the application-mgt.xml file.");
|
||||
"ApplicationEntity Management configuration has not initialized. Please check the application-mgt.xml file.");
|
||||
}
|
||||
}
|
||||
return paginationRequest;
|
||||
@ -294,7 +292,7 @@ public class Util {
|
||||
applicationManager =
|
||||
(ApplicationManager) ctx.getOSGiService(ApplicationManager.class, null);
|
||||
if (applicationManager == null) {
|
||||
String msg = "Application Manager service has not initialized.";
|
||||
String msg = "ApplicationEntity Manager service has not initialized.";
|
||||
log.error(msg);
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
@ -305,7 +303,7 @@ public class Util {
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the Application Storage Manager from the osgi context.
|
||||
* To get the ApplicationEntity Storage Manager from the osgi context.
|
||||
* @return ApplicationStoreManager instance in the current osgi context.
|
||||
*/
|
||||
public static ApplicationStorageManager getApplicationStorageManager() {
|
||||
@ -316,7 +314,7 @@ public class Util {
|
||||
applicationStorageManager = (ApplicationStorageManager) ctx
|
||||
.getOSGiService(ApplicationStorageManager.class, null);
|
||||
if (applicationStorageManager == null) {
|
||||
String msg = "Application Storage Manager service has not initialized.";
|
||||
String msg = "ApplicationEntity Storage Manager service has not initialized.";
|
||||
log.error(msg);
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class ReviewDAOImpl extends AbstractDAOImpl implements ReviewDAO {
|
||||
@Override
|
||||
public boolean addReview(Review review, String uuid, int tenantId) throws ReviewManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Request received in DAO Layer to add review for application release. Application UUID: " + uuid);
|
||||
log.debug("Request received in DAO Layer to add review for application release. ApplicationEntity UUID: " + uuid);
|
||||
}
|
||||
PreparedStatement statement = null;
|
||||
ResultSet rs = null;
|
||||
@ -93,7 +93,7 @@ public class ReviewDAOImpl extends AbstractDAOImpl implements ReviewDAO {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug(
|
||||
"Request received in DAO Layer to check whether user have already commented or not for the "
|
||||
+ "application release. Application UUID: " + uuid + " comment owner: " + username +
|
||||
+ "application release. ApplicationEntity UUID: " + uuid + " comment owner: " + username +
|
||||
" tenant-id " + tenantId);
|
||||
}
|
||||
Connection conn;
|
||||
|
||||
@ -22,13 +22,13 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONException;
|
||||
import org.wso2.carbon.device.application.mgt.common.AppLifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.Category;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.CategoryEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.Filter;
|
||||
import org.wso2.carbon.device.application.mgt.common.Pagination;
|
||||
import org.wso2.carbon.device.application.mgt.common.Tag;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.TagEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.common.Util;
|
||||
@ -52,12 +52,12 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
private static final Log log = LogFactory.getLog(GenericApplicationDAOImpl.class);
|
||||
|
||||
@Override
|
||||
public int createApplication(Application application, int tenantId) throws ApplicationManagementDAOException {
|
||||
public int createApplication(ApplicationEntity application, int tenantId) throws ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Request received in DAO Layer to create an application");
|
||||
log.debug("Application Details : ");
|
||||
log.debug("App Name : " + application.getName() + " App Type : "
|
||||
+ application.getType() + " User Name : " + application.getUser().getUserName());
|
||||
log.debug("ApplicationEntity Details : ");
|
||||
// log.debug("App Name : " + application.getName() + " App Type : "
|
||||
// + application.getType() + " User Name : " + application.getUser().getUserName());
|
||||
}
|
||||
Connection conn;
|
||||
PreparedStatement stmt = null;
|
||||
@ -71,13 +71,13 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
+ "TYPE, "
|
||||
+ "SUB_TYPE, "
|
||||
+ "TENANT_ID, "
|
||||
+ "DEVICE_TYPE_ID) VALUES (?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
|
||||
+ "DEVICE_TYPE_ID) VALUES (?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
|
||||
stmt.setString(1, application.getName());
|
||||
stmt.setString(2, application.getDescription());
|
||||
stmt.setString(3, application.getType());
|
||||
stmt.setString(4, application.getSubType());
|
||||
stmt.setInt(5, tenantId);
|
||||
stmt.setInt(6, application.getDeviceTypeObj().getId());
|
||||
// stmt.setInt(6, application.getDeviceTypeObj().getId());
|
||||
stmt.executeUpdate();
|
||||
|
||||
rs = stmt.getGeneratedKeys();
|
||||
@ -171,7 +171,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
// sql += "LIKE ?";
|
||||
// }
|
||||
// }
|
||||
// if (filter.getDeviceType() != null ) {
|
||||
// if (filter.getDeviceTypeName() != null ) {
|
||||
// sql += " AND AP_APP.DEVICE_TYPE_ID ";
|
||||
// sql += "= ?";
|
||||
// }
|
||||
@ -203,8 +203,8 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
// stmt.setString(paramIndex++, "%" + filter.getAppName().toLowerCase() + "%");
|
||||
// }
|
||||
// }
|
||||
// if (filter.getDeviceType() != null ) {
|
||||
// stmt.setInt(paramIndex++, filter.getDeviceType().getId());
|
||||
// if (filter.getDeviceTypeName() != null ) {
|
||||
// stmt.setInt(paramIndex++, filter.getDeviceTypeName().getId());
|
||||
// }
|
||||
//
|
||||
//
|
||||
@ -262,7 +262,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
+ "AP_APP_RELEASE.VERSION AS RELEASE_VERSION, "
|
||||
+ "AP_APP_RELEASE.UUID AS RELEASE_UUID, "
|
||||
+ "AP_APP_RELEASE.RELEASE_TYPE AS RELEASE_TYPE, "
|
||||
+ "AP_APP_RELEASE.STORED_LOCATION AS AP_RELEASE_STORED_LOC, "
|
||||
+ "AP_APP_RELEASE.INSTALLER_LOCATION AS AP_RELEASE_STORED_LOC, "
|
||||
+ "AP_APP_RELEASE.BANNER_LOCATION AS AP_RELEASE_BANNER_LOC, "
|
||||
+ "AP_APP_RELEASE.SC_1_LOCATION AS AP_RELEASE_SC1, "
|
||||
+ "AP_APP_RELEASE.SC_2_LOCATION AS AP_RELEASE_SC2, "
|
||||
@ -298,7 +298,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
sql += "LIKE ?";
|
||||
}
|
||||
}
|
||||
if (filter.getDeviceType() != null ) {
|
||||
if (filter.getDeviceTypeId() > 0 ) {
|
||||
sql += " AND AP_APP.DEVICE_TYPE_ID ";
|
||||
sql += "= ?";
|
||||
}
|
||||
@ -330,8 +330,8 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
stmt.setString(paramIndex++, "%" + filter.getAppName().toLowerCase() + "%");
|
||||
}
|
||||
}
|
||||
if (filter.getDeviceType() != null ) {
|
||||
stmt.setInt(paramIndex++, filter.getDeviceType().getId());
|
||||
if (filter.getDeviceTypeId() > 0 ) {
|
||||
stmt.setInt(paramIndex++, filter.getDeviceTypeId());
|
||||
}
|
||||
|
||||
|
||||
@ -443,7 +443,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplication(String appName, String appType, int tenantId) throws
|
||||
public ApplicationEntity getApplication(String appName, String appType, int tenantId) throws
|
||||
ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application with the type(" + appType + " and Name " + appName +
|
||||
@ -488,7 +488,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplicationById(String id, int tenantId) throws
|
||||
public ApplicationEntity getApplicationById(String id, int tenantId) throws
|
||||
ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application with the id:" + id);
|
||||
@ -530,7 +530,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplicationByUUID(String releaseUuid, int tenantId) throws
|
||||
public ApplicationEntity getApplicationByUUID(String releaseUuid, int tenantId) throws
|
||||
ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application with the release UUID: " + releaseUuid + " from the database");
|
||||
@ -577,7 +577,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplicationById(int applicationId, int tenantId) throws
|
||||
public ApplicationEntity getApplicationById(int applicationId, int tenantId) throws
|
||||
ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application with the id (" + applicationId + ") from the database");
|
||||
@ -656,11 +656,11 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application editApplication(Application application, int tenantId) throws ApplicationManagementDAOException {
|
||||
public ApplicationEntity editApplication(ApplicationEntity application, int tenantId) throws ApplicationManagementDAOException {
|
||||
int paramIndex = 1;
|
||||
Connection conn;
|
||||
PreparedStatement stmt = null;
|
||||
Application existingApplication = this.getApplicationById(application.getId(), tenantId);
|
||||
ApplicationEntity existingApplication = this.getApplicationById(application.getId(), tenantId);
|
||||
|
||||
if (existingApplication == null) {
|
||||
throw new ApplicationManagementDAOException("There doesn't have an application for updating");
|
||||
@ -679,9 +679,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
existingApplication.getAppCategory())) {
|
||||
sql += "APP_CATEGORY = ?, ";
|
||||
}
|
||||
if (application.getIsRestricted() != existingApplication.getIsRestricted()) {
|
||||
sql += "RESTRICTED = ? ";
|
||||
}
|
||||
// if (application.getIsRestricted() != existingApplication.getIsRestricted()) {
|
||||
// sql += "RESTRICTED = ? ";
|
||||
// }
|
||||
if (!application.getSubType().equals(existingApplication.getSubType())) {
|
||||
sql += "SUB_TYPE = ? ";
|
||||
}
|
||||
@ -699,9 +699,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
existingApplication.getAppCategory())) {
|
||||
stmt.setString(paramIndex++, application.getAppCategory());
|
||||
}
|
||||
if (application.getIsRestricted() != existingApplication.getIsRestricted()) {
|
||||
stmt.setBoolean(paramIndex++, application.getIsRestricted());
|
||||
}
|
||||
// if (application.getIsRestricted() != existingApplication.getIsRestricted()) {
|
||||
// stmt.setBoolean(paramIndex++, application.getIsRestricted());
|
||||
// }
|
||||
if (!application.getSubType().equals(existingApplication.getSubType())) {
|
||||
stmt.setString(paramIndex++, application.getSubType());
|
||||
}
|
||||
@ -770,7 +770,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tag> getAllTags(int tenantId) throws ApplicationManagementDAOException {
|
||||
public List<TagEntity> getAllTags(int tenantId) throws ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Request received in DAO Layer to get all tags");
|
||||
}
|
||||
@ -778,7 +778,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
List<Tag> tags = new ArrayList<>();
|
||||
List<TagEntity> tagEntities = new ArrayList<>();
|
||||
String sql = "SELECT "
|
||||
+ "AP_APP_TAG.ID AS ID, "
|
||||
+ "AP_APP_TAG.TAG AS TAG "
|
||||
@ -790,12 +790,12 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while(rs.next()){
|
||||
Tag tag = new Tag();
|
||||
tag.setId(rs.getInt("ID"));
|
||||
tag.setTagName(rs.getString("TAG"));
|
||||
tags.add(tag);
|
||||
TagEntity tagEntity = new TagEntity();
|
||||
tagEntity.setId(rs.getInt("ID"));
|
||||
tagEntity.setTagName(rs.getString("TAG"));
|
||||
tagEntities.add(tagEntity);
|
||||
}
|
||||
return tags;
|
||||
return tagEntities;
|
||||
} catch (DBConnectionException e) {
|
||||
throw new ApplicationManagementDAOException(
|
||||
"Error occurred while obtaining the DB connection when adding tags", e);
|
||||
@ -807,7 +807,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Category> getAllCategories(int tenantId) throws ApplicationManagementDAOException {
|
||||
public List<CategoryEntity> getAllCategories(int tenantId) throws ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Request received in DAO Layer to get all tags");
|
||||
}
|
||||
@ -815,7 +815,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
List<Category> categories = new ArrayList<>();
|
||||
List<CategoryEntity> categories = new ArrayList<>();
|
||||
String sql = "SELECT "
|
||||
+ "AP_APP_CATEGORY.ID AS ID, "
|
||||
+ "AP_APP_CATEGORY.CATEGORY AS CATEGORY "
|
||||
@ -827,7 +827,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while(rs.next()){
|
||||
Category category = new Category();
|
||||
CategoryEntity category = new CategoryEntity();
|
||||
category.setId(rs.getInt("ID"));
|
||||
category.setCategoryName(rs.getString("CATEGORY"));
|
||||
categories.add(category);
|
||||
@ -1004,7 +1004,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplicationByRelease(String appReleaseUUID, int tenantId)
|
||||
public ApplicationEntity getApplicationByRelease(String appReleaseUUID, int tenantId)
|
||||
throws ApplicationManagementDAOException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application with the UUID (" + appReleaseUUID + ") from the database");
|
||||
@ -1035,10 +1035,10 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
log.debug("Successfully retrieved details of the application with the UUID " + appReleaseUUID);
|
||||
}
|
||||
|
||||
Application application = null;
|
||||
ApplicationEntity application = null;
|
||||
while (rs.next()) {
|
||||
ApplicationRelease appRelease = Util.loadApplicationRelease(rs);
|
||||
application = new Application();
|
||||
ApplicationReleaseEntity appRelease = Util.loadApplicationRelease(rs);
|
||||
application = new ApplicationEntity();
|
||||
|
||||
application.setId(rs.getInt("APP_ID"));
|
||||
application.setName(rs.getString("APP_NAME"));
|
||||
@ -1046,7 +1046,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
application.setAppCategory(rs.getString("APP_CATEGORY"));
|
||||
application.setSubType(rs.getString("SUB_TYPE"));
|
||||
application.setPaymentCurrency(rs.getString("CURRENCY"));
|
||||
application.setIsRestricted(rs.getBoolean("RESTRICTED"));
|
||||
// application.setIsRestricted(rs.getBoolean("RESTRICTED"));
|
||||
|
||||
String unrestrictedRole = rs.getString("ROLE").toLowerCase();
|
||||
List<String> unrestrictedRoleList = new ArrayList<>();
|
||||
@ -1054,7 +1054,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
||||
|
||||
application.setUnrestrictedRoles(unrestrictedRoleList);
|
||||
|
||||
List<ApplicationRelease> applicationReleaseList = new ArrayList<>();
|
||||
List<ApplicationReleaseEntity> applicationReleaseList = new ArrayList<>();
|
||||
applicationReleaseList.add(appRelease);
|
||||
|
||||
application.setApplicationReleases(applicationReleaseList);
|
||||
|
||||
@ -21,7 +21,8 @@ package org.wso2.carbon.device.application.mgt.core.dao.impl.application.release
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationReleaseArtifactPaths;
|
||||
import org.wso2.carbon.device.application.mgt.common.Rating;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO;
|
||||
@ -37,21 +38,21 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* GenericApplicationReleaseDAOImpl holds the implementation of ApplicationRelease related DAO operations.
|
||||
* GenericApplicationReleaseDAOImpl holds the implementation of ApplicationReleaseEntity related DAO operations.
|
||||
*/
|
||||
public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements ApplicationReleaseDAO {
|
||||
|
||||
private static final Log log = LogFactory.getLog(GenericApplicationReleaseDAOImpl.class);
|
||||
|
||||
/**
|
||||
* To insert the Application Release Details.
|
||||
* To insert the ApplicationEntity Release Details.
|
||||
*
|
||||
* @param appId Id of the application
|
||||
* @param applicationRelease Application Release the properties of which that need to be inserted.
|
||||
* @param applicationRelease ApplicationEntity Release the properties of which that need to be inserted.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public ApplicationRelease createRelease(ApplicationRelease applicationRelease, int appId, int tenantId)
|
||||
@Override public ApplicationReleaseEntity createRelease(ApplicationReleaseEntity applicationRelease, int appId, int tenantId)
|
||||
throws ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
PreparedStatement statement = null;
|
||||
@ -65,7 +66,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
+ "RELEASE_TYPE,"
|
||||
+ "PACKAGE_NAME,"
|
||||
+ "APP_PRICE, "
|
||||
+ "STORED_LOCATION,"
|
||||
+ "INSTALLER_LOCATION,"
|
||||
+ "ICON_LOCATION,"
|
||||
+ "BANNER_LOCATION,"
|
||||
+ "SC_1_LOCATION,"
|
||||
@ -90,12 +91,12 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
statement.setString(5, String.valueOf(applicationRelease.getReleaseType()));
|
||||
statement.setString(6, String.valueOf(applicationRelease.getPackageName()));
|
||||
statement.setDouble(7, applicationRelease.getPrice());
|
||||
statement.setString(8, applicationRelease.getAppStoredLoc());
|
||||
statement.setString(9, applicationRelease.getIconLoc());
|
||||
statement.setString(10, applicationRelease.getBannerLoc());
|
||||
statement.setString(11, applicationRelease.getScreenshotLoc1());
|
||||
statement.setString(12, applicationRelease.getScreenshotLoc2());
|
||||
statement.setString(13, applicationRelease.getScreenshotLoc3());
|
||||
statement.setString(8, applicationRelease.getInstallerName());
|
||||
statement.setString(9, applicationRelease.getIconName());
|
||||
statement.setString(10, applicationRelease.getBannerName());
|
||||
statement.setString(11, applicationRelease.getScreenshotName1());
|
||||
statement.setString(12, applicationRelease.getScreenshotName2());
|
||||
statement.setString(13, applicationRelease.getScreenshotName3());
|
||||
statement.setString(14, applicationRelease.getAppHashValue());
|
||||
statement.setBoolean(15, applicationRelease.getIsSharedWithAllTenants());
|
||||
statement.setString(16, applicationRelease.getMetaData());
|
||||
@ -127,9 +128,9 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
* @param versionName version name of the application.
|
||||
* @param releaseType type of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public ApplicationRelease getRelease(String applicationName, String applicationType, String versionName,
|
||||
@Override public ApplicationReleaseEntity getRelease(String applicationName, String applicationType, String versionName,
|
||||
String releaseType, int tenantId) throws ApplicationManagementDAOException {
|
||||
//todo no usage
|
||||
Connection connection;
|
||||
@ -177,9 +178,9 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
* @param applicationId ID of the application.
|
||||
* @param releaseUuid UUID of the application release.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public ApplicationRelease getReleaseByIds(int applicationId, String releaseUuid, int tenantId)
|
||||
@Override public ApplicationReleaseEntity getReleaseByIds(int applicationId, String releaseUuid, int tenantId)
|
||||
throws ApplicationManagementDAOException {
|
||||
|
||||
Connection connection;
|
||||
@ -225,14 +226,14 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
*
|
||||
* @param applicationId Id of the application.
|
||||
* @param tenantId Tenant Id
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public List<ApplicationRelease> getReleases(int applicationId, int tenantId)
|
||||
@Override public List<ApplicationReleaseEntity> getReleases(int applicationId, int tenantId)
|
||||
throws ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
PreparedStatement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
List<ApplicationRelease> applicationReleases = new ArrayList<>();
|
||||
List<ApplicationReleaseEntity> applicationReleases = new ArrayList<>();
|
||||
String sql = "SELECT AR.ID AS RELEASE_ID, AR.VERSION AS RELEASE_VERSION, AR.UUID, AR.RELEASE_TYPE "
|
||||
+ "AS RELEASE_TYPE, AR.PACKAGE_NAME AS PACKAGE_NAME, AR.APP_PRICE, AR.STORED_LOCATION, AR.ICON_LOCATION, "
|
||||
+ "AR.BANNER_LOCATION, AR.SC_1_LOCATION AS SCREEN_SHOT_1, AR.SC_2_LOCATION AS SCREEN_SHOT_2, "
|
||||
@ -248,7 +249,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
ApplicationRelease applicationRelease = Util.loadApplicationRelease(resultSet);
|
||||
ApplicationReleaseEntity applicationRelease = Util.loadApplicationRelease(resultSet);
|
||||
applicationReleases.add(applicationRelease);
|
||||
}
|
||||
return applicationReleases;
|
||||
@ -266,12 +267,12 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
|
||||
//todo this has to be removed
|
||||
@Override
|
||||
public List<ApplicationRelease> getReleaseByState(int appId, int tenantId, String state) throws
|
||||
public List<ApplicationReleaseEntity> getReleaseByState(int appId, int tenantId, String state) throws
|
||||
ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
PreparedStatement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
List<ApplicationRelease> applicationReleases = new ArrayList<>();
|
||||
List<ApplicationReleaseEntity> applicationReleases = new ArrayList<>();
|
||||
String sql = "SELECT AR.ID AS RELEASE_ID, AR.VERSION AS RELEASE_VERSION, AR.UUID AS UUID, AR.RELEASE_TYPE AS "
|
||||
+ "RELEASE_TYPE, AR.PACKAGE_NAME AS PACKAGE_NAME, AR.APP_PRICE AS APP_PRICE, AR.STORED_LOCATION AS "
|
||||
+ "STORED_LOCATION, AR.BANNER_LOCATION AS BANNER_LOCATION, ICON_LOCATION, AR.SC_1_LOCATION AS "
|
||||
@ -291,7 +292,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
ApplicationRelease appRelease = Util.loadApplicationRelease(resultSet);
|
||||
ApplicationReleaseEntity appRelease = Util.loadApplicationRelease(resultSet);
|
||||
applicationReleases.add(appRelease);
|
||||
}
|
||||
return applicationReleases;
|
||||
@ -312,7 +313,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
*
|
||||
* @param uuid UUID of the application Release.
|
||||
* @param rating given stars for the application release.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public void updateRatingValue(String uuid, double rating, int ratedUsers)
|
||||
throws ApplicationManagementDAOException {
|
||||
@ -341,7 +342,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
* To retrieve rating of an application release.
|
||||
*
|
||||
* @param uuid UUID of the application Release.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public Rating getRating(String uuid, int tenantId) throws ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
@ -376,11 +377,11 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
/**
|
||||
* To insert the application release properties.
|
||||
*
|
||||
* @param applicationRelease Application Release the properties of which that need to be inserted.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @param applicationRelease ApplicationEntity Release the properties of which that need to be inserted.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override
|
||||
public ApplicationRelease updateRelease(int applicationId, ApplicationRelease applicationRelease, int tenantId)
|
||||
public ApplicationReleaseEntity updateRelease(int applicationId, ApplicationReleaseEntity applicationRelease, int tenantId)
|
||||
throws ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
PreparedStatement statement = null;
|
||||
@ -397,12 +398,12 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
statement.setString(3, applicationRelease.getReleaseType());
|
||||
statement.setString(4, applicationRelease.getPackageName());
|
||||
statement.setDouble(5, applicationRelease.getPrice());
|
||||
statement.setString(6, applicationRelease.getAppStoredLoc());
|
||||
statement.setString(7, applicationRelease.getBannerLoc());
|
||||
statement.setString(8, applicationRelease.getIconLoc());
|
||||
statement.setString(9, applicationRelease.getScreenshotLoc1());
|
||||
statement.setString(10, applicationRelease.getScreenshotLoc2());
|
||||
statement.setString(11, applicationRelease.getScreenshotLoc3());
|
||||
statement.setString(6, applicationRelease.getInstallerName());
|
||||
statement.setString(7, applicationRelease.getBannerName());
|
||||
statement.setString(8, applicationRelease.getIconName());
|
||||
statement.setString(9, applicationRelease.getScreenshotName1());
|
||||
statement.setString(10, applicationRelease.getScreenshotName2());
|
||||
statement.setString(11, applicationRelease.getScreenshotName3());
|
||||
statement.setString(12, applicationRelease.getAppHashValue());
|
||||
statement.setBoolean(13, applicationRelease.getIsSharedWithAllTenants());
|
||||
statement.setString(14, applicationRelease.getMetaData());
|
||||
@ -429,7 +430,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
*
|
||||
* @param id Id of the application Release.
|
||||
* @param version version name of the application release.
|
||||
* @throws ApplicationManagementDAOException Application Management DAO Exception.
|
||||
* @throws ApplicationManagementDAOException ApplicationEntity Management DAO Exception.
|
||||
*/
|
||||
@Override public void deleteRelease(int id, String version) throws ApplicationManagementDAOException {
|
||||
Connection connection;
|
||||
@ -476,7 +477,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully retrieved basic details of the application release with the application ID "
|
||||
+ appId + " Application release hash value: " + hashVal);
|
||||
+ appId + " ApplicationEntity release hash value: " + hashVal);
|
||||
}
|
||||
return rs.next();
|
||||
} catch (SQLException e) {
|
||||
@ -550,7 +551,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully retrieved basic details of the application release with the application ID "
|
||||
+ appId + " Application release uuid: " + uuid);
|
||||
+ appId + " ApplicationEntity release uuid: " + uuid);
|
||||
}
|
||||
return rs.next();
|
||||
} catch (SQLException e) {
|
||||
@ -597,4 +598,62 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
||||
Util.cleanupResources(stmt, rs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationReleaseArtifactPaths getReleaseArtifactPaths(String uuid, int tenantId) throws ApplicationManagementDAOException{
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Getting application release artifact stored location paths for: " + uuid);
|
||||
}
|
||||
Connection conn;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
ApplicationReleaseArtifactPaths applicationReleaseArtifactPaths = null;
|
||||
try {
|
||||
conn = this.getDBConnection();
|
||||
String sql = "SELECT AR.INSTALLER_LOCATION AS INSTALLER,"
|
||||
+ "AR.ICON_LOCATION AS ICON,"
|
||||
+ "AR.BANNER_LOCATION AS BANNER,"
|
||||
+ "AR.SC_1_LOCATION AS SC1,"
|
||||
+ "AR.SC_2_LOCATION AS SC2,"
|
||||
+ "AR.SC_3_LOCATION AS SC3 "
|
||||
+ "FROM AP_APP_RELEASE AS AR "
|
||||
+ "WHERE AR.UUID = ? AND AR.TENANT_ID = ?;";
|
||||
|
||||
stmt = conn.prepareStatement(sql);
|
||||
stmt.setString(1, uuid);
|
||||
stmt.setInt(2, tenantId);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug(
|
||||
"Successfully retrieved application release artifact details of the application release with the application UUID: "
|
||||
+ uuid);
|
||||
}
|
||||
|
||||
if (rs.getFetchSize() == 0 || rs.getFetchSize() >1){
|
||||
return null;
|
||||
}
|
||||
while(rs.next()){
|
||||
applicationReleaseArtifactPaths = new ApplicationReleaseArtifactPaths();
|
||||
List<String> scs = new ArrayList<>();
|
||||
applicationReleaseArtifactPaths.setInstallerPath(rs.getString("INSTALLER"));
|
||||
applicationReleaseArtifactPaths.setIconPath(rs.getString("ICON"));
|
||||
applicationReleaseArtifactPaths.setBannerPath(rs.getString("BANNER"));
|
||||
scs.add(rs.getString("SC1"));
|
||||
scs.add(rs.getString("SC2"));
|
||||
scs.add(rs.getString("SC3"));
|
||||
applicationReleaseArtifactPaths.setScreenshotPaths(scs);
|
||||
}
|
||||
return applicationReleaseArtifactPaths;
|
||||
} catch (SQLException e) {
|
||||
throw new ApplicationManagementDAOException(
|
||||
"Error occurred when executing query to get application release artifact paths for App release uuid: "
|
||||
+ uuid, e);
|
||||
} catch (DBConnectionException e) {
|
||||
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
||||
} finally {
|
||||
Util.cleanupResources(stmt, rs);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,7 +19,7 @@
|
||||
package org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.AppLifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.LifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.LifecycleStateEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.common.Util;
|
||||
@ -41,7 +41,7 @@ import java.util.List;
|
||||
public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements LifecycleStateDAO {
|
||||
|
||||
@Override
|
||||
public LifecycleState getLatestLifeCycleStateByReleaseID(int applicationReleaseId) throws LifeCycleManagementDAOException {
|
||||
public LifecycleStateEntity getLatestLifeCycleStateByReleaseID(int applicationReleaseId) throws LifeCycleManagementDAOException {
|
||||
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
@ -65,7 +65,7 @@ public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements Lif
|
||||
}
|
||||
}
|
||||
|
||||
public LifecycleState getLatestLifeCycleState(int appId, String uuid) throws LifeCycleManagementDAOException{
|
||||
public LifecycleStateEntity getLatestLifeCycleState(int appId, String uuid) throws LifeCycleManagementDAOException{
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
@ -122,8 +122,8 @@ public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements Lif
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LifecycleState> getLifecycleStates(int appReleaseId) throws LifeCycleManagementDAOException {
|
||||
List<LifecycleState> lifecycleStates = new ArrayList<>();
|
||||
public List<LifecycleStateEntity> getLifecycleStates(int appReleaseId) throws LifeCycleManagementDAOException {
|
||||
List<LifecycleStateEntity> lifecycleStates = new ArrayList<>();
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
@ -135,7 +135,7 @@ public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements Lif
|
||||
stmt.setInt(1,appReleaseId);
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
LifecycleState lifecycleState = new LifecycleState();
|
||||
LifecycleStateEntity lifecycleState = new LifecycleStateEntity();
|
||||
lifecycleState.setId(rs.getInt("ID"));
|
||||
lifecycleState.setCurrentState(rs.getString("CURRENT_STATE"));
|
||||
lifecycleState.setPreviousState(rs.getString("PREVIOUS_STATE"));
|
||||
@ -155,7 +155,7 @@ public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements Lif
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLifecycleState(LifecycleState state, int appId, String uuid, int tenantId) throws LifeCycleManagementDAOException {
|
||||
public void addLifecycleState(LifecycleStateEntity state, int appId, String uuid, int tenantId) throws LifeCycleManagementDAOException {
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
@ -207,11 +207,11 @@ public class GenericLifecycleStateDAOImpl extends AbstractDAOImpl implements Lif
|
||||
}
|
||||
}
|
||||
|
||||
private LifecycleState constructLifecycle(ResultSet rs) throws LifeCycleManagementDAOException {
|
||||
LifecycleState lifecycleState = null;
|
||||
private LifecycleStateEntity constructLifecycle(ResultSet rs) throws LifeCycleManagementDAOException {
|
||||
LifecycleStateEntity lifecycleState = null;
|
||||
try {
|
||||
if (rs !=null && rs.next()) {
|
||||
lifecycleState = new LifecycleState();
|
||||
lifecycleState = new LifecycleStateEntity();
|
||||
lifecycleState.setId(rs.getInt("ID"));
|
||||
lifecycleState.setCurrentState(rs.getString("CURRENT_STATE"));
|
||||
lifecycleState.setPreviousState(rs.getString("PREVIOUS_STATE"));
|
||||
|
||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.application.mgt.core.exception;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
|
||||
/**
|
||||
* Exception thrown during the Application Management DAO operations.
|
||||
* Exception thrown during the ApplicationEntity Management DAO operations.
|
||||
*/
|
||||
public class ApplicationManagementDAOException extends ApplicationManagementException {
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.validator.routines.UrlValidator;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationType;
|
||||
import org.wso2.carbon.device.application.mgt.common.DeviceTypes;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException;
|
||||
@ -39,7 +39,6 @@ import org.wso2.carbon.device.application.mgt.common.exception.RequestValidating
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ParsingException;
|
||||
import org.wso2.carbon.device.application.mgt.core.internal.DataHolder;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.ArtifactsParser;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.Constants;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.StorageManagementUtil;
|
||||
@ -81,44 +80,44 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationRelease uploadImageArtifacts(ApplicationRelease applicationRelease, InputStream iconFileStream,
|
||||
public ApplicationReleaseEntity uploadImageArtifacts(ApplicationReleaseEntity applicationRelease, InputStream iconFileStream,
|
||||
InputStream bannerFileStream, List<InputStream> screenShotStreams)
|
||||
throws ResourceManagementException {
|
||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
||||
String artifactDirectoryPath;
|
||||
String iconStoredLocation;
|
||||
String bannerStoredLocation;
|
||||
String scStoredLocation;
|
||||
String scStoredLocation = null;
|
||||
|
||||
try {
|
||||
artifactDirectoryPath = storagePath + applicationRelease.getAppHashValue();
|
||||
StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath);
|
||||
iconStoredLocation = artifactDirectoryPath + File.separator + Constants.IMAGE_ARTIFACTS[0];
|
||||
bannerStoredLocation = artifactDirectoryPath + File.separator + Constants.IMAGE_ARTIFACTS[1];
|
||||
iconStoredLocation = artifactDirectoryPath + File.separator + applicationRelease.getIconName();
|
||||
bannerStoredLocation = artifactDirectoryPath + File.separator + applicationRelease.getBannerName();
|
||||
|
||||
if (iconFileStream != null) {
|
||||
saveFile(iconFileStream, iconStoredLocation);
|
||||
applicationRelease.setIconLoc(iconStoredLocation);
|
||||
}
|
||||
if (bannerFileStream != null) {
|
||||
saveFile(bannerFileStream, bannerStoredLocation);
|
||||
applicationRelease.setBannerLoc(bannerStoredLocation);
|
||||
}
|
||||
if (!screenShotStreams.isEmpty()) {
|
||||
if (screenShotStreams.size() > screenShotMaxCount) {
|
||||
throw new ApplicationStorageManagementException("Maximum limit for the screen-shot exceeds");
|
||||
String msg = "Maximum limit for the screen-shot exceeds. You can't upload more than three "
|
||||
+ "screenshot for an application release";
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg);
|
||||
}
|
||||
int count = 1;
|
||||
for (InputStream screenshotStream : screenShotStreams) {
|
||||
scStoredLocation = artifactDirectoryPath + File.separator + Constants.IMAGE_ARTIFACTS[2] + count;
|
||||
if (count == 1) {
|
||||
applicationRelease.setScreenshotLoc1(scStoredLocation);
|
||||
scStoredLocation = artifactDirectoryPath + File.separator + applicationRelease.getScreenshotName1();
|
||||
}
|
||||
if (count == 2) {
|
||||
applicationRelease.setScreenshotLoc2(scStoredLocation);
|
||||
scStoredLocation = artifactDirectoryPath + File.separator + applicationRelease.getScreenshotName2();
|
||||
}
|
||||
if (count == 3) {
|
||||
applicationRelease.setScreenshotLoc3(scStoredLocation);
|
||||
scStoredLocation = artifactDirectoryPath + File.separator + applicationRelease.getScreenshotName3();
|
||||
}
|
||||
saveFile(screenshotStream, scStoredLocation);
|
||||
count++;
|
||||
@ -129,84 +128,15 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
throw new ApplicationStorageManagementException("IO Exception while saving the screens hots for " +
|
||||
"the application " + applicationRelease.getUuid(), e);
|
||||
} catch (ApplicationStorageManagementException e) {
|
||||
throw new ApplicationStorageManagementException("Application Management DAO exception while trying to "
|
||||
throw new ApplicationStorageManagementException("ApplicationEntity Management DAO exception while trying to "
|
||||
+ "update the screen-shot count for the application " + applicationRelease.getUuid() +
|
||||
" for the tenant id " + tenantId, e);
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationRelease uploadImageArtifactsTmp(ApplicationRelease applicationRelease,
|
||||
Attachment iconFile, Attachment bannerFile, List<Attachment> screenshots) throws ResourceManagementException{
|
||||
|
||||
InputStream iconFileStream;
|
||||
InputStream bannerFileStream;
|
||||
List<InputStream> screenshotStreams = new ArrayList<>();
|
||||
List<String> scFileExtensions = new ArrayList<>();
|
||||
DataHandler iconFileDataHandler;
|
||||
DataHandler bannerFileDataHandler;
|
||||
String artifactDirectoryPath;
|
||||
String iconStoredLocation;
|
||||
String bannerStoredLocation;
|
||||
String scStoredLocation;
|
||||
|
||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
||||
try {
|
||||
iconFileDataHandler = iconFile.getDataHandler();
|
||||
bannerFileDataHandler = bannerFile.getDataHandler();
|
||||
|
||||
iconFileStream = iconFileDataHandler.getInputStream();
|
||||
bannerFileStream = bannerFileDataHandler.getInputStream();
|
||||
for (Attachment screenshot : screenshots) {
|
||||
DataHandler scDataHandler = screenshot.getDataHandler();
|
||||
screenshotStreams.add(scDataHandler.getInputStream());
|
||||
scFileExtensions.add(scDataHandler.getName());
|
||||
}
|
||||
artifactDirectoryPath = storagePath + applicationRelease.getAppHashValue();
|
||||
StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath);
|
||||
|
||||
if (iconFileStream != null) {
|
||||
iconStoredLocation = artifactDirectoryPath + File.separator + iconFileDataHandler.getName();
|
||||
saveFile(iconFileStream, iconStoredLocation);
|
||||
applicationRelease.setIconLoc(iconStoredLocation);
|
||||
}
|
||||
if (bannerFileStream != null) {
|
||||
bannerStoredLocation = artifactDirectoryPath + File.separator + bannerFileDataHandler.getName();
|
||||
saveFile(bannerFileStream, bannerStoredLocation);
|
||||
applicationRelease.setBannerLoc(bannerStoredLocation);
|
||||
}
|
||||
if (!screenshotStreams.isEmpty()) {
|
||||
if (screenshotStreams.size() > screenShotMaxCount) {
|
||||
throw new ApplicationStorageManagementException("Maximum limit for the screen-shot exceeds");
|
||||
}
|
||||
int count = 0;
|
||||
for (InputStream screenshotStream : screenshotStreams) {
|
||||
scStoredLocation = artifactDirectoryPath + File.separator + scFileExtensions.get(count);
|
||||
count ++;
|
||||
if (count == 1) {
|
||||
applicationRelease.setScreenshotLoc1(scStoredLocation);
|
||||
}
|
||||
if (count == 2) {
|
||||
applicationRelease.setScreenshotLoc2(scStoredLocation);
|
||||
}
|
||||
if (count == 3) {
|
||||
applicationRelease.setScreenshotLoc3(scStoredLocation);
|
||||
}
|
||||
saveFile(screenshotStream, scStoredLocation);
|
||||
}
|
||||
}
|
||||
return applicationRelease;
|
||||
} catch (IOException e) {
|
||||
throw new ApplicationStorageManagementException("IO Exception while saving the screens hots for " +
|
||||
"the application " + applicationRelease.getUuid(), e);
|
||||
} catch (ApplicationStorageManagementException e) {
|
||||
throw new ApplicationStorageManagementException("Application Management DAO exception while trying to "
|
||||
+ "update the screen-shot count for the application " + applicationRelease.getUuid() +
|
||||
" for the tenant id " + tenantId, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationRelease updateImageArtifacts(ApplicationRelease applicationRelease, InputStream
|
||||
public ApplicationReleaseEntity updateImageArtifacts(ApplicationReleaseEntity applicationRelease, InputStream
|
||||
iconFileStream, InputStream bannerFileStream, List<InputStream> screenShotStreams)
|
||||
throws ResourceManagementException {
|
||||
|
||||
@ -214,10 +144,10 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
|
||||
try {
|
||||
if (iconFileStream != null) {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getIconLoc());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getIconName());
|
||||
}
|
||||
if (bannerFileStream != null) {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getBannerLoc());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getBannerName());
|
||||
}
|
||||
if (!screenShotStreams.isEmpty()) {
|
||||
if (screenShotStreams.size() > screenShotMaxCount) {
|
||||
@ -226,13 +156,13 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
int count = 1;
|
||||
while (count < screenShotStreams.size()) {
|
||||
if (count == 1) {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotLoc1());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotName1());
|
||||
}
|
||||
if (count == 2) {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotLoc2());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotName2());
|
||||
}
|
||||
if (count == 3) {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotLoc3());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getScreenshotName3());
|
||||
}
|
||||
count++;
|
||||
}
|
||||
@ -241,14 +171,14 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
screenShotStreams);
|
||||
return applicationRelease;
|
||||
} catch (ApplicationStorageManagementException e) {
|
||||
throw new ApplicationStorageManagementException("Application Storage exception while trying to"
|
||||
throw new ApplicationStorageManagementException("ApplicationEntity Storage exception while trying to"
|
||||
+ " update the screen-shot count for the application Release " + applicationRelease.getUuid() +
|
||||
" for the tenant " + tenantId, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationRelease uploadReleaseArtifact(ApplicationRelease applicationRelease, String appType,
|
||||
public ApplicationReleaseEntity uploadReleaseArtifact(ApplicationReleaseEntity applicationRelease, String appType,
|
||||
String deviceType, InputStream binaryFile) throws ResourceManagementException, RequestValidatingException {
|
||||
try {
|
||||
if (ApplicationType.WEB_CLIP.toString().equals(appType)) {
|
||||
@ -259,7 +189,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
log.error(msg);
|
||||
throw new RequestValidatingException(msg);
|
||||
}
|
||||
applicationRelease.setAppStoredLoc(applicationRelease.getUrl());
|
||||
applicationRelease.setInstallerName(applicationRelease.getUrl());
|
||||
applicationRelease.setAppHashValue(null);
|
||||
return applicationRelease;
|
||||
}
|
||||
@ -281,18 +211,14 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
ApkMeta apkMeta = ArtifactsParser.readAndroidManifestFile(cloneInputStream[2]);
|
||||
applicationRelease.setVersion(apkMeta.getVersionName());
|
||||
applicationRelease.setPackageName(apkMeta.getPackageName());
|
||||
artifactPath = artifactDirectoryPath + File.separator + Constants.RELEASE_ARTIFACT
|
||||
+ Constants.ANDROID_INSTALLER_EXT;
|
||||
} else if (DeviceTypes.IOS.toString().equalsIgnoreCase(deviceType)) {
|
||||
NSDictionary plistInfo = ArtifactsParser.readiOSManifestFile(binaryFile);
|
||||
applicationRelease
|
||||
.setVersion(plistInfo.objectForKey(ArtifactsParser.IPA_BUNDLE_VERSION_KEY).toString());
|
||||
applicationRelease
|
||||
.setPackageName(plistInfo.objectForKey(ArtifactsParser.IPA_BUNDLE_IDENTIFIER_KEY).toString());
|
||||
artifactPath = artifactDirectoryPath + File.separator + Constants.RELEASE_ARTIFACT
|
||||
+ Constants.IOS_INSTALLER_EXT;
|
||||
} else {
|
||||
String msg = "Application Type doesn't match with supporting application types " + applicationRelease
|
||||
String msg = "ApplicationEntity Type doesn't match with supporting application types " + applicationRelease
|
||||
.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg);
|
||||
@ -304,8 +230,9 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
}
|
||||
|
||||
StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath);
|
||||
artifactPath = artifactDirectoryPath + File.separator + applicationRelease.getInstallerName();
|
||||
saveFile(cloneInputStream[1], artifactPath);
|
||||
applicationRelease.setAppStoredLoc(artifactPath);
|
||||
applicationRelease.setInstallerName(artifactPath);
|
||||
applicationRelease.setAppHashValue(md5OfApp);
|
||||
} catch (IOException e) {
|
||||
String msg = "IO Exception while saving the release artifacts in the server for the application UUID "
|
||||
@ -314,83 +241,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
throw new ApplicationStorageManagementException( msg, e);
|
||||
} catch (ParsingException e) {
|
||||
String msg =
|
||||
"Error occurred while parsing the artifact file. Application release UUID is " + applicationRelease
|
||||
.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg, e);
|
||||
}
|
||||
return applicationRelease;
|
||||
}
|
||||
|
||||
public ApplicationRelease uploadReleaseArtifactTmp(ApplicationRelease applicationRelease, String appType, String deviceType,
|
||||
Attachment binaryFileAttachment) throws ResourceManagementException, RequestValidatingException{
|
||||
|
||||
try {
|
||||
if (ApplicationType.WEB_CLIP.toString().equals(appType)) {
|
||||
applicationRelease.setVersion(Constants.DEFAULT_VERSION);
|
||||
UrlValidator urlValidator = new UrlValidator();
|
||||
if (applicationRelease.getUrl() == null || !urlValidator.isValid(applicationRelease.getUrl())) {
|
||||
String msg = "Request payload doesn't contains Web Clip URL with application release object or Web Clip URL is invalid";
|
||||
log.error(msg);
|
||||
throw new RequestValidatingException(msg);
|
||||
}
|
||||
applicationRelease.setAppStoredLoc(applicationRelease.getUrl());
|
||||
applicationRelease.setAppHashValue(null);
|
||||
return applicationRelease;
|
||||
}
|
||||
String artifactDirectoryPath;
|
||||
String md5OfApp;
|
||||
String artifactPath;
|
||||
DataHandler binaryDataHandler = binaryFileAttachment.getDataHandler();
|
||||
String fileName = binaryDataHandler.getName();
|
||||
InputStream binaryFile = binaryDataHandler.getInputStream();
|
||||
InputStream[] cloneInputStream = cloneInputStream(binaryFile);
|
||||
md5OfApp = getMD5(binaryFile);
|
||||
if (md5OfApp == null) {
|
||||
String msg =
|
||||
"Error occurred while md5sum value retrieving process: application UUID " + applicationRelease
|
||||
.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg);
|
||||
}
|
||||
|
||||
artifactDirectoryPath = storagePath + md5OfApp;
|
||||
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
|
||||
ApkMeta apkMeta = ArtifactsParser.readAndroidManifestFile(cloneInputStream[2]);
|
||||
applicationRelease.setVersion(apkMeta.getVersionName());
|
||||
applicationRelease.setPackageName(apkMeta.getPackageName());
|
||||
} else if (DeviceTypes.IOS.toString().equalsIgnoreCase(deviceType)) {
|
||||
NSDictionary plistInfo = ArtifactsParser.readiOSManifestFile(binaryFile);
|
||||
applicationRelease
|
||||
.setVersion(plistInfo.objectForKey(ArtifactsParser.IPA_BUNDLE_VERSION_KEY).toString());
|
||||
applicationRelease
|
||||
.setPackageName(plistInfo.objectForKey(ArtifactsParser.IPA_BUNDLE_IDENTIFIER_KEY).toString());
|
||||
|
||||
} else {
|
||||
String msg = "Application Type doesn't match with supporting application types " + applicationRelease
|
||||
.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg);
|
||||
}
|
||||
|
||||
artifactPath = artifactDirectoryPath + File.separator + fileName;
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Artifact Directory Path for saving the application release related artifacts related with "
|
||||
+ "application UUID " + applicationRelease.getUuid() + " is " + artifactDirectoryPath);
|
||||
}
|
||||
|
||||
StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath);
|
||||
saveFile(cloneInputStream[1], artifactPath);
|
||||
applicationRelease.setAppStoredLoc(artifactPath);
|
||||
applicationRelease.setAppHashValue(md5OfApp);
|
||||
} catch (IOException e) {
|
||||
String msg = "IO Exception while saving the release artifacts in the server for the application UUID "
|
||||
+ applicationRelease.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException( msg, e);
|
||||
} catch (ParsingException e) {
|
||||
String msg =
|
||||
"Error occurred while parsing the artifact file. Application release UUID is " + applicationRelease
|
||||
"Error occurred while parsing the artifact file. ApplicationEntity release UUID is " + applicationRelease
|
||||
.getUuid();
|
||||
log.error(msg);
|
||||
throw new ApplicationStorageManagementException(msg, e);
|
||||
@ -420,17 +271,17 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationRelease updateReleaseArtifacts(ApplicationRelease applicationRelease, String appType,
|
||||
public ApplicationReleaseEntity updateReleaseArtifacts(ApplicationReleaseEntity applicationRelease, String appType,
|
||||
String deviceType, InputStream binaryFile) throws ApplicationStorageManagementException,
|
||||
RequestValidatingException {
|
||||
|
||||
try {
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getAppStoredLoc());
|
||||
deleteApplicationReleaseArtifacts(applicationRelease.getInstallerName());
|
||||
applicationRelease = uploadReleaseArtifact(applicationRelease, appType, deviceType, binaryFile);
|
||||
} catch (ApplicationStorageManagementException e) {
|
||||
throw new ApplicationStorageManagementException("Application Artifact doesn't contains in the System", e);
|
||||
throw new ApplicationStorageManagementException("ApplicationEntity Artifact doesn't contains in the System", e);
|
||||
} catch (ResourceManagementException e) {
|
||||
throw new ApplicationStorageManagementException("Application Artifact Updating failed", e);
|
||||
throw new ApplicationStorageManagementException("ApplicationEntity Artifact Updating failed", e);
|
||||
}
|
||||
|
||||
return applicationRelease;
|
||||
@ -455,13 +306,24 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void deleteAllApplicationReleaseArtifacts(List<String> directoryPaths)
|
||||
@Override
|
||||
public void deleteAllApplicationReleaseArtifacts(List<String> directoryPaths)
|
||||
throws ApplicationStorageManagementException {
|
||||
for (String directoryBasePath : directoryPaths) {
|
||||
deleteApplicationReleaseArtifacts(storagePath + directoryBasePath);
|
||||
}
|
||||
}
|
||||
|
||||
public InputStream getFileSttream (String path) throws ApplicationStorageManagementException {
|
||||
String filePath = storagePath + path;
|
||||
try {
|
||||
return StorageManagementUtil.getInputStream(filePath);
|
||||
} catch (IOException e) {
|
||||
String msg = "Error occured when accessing the file in file path: " + filePath;
|
||||
throw new ApplicationStorageManagementException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getMD5(InputStream binaryFile) throws ApplicationStorageManagementException {
|
||||
String md5;
|
||||
try {
|
||||
|
||||
@ -0,0 +1,103 @@
|
||||
/* Copyright (c) 2018, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.application.mgt.core.impl;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationReleaseArtifactPaths;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.common.Util;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public class AppmDataHandlerImpl implements AppmDataHandler {
|
||||
|
||||
private UIConfiguration uiConfiguration;
|
||||
|
||||
public AppmDataHandlerImpl(UIConfiguration config) {
|
||||
this.uiConfiguration = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UIConfiguration getUIConfiguration() throws ApplicationManagementException {
|
||||
return this.uiConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
// throws ApplicationManagementException
|
||||
public InputStream getArtifactStream(String uuid, String artifactName) {
|
||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
||||
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
||||
ApplicationReleaseDAO applicationReleaseDAO = ApplicationManagementDAOFactory.getApplicationReleaseDAO();
|
||||
String artifactPath = null;
|
||||
|
||||
if (StringUtils.isEmpty(uuid) || StringUtils.isEmpty(artifactName)) {
|
||||
// todo throw
|
||||
}
|
||||
ApplicationReleaseArtifactPaths applicationReleaseArtifactPaths = null;
|
||||
try {
|
||||
applicationReleaseArtifactPaths = applicationReleaseDAO
|
||||
.getReleaseArtifactPaths(uuid, tenantId);
|
||||
} catch (ApplicationManagementDAOException e) {
|
||||
// todo throw
|
||||
// throw new ApplicationManagementException();
|
||||
// e.printStackTrace();
|
||||
}
|
||||
|
||||
String installerFileName = applicationReleaseArtifactPaths.getInstallerPath();
|
||||
String iconFileName = applicationReleaseArtifactPaths.getIconPath();
|
||||
String bannerFileName = applicationReleaseArtifactPaths.getBannerPath();
|
||||
|
||||
if (StringUtils.isEmpty(installerFileName) && artifactName.equals(installerFileName)) {
|
||||
artifactPath = applicationReleaseArtifactPaths.getInstallerPath();
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(iconFileName) && artifactName.equals(iconFileName)) {
|
||||
artifactPath = applicationReleaseArtifactPaths.getIconPath();
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(bannerFileName) && artifactName.equals(bannerFileName)) {
|
||||
artifactPath = applicationReleaseArtifactPaths.getBannerPath();
|
||||
}
|
||||
|
||||
for (String screenshotPath : applicationReleaseArtifactPaths.getScreenshotPaths()) {
|
||||
if (screenshotPath != null && screenshotPath.contains(artifactName)) {
|
||||
artifactPath = screenshotPath;
|
||||
}
|
||||
}
|
||||
|
||||
if (artifactPath != null) {
|
||||
try {
|
||||
return applicationStorageManager.getFileSttream(artifactPath);
|
||||
} catch (ApplicationStorageManagementException e) {
|
||||
// todo throw
|
||||
// throw new ApplicationManagementException();
|
||||
// e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
/* Copyright (c) 2018, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.application.mgt.core.impl;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ConfigManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
|
||||
public class ConfigManagerImpl implements ConfigManager {
|
||||
|
||||
private UIConfiguration uiConfiguration;
|
||||
|
||||
public ConfigManagerImpl(UIConfiguration config) {
|
||||
this.uiConfiguration = config;
|
||||
}
|
||||
|
||||
@Override public UIConfiguration getUIConfiguration() throws ApplicationManagementException {
|
||||
return this.uiConfiguration;
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class MAMDeviceConnectorImpl implements DeviceConnector{
|
||||
for (String username: userList) {
|
||||
List<Device> devices = getDeviceManagementService().getDevicesOfUser(username);
|
||||
List<DeviceIdentifier> deviceIdentifiers = convertDeviceToDeviceIdentifier(devices);
|
||||
// getDeviceManagementService().addOperation(appOperation.getApplication().getDeviceType(),
|
||||
// getDeviceManagementService().addOperation(appOperation.getApplication().getDeviceTypeName(),
|
||||
// operationEKA, devices);
|
||||
subscriptionDAO.subscribeDeviceToApplication(appOperation.getTenantId(), appOperation.getSubscribedBy(),
|
||||
devices, appOperation.getApplication().getId(), appOperation.getAppReleaseId(),
|
||||
|
||||
@ -21,7 +21,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.AppOperation;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||
@ -70,7 +70,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
log.debug("Install application: " + applicationUUID + " to " + deviceList.size() + "devices.");
|
||||
}
|
||||
ApplicationManager applicationManager = DataHolder.getInstance().getApplicationManager();
|
||||
Application application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
ApplicationEntity application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
|
||||
return installApplication(application, deviceList);
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
log.debug("Install application: " + applicationUUID + " to " + userList.size() + " users.");
|
||||
}
|
||||
ApplicationManager applicationManager = DataHolder.getInstance().getApplicationManager();
|
||||
Application application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
ApplicationEntity application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
List<DeviceIdentifier> deviceList = new ArrayList<>();
|
||||
for (String user : userList) {
|
||||
try {
|
||||
@ -123,7 +123,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
log.debug("Install application: " + applicationUUID + " to " + roleList.size() + " roles.");
|
||||
}
|
||||
ApplicationManager applicationManager = DataHolder.getInstance().getApplicationManager();
|
||||
Application application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
ApplicationEntity application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
List<DeviceIdentifier> deviceList = new ArrayList<>();
|
||||
for (String role : roleList) {
|
||||
try {
|
||||
@ -164,7 +164,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
log.debug("Install application: " + applicationUUID + " to " + deviceGroupList.size() + " groups.");
|
||||
}
|
||||
ApplicationManager applicationManager = DataHolder.getInstance().getApplicationManager();
|
||||
Application application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
ApplicationEntity application = applicationManager.getApplicationByRelease(applicationUUID);
|
||||
GroupManagementProviderService groupManagementProviderService = HelperUtil.getGroupManagementProviderService();
|
||||
List<DeviceGroup> groupList = new ArrayList<>();
|
||||
List<DeviceIdentifier> deviceList = new ArrayList<>();
|
||||
@ -207,7 +207,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
private ApplicationInstallResponse installApplication(Application application,
|
||||
private ApplicationInstallResponse installApplication(ApplicationEntity application,
|
||||
List<DeviceIdentifier> deviceIdentifierList) throws ApplicationManagementException {
|
||||
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
||||
.getDeviceManagementProviderService();
|
||||
@ -259,14 +259,14 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||
return response;
|
||||
}
|
||||
|
||||
private Operation generateOperationPayloadByDeviceType(String deviceType, Application application) {
|
||||
private Operation generateOperationPayloadByDeviceType(String deviceType, ApplicationEntity application) {
|
||||
ProfileOperation operation = new ProfileOperation();
|
||||
operation.setCode(INSTALL_APPLICATION);
|
||||
operation.setType(Operation.Type.PROFILE);
|
||||
|
||||
//todo: generate operation payload correctly for all types of devices.
|
||||
operation.setPayLoad(
|
||||
"{'type':'enterprise', 'url':'" + application.getApplicationReleases().get(0).getAppStoredLoc()
|
||||
"{'type':'enterprise', 'url':'" + application.getApplicationReleases().get(0).getInstallerName()
|
||||
+ "', 'app':'" + application.getApplicationReleases().get(0).getUuid() + "'}");
|
||||
return operation;
|
||||
}
|
||||
|
||||
@ -24,13 +24,13 @@ import org.osgi.framework.BundleContext;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ConfigManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ReviewManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
|
||||
import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration;
|
||||
import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory;
|
||||
import org.wso2.carbon.device.application.mgt.core.impl.ConfigManagerImpl;
|
||||
import org.wso2.carbon.device.application.mgt.core.impl.AppmDataHandlerImpl;
|
||||
import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManger;
|
||||
import org.wso2.carbon.device.application.mgt.core.lifecycle.config.LifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.ApplicationManagementUtil;
|
||||
@ -75,7 +75,6 @@ public class ApplicationManagementServiceComponent {
|
||||
try {
|
||||
String dataSourceName = ConfigurationManager.getInstance().getConfiguration().getDatasourceName();
|
||||
ApplicationManagementDAOFactory.init(dataSourceName);
|
||||
// ApplicationManagementDAOFactory.initDatabases();
|
||||
|
||||
List<LifecycleState> lifecycleStates = ConfigurationManager.getInstance().
|
||||
getConfiguration().getLifecycleStates();
|
||||
@ -85,6 +84,8 @@ public class ApplicationManagementServiceComponent {
|
||||
bundleContext.registerService(LifecycleStateManger.class.getName(), lifecycleStateManger, null);
|
||||
|
||||
ApplicationManager applicationManager = ApplicationManagementUtil.getApplicationManagerInstance();
|
||||
applicationManager
|
||||
.addAplicationCategories(ConfigurationManager.getInstance().getConfiguration().getAppCategories());
|
||||
DataHolder.getInstance().setApplicationManager(applicationManager);
|
||||
bundleContext.registerService(ApplicationManager.class.getName(), applicationManager, null);
|
||||
|
||||
@ -103,9 +104,9 @@ public class ApplicationManagementServiceComponent {
|
||||
|
||||
UIConfiguration uiConfiguration = ConfigurationManager.getInstance().
|
||||
getConfiguration().getUiConfiguration();
|
||||
ConfigManager configManager = new ConfigManagerImpl(uiConfiguration);
|
||||
AppmDataHandler configManager = new AppmDataHandlerImpl(uiConfiguration);
|
||||
DataHolder.getInstance().setConfigManager(configManager);
|
||||
bundleContext.registerService(ConfigManager.class.getName(), configManager, null);
|
||||
bundleContext.registerService(AppmDataHandler.class.getName(), configManager, null);
|
||||
|
||||
log.info("ApplicationManagement core bundle has been successfully initialized");
|
||||
} catch (Throwable e) {
|
||||
@ -119,14 +120,14 @@ public class ApplicationManagementServiceComponent {
|
||||
|
||||
protected void setDeviceManagementService(DeviceManagementProviderService deviceManagementProviderService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Setting Application Management OSGI Manager");
|
||||
log.debug("Setting ApplicationEntity Management OSGI Manager");
|
||||
}
|
||||
DataHolder.getInstance().setDeviceManagementService(deviceManagementProviderService);
|
||||
}
|
||||
|
||||
protected void unsetDeviceManagementService(DeviceManagementProviderService deviceManagementProviderService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Removing Application Management OSGI Manager");
|
||||
log.debug("Removing ApplicationEntity Management OSGI Manager");
|
||||
}
|
||||
DataHolder.getInstance().setDeviceManagementService(null);
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ package org.wso2.carbon.device.application.mgt.core.internal;
|
||||
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ConfigManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ReviewManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
|
||||
import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManger;
|
||||
@ -46,7 +46,7 @@ public class DataHolder {
|
||||
|
||||
private LifecycleStateManger lifecycleStateManger;
|
||||
|
||||
private ConfigManager configManager;
|
||||
private AppmDataHandler configManager;
|
||||
|
||||
private static final DataHolder applicationMgtDataHolder = new DataHolder();
|
||||
|
||||
@ -114,11 +114,11 @@ public class DataHolder {
|
||||
this.lifecycleStateManger = lifecycleStateManger;
|
||||
}
|
||||
|
||||
public ConfigManager getConfigManager() {
|
||||
public AppmDataHandler getConfigManager() {
|
||||
return configManager;
|
||||
}
|
||||
|
||||
public void setConfigManager(ConfigManager configManager) {
|
||||
public void setConfigManager(AppmDataHandler configManager) {
|
||||
this.configManager = configManager;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,13 +24,12 @@ import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.application.mgt.common.Filter;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.*;
|
||||
import org.wso2.carbon.device.application.mgt.common.ErrorResponse;
|
||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
||||
/**
|
||||
* Holds util methods required for Application-Mgt API component.
|
||||
* Holds util methods required for ApplicationEntity-Mgt API component.
|
||||
*/
|
||||
public class APIUtil {
|
||||
|
||||
@ -40,7 +39,7 @@ public class APIUtil {
|
||||
private static ApplicationStorageManager applicationStorageManager;
|
||||
private static SubscriptionManager subscriptionManager;
|
||||
private static ReviewManager reviewManager;
|
||||
private static ConfigManager configManager;
|
||||
private static AppmDataHandler appmDataHandler;
|
||||
|
||||
public static ApplicationManager getApplicationManager() {
|
||||
if (applicationManager == null) {
|
||||
@ -50,7 +49,7 @@ public class APIUtil {
|
||||
applicationManager =
|
||||
(ApplicationManager) ctx.getOSGiService(ApplicationManager.class, null);
|
||||
if (applicationManager == null) {
|
||||
String msg = "Application Manager service has not initialized.";
|
||||
String msg = "ApplicationEntity Manager service has not initialized.";
|
||||
log.error(msg);
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
@ -61,7 +60,7 @@ public class APIUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the Application Storage Manager from the osgi context.
|
||||
* To get the ApplicationEntity Storage Manager from the osgi context.
|
||||
* @return ApplicationStoreManager instance in the current osgi context.
|
||||
*/
|
||||
public static ApplicationStorageManager getApplicationStorageManager() {
|
||||
@ -72,7 +71,7 @@ public class APIUtil {
|
||||
applicationStorageManager = (ApplicationStorageManager) ctx
|
||||
.getOSGiService(ApplicationStorageManager.class, null);
|
||||
if (applicationStorageManager == null) {
|
||||
String msg = "Application Storage Manager service has not initialized.";
|
||||
String msg = "ApplicationEntity Storage Manager service has not initialized.";
|
||||
log.error(msg);
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
@ -143,17 +142,17 @@ public class APIUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the Config Manager from the osgi context.
|
||||
* @return ConfigManager instance in the current osgi context.
|
||||
* To get the DataHandler from the osgi context.
|
||||
* @return AppmDataHandler instance in the current osgi context.
|
||||
*/
|
||||
public static ConfigManager getConfigManager() {
|
||||
if (configManager == null) {
|
||||
public static AppmDataHandler getDataHandler() {
|
||||
if (appmDataHandler == null) {
|
||||
synchronized (APIUtil.class) {
|
||||
if (configManager == null) {
|
||||
if (appmDataHandler == null) {
|
||||
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||
configManager =
|
||||
(ConfigManager) ctx.getOSGiService(ConfigManager.class, null);
|
||||
if (configManager == null) {
|
||||
appmDataHandler =
|
||||
(AppmDataHandler) ctx.getOSGiService(AppmDataHandler.class, null);
|
||||
if (appmDataHandler == null) {
|
||||
String msg = "Config Manager service has not initialized.";
|
||||
log.error(msg);
|
||||
throw new IllegalStateException(msg);
|
||||
@ -162,10 +161,10 @@ public class APIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
return configManager;
|
||||
return appmDataHandler;
|
||||
}
|
||||
|
||||
public static Filter constructFilter(String deviceType, String appName, String appType, String appCategory,
|
||||
public static Filter constructFilter( String appName, String appType, String appCategory,
|
||||
boolean isFullMatch, String releaseState, int offset, int limit, String sortBy) {
|
||||
Filter filter = new Filter();
|
||||
filter.setOffset(offset);
|
||||
@ -184,11 +183,6 @@ public class APIUtil {
|
||||
if (releaseState != null && !releaseState.isEmpty()) {
|
||||
filter.setCurrentAppReleaseState(releaseState);
|
||||
}
|
||||
if (deviceType != null && !deviceType.isEmpty()) {
|
||||
DeviceType dt = new DeviceType();
|
||||
dt.setName(deviceType);
|
||||
filter.setDeviceType(dt);
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
|
||||
|
||||
@ -20,11 +20,14 @@ package org.wso2.carbon.device.application.mgt.core.util;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.application.mgt.common.ImageArtifact;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -35,6 +38,9 @@ import java.nio.file.Files;
|
||||
* This is a util class that handles Storage Management related tasks.
|
||||
*/
|
||||
public class StorageManagementUtil {
|
||||
|
||||
private static Log log = LogFactory.getLog(StorageManagementUtil.class);
|
||||
|
||||
/**
|
||||
* This method is responsible for creating artifact parent directories in the given path.
|
||||
*
|
||||
@ -99,4 +105,19 @@ public class StorageManagementUtil {
|
||||
return imageArtifact;
|
||||
}
|
||||
|
||||
/***
|
||||
* Get the fine input stream
|
||||
* @param filePath File path
|
||||
* @return {@link InputStream}
|
||||
* @throws IOException throws if error occured when reading file or if couldn't find a file in the filePath
|
||||
*/
|
||||
public static InputStream getInputStream (String filePath) throws IOException {
|
||||
try (InputStream inputStream = new FileInputStream(filePath)){
|
||||
return inputStream;
|
||||
} catch (FileNotFoundException e) {
|
||||
String msg = "Couldn't file the file in file path: " + filePath;
|
||||
log.error(msg);
|
||||
throw new IOException(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<ApplicationManagementConfiguration>
|
||||
|
||||
<!-- Application Mgt DB schema -->
|
||||
<!-- ApplicationEntity Mgt DB schema -->
|
||||
<DatasourceName>jdbc/APPM_DS</DatasourceName>
|
||||
|
||||
<Extensions>
|
||||
|
||||
@ -34,6 +34,11 @@ import org.wso2.carbon.apimgt.annotations.api.Scope;
|
||||
import org.wso2.carbon.apimgt.annotations.api.Scopes;
|
||||
import org.wso2.carbon.device.application.mgt.common.*;
|
||||
import org.wso2.carbon.device.application.mgt.common.ErrorResponse;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.response.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationReleaseWrapper;
|
||||
import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
@ -55,7 +60,7 @@ import javax.ws.rs.core.Response;
|
||||
@SwaggerDefinition(
|
||||
info = @Info(
|
||||
version = "1.0.0",
|
||||
title = "Application Management Service",
|
||||
title = "ApplicationEntity Management Service",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = "name", value = "ApplicationManagementService"),
|
||||
@ -64,20 +69,20 @@ import javax.ws.rs.core.Response;
|
||||
}
|
||||
),
|
||||
tags = {
|
||||
@Tag(name = "application_management, device_management", description = "Application Management related "
|
||||
@Tag(name = "application_management, device_management", description = "ApplicationEntity Management related "
|
||||
+ "APIs")
|
||||
}
|
||||
)
|
||||
@Scopes(
|
||||
scopes = {
|
||||
@Scope(
|
||||
name = "Get Application Details",
|
||||
name = "Get ApplicationEntity Details",
|
||||
description = "Get application details",
|
||||
key = "perm:app:publisher:view",
|
||||
permissions = {"/device-mgt/application/view"}
|
||||
),
|
||||
@Scope(
|
||||
name = "Update an Application",
|
||||
name = "Update an ApplicationEntity",
|
||||
description = "Update an application",
|
||||
key = "perm:app:publisher:update",
|
||||
permissions = {"/device-mgt/application/update"}
|
||||
@ -85,7 +90,7 @@ import javax.ws.rs.core.Response;
|
||||
}
|
||||
)
|
||||
@Path("/publisher/applications")
|
||||
@Api(value = "Application Management", description = "This API carries all application management related operations " +
|
||||
@Api(value = "ApplicationEntity Management", description = "This API carries all application management related operations " +
|
||||
"such as get all the applications, add application, etc.")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface ApplicationManagementAPI {
|
||||
@ -101,7 +106,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "GET",
|
||||
value = "get all applications",
|
||||
notes = "This will get all applications",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:view")
|
||||
@ -138,7 +143,7 @@ public interface ApplicationManagementAPI {
|
||||
@QueryParam("type") String appType,
|
||||
@ApiParam(
|
||||
name = "category",
|
||||
value = "Category of the application")
|
||||
value = "CategoryEntity of the application")
|
||||
@QueryParam("category") String appCategory,
|
||||
@ApiParam(
|
||||
name = "exact-match",
|
||||
@ -175,7 +180,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "GET",
|
||||
value = "get the application of requesting application id and state",
|
||||
notes = "This will get the application identified by the application id and state, if exists",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:view")
|
||||
@ -187,10 +192,10 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully retrieved relevant application.",
|
||||
response = Application.class),
|
||||
response = ApplicationEntity.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Application not found"),
|
||||
message = "ApplicationEntity not found"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while getting relevant application.",
|
||||
@ -219,7 +224,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "PUT",
|
||||
value = "Edit an application",
|
||||
notes = "This will edit the new application",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -231,11 +236,11 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully edited the application.",
|
||||
response = Application.class),
|
||||
response = ApplicationEntity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
"Application updating payload contains unacceptable or vulnerable data"),
|
||||
"ApplicationEntity updating payload contains unacceptable or vulnerable data"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while editing the application.",
|
||||
@ -251,7 +256,7 @@ public interface ApplicationManagementAPI {
|
||||
name = "application",
|
||||
value = "The application that need to be edited.",
|
||||
required = true)
|
||||
@Valid Application application
|
||||
@Valid ApplicationEntity application
|
||||
);
|
||||
|
||||
@POST
|
||||
@ -263,7 +268,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "POST",
|
||||
value = "Create an application",
|
||||
notes = "This will create a new application",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -275,11 +280,11 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 201,
|
||||
message = "OK. \n Successfully created an application.",
|
||||
response = Application.class),
|
||||
response = ApplicationEntity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
"Application creating payload contains unacceptable or vulnerable data"),
|
||||
"ApplicationEntity creating payload contains unacceptable or vulnerable data"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while creating the application.",
|
||||
@ -290,7 +295,7 @@ public interface ApplicationManagementAPI {
|
||||
name = "application",
|
||||
value = "The application that need to be created.",
|
||||
required = true)
|
||||
@Multipart("application") Application application,
|
||||
@Multipart("application") ApplicationWrapper application,
|
||||
@ApiParam(
|
||||
name = "binaryFile",
|
||||
value = "Binary file of uploading application",
|
||||
@ -323,78 +328,78 @@ public interface ApplicationManagementAPI {
|
||||
@Multipart(value = "screenshot3") Attachment screenshot3
|
||||
);
|
||||
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes("multipart/mixed")
|
||||
@Path("/{deviceType}/{appType}/{appId}")
|
||||
@ApiOperation(
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "POST",
|
||||
value = "Create an application",
|
||||
notes = "This will create a new application",
|
||||
tags = "Application Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
})
|
||||
}
|
||||
)
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 201,
|
||||
message = "OK. \n Successfully created an application.",
|
||||
response = Application.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
"Application creating payload contains unacceptable or vulnerable data"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while creating the application.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
Response createRelease(
|
||||
@PathParam("deviceType") String deviceType,
|
||||
@PathParam("appId") String appType,
|
||||
@PathParam("appId") int appId,
|
||||
@ApiParam(
|
||||
name = "applicationRelease",
|
||||
value = "The application release that need to be created.",
|
||||
required = true)
|
||||
@Multipart("applicationRelease") ApplicationRelease applicationRelease,
|
||||
@ApiParam(
|
||||
name = "binaryFile",
|
||||
value = "Binary file of uploading application",
|
||||
required = true)
|
||||
@Multipart(value = "binaryFile") Attachment binaryFile,
|
||||
@ApiParam(
|
||||
name = "icon",
|
||||
value = "Icon of the uploading application",
|
||||
required = true)
|
||||
@Multipart(value = "icon") Attachment iconFile,
|
||||
@ApiParam(
|
||||
name = "banner",
|
||||
value = "Banner of the uploading application",
|
||||
required = true)
|
||||
@Multipart(value = "banner") Attachment bannerFile,
|
||||
@ApiParam(
|
||||
name = "screenshot1",
|
||||
value = "Screen Shots of the uploading application",
|
||||
required = true)
|
||||
@Multipart(value = "screenshot1") Attachment screenshot1,
|
||||
@ApiParam(
|
||||
name = "screenshot2",
|
||||
value = "Screen Shots of the uploading application",
|
||||
required = false)
|
||||
@Multipart(value = "screenshot2") Attachment screenshot2,
|
||||
@ApiParam(
|
||||
name = "screenshot3",
|
||||
value = "Screen Shots of the uploading application",
|
||||
required = false)
|
||||
@Multipart(value = "screenshot3") Attachment screenshot3
|
||||
);
|
||||
// @POST
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// @Consumes("multipart/mixed")
|
||||
// @Path("/{deviceType}/{appType}/{appId}")
|
||||
// @ApiOperation(
|
||||
// consumes = MediaType.APPLICATION_JSON,
|
||||
// produces = MediaType.APPLICATION_JSON,
|
||||
// httpMethod = "POST",
|
||||
// value = "Create an application",
|
||||
// notes = "This will create a new application",
|
||||
// tags = "ApplicationEntity Management",
|
||||
// extensions = {
|
||||
// @Extension(properties = {
|
||||
// @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
// })
|
||||
// }
|
||||
// )
|
||||
// @ApiResponses(
|
||||
// value = {
|
||||
// @ApiResponse(
|
||||
// code = 201,
|
||||
// message = "OK. \n Successfully created an application.",
|
||||
// response = Application.class),
|
||||
// @ApiResponse(
|
||||
// code = 400,
|
||||
// message = "Bad Request. \n " +
|
||||
// "ApplicationEntity creating payload contains unacceptable or vulnerable data"),
|
||||
// @ApiResponse(
|
||||
// code = 500,
|
||||
// message = "Internal Server Error. \n Error occurred while creating the application.",
|
||||
// response = ErrorResponse.class)
|
||||
// })
|
||||
// Response createRelease(
|
||||
// @PathParam("deviceType") String deviceType,
|
||||
// @PathParam("appId") String appType,
|
||||
// @PathParam("appId") int appId,
|
||||
// @ApiParam(
|
||||
// name = "applicationRelease",
|
||||
// value = "The application release that need to be created.",
|
||||
// required = true)
|
||||
// @Multipart("applicationRelease") ApplicationReleaseEntity applicationRelease,
|
||||
// @ApiParam(
|
||||
// name = "binaryFile",
|
||||
// value = "Binary file of uploading application",
|
||||
// required = true)
|
||||
// @Multipart(value = "binaryFile") Attachment binaryFile,
|
||||
// @ApiParam(
|
||||
// name = "icon",
|
||||
// value = "Icon of the uploading application",
|
||||
// required = true)
|
||||
// @Multipart(value = "icon") Attachment iconFile,
|
||||
// @ApiParam(
|
||||
// name = "banner",
|
||||
// value = "Banner of the uploading application",
|
||||
// required = true)
|
||||
// @Multipart(value = "banner") Attachment bannerFile,
|
||||
// @ApiParam(
|
||||
// name = "screenshot1",
|
||||
// value = "Screen Shots of the uploading application",
|
||||
// required = true)
|
||||
// @Multipart(value = "screenshot1") Attachment screenshot1,
|
||||
// @ApiParam(
|
||||
// name = "screenshot2",
|
||||
// value = "Screen Shots of the uploading application",
|
||||
// required = false)
|
||||
// @Multipart(value = "screenshot2") Attachment screenshot2,
|
||||
// @ApiParam(
|
||||
// name = "screenshot3",
|
||||
// value = "Screen Shots of the uploading application",
|
||||
// required = false)
|
||||
// @Multipart(value = "screenshot3") Attachment screenshot3
|
||||
// );
|
||||
|
||||
@DELETE
|
||||
@Consumes("application/json")
|
||||
@ -405,7 +410,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "DELETE",
|
||||
value = "Delete the application with the given UUID",
|
||||
notes = "This will delete the application with the given UUID",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -426,7 +431,7 @@ public interface ApplicationManagementAPI {
|
||||
Response deleteApplication(
|
||||
@ApiParam(
|
||||
name = "UUID",
|
||||
value = "Unique identifier of the Application",
|
||||
value = "Unique identifier of the ApplicationEntity",
|
||||
required = true)
|
||||
@PathParam("appid") int applicationId
|
||||
);
|
||||
@ -441,7 +446,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "POST",
|
||||
value = "Upload artifacts",
|
||||
notes = "This will create a new application",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -517,7 +522,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "POST",
|
||||
value = "Upload artifacts",
|
||||
notes = "This will create a new application",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -532,7 +537,7 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
"Application artifact updating payload contains unacceptable or vulnerable data"),
|
||||
"ApplicationEntity artifact updating payload contains unacceptable or vulnerable data"),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "NOT FOUND. \n Couldn't found application/application release to update applocation release artifact."),
|
||||
@ -563,7 +568,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "PUT",
|
||||
value = "Update an application release",
|
||||
notes = "This will update a new application release",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update")
|
||||
@ -575,11 +580,11 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 201,
|
||||
message = "OK. \n Successfully created an application release.",
|
||||
response = ApplicationRelease.class),
|
||||
response = ApplicationReleaseEntity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
"Application release updating payload contains unacceptable or vulnerable data"),
|
||||
"ApplicationEntity release updating payload contains unacceptable or vulnerable data"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while releasing the application.",
|
||||
@ -588,11 +593,11 @@ public interface ApplicationManagementAPI {
|
||||
Response updateApplicationRelease(
|
||||
@ApiParam(name = "deviceType", value = "Supported device type of the application", required = true)
|
||||
@PathParam("deviceType") String deviceType,
|
||||
@ApiParam(name = "appId", value = "Identifier of the Application", required = true)
|
||||
@ApiParam(name = "appId", value = "Identifier of the ApplicationEntity", required = true)
|
||||
@PathParam("appId") int applicationId,
|
||||
@ApiParam(name = "UUID", value = "Unique identifier of the Application Release", required = true)
|
||||
@ApiParam(name = "UUID", value = "Unique identifier of the ApplicationEntity Release", required = true)
|
||||
@PathParam("uuid") String applicationUUID,
|
||||
@Multipart(value = "applicationRelease", required = false, type = "application/json") ApplicationRelease applicationRelease,
|
||||
@Multipart(value = "applicationRelease", required = false, type = "application/json") ApplicationReleaseEntity applicationRelease,
|
||||
@Multipart(value = "binaryFile", required = false) Attachment binaryFile,
|
||||
@Multipart(value = "icon", required = false) Attachment iconFile,
|
||||
@Multipart(value = "banner", required = false) Attachment bannerFile,
|
||||
@ -655,7 +660,7 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 201,
|
||||
message = "OK. \n Successfully add a lifecycle state.",
|
||||
response = Application.class),
|
||||
response = ApplicationEntity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n " +
|
||||
@ -672,12 +677,12 @@ public interface ApplicationManagementAPI {
|
||||
Response addLifecycleState(
|
||||
@ApiParam(
|
||||
name = "appId",
|
||||
value = "Identifier of the Application",
|
||||
value = "Identifier of the ApplicationEntity",
|
||||
required = true)
|
||||
@PathParam("appId") int applicationId,
|
||||
@ApiParam(
|
||||
name = "uuid",
|
||||
value = "UUID of the Application Release",
|
||||
value = "UUID of the ApplicationEntity Release",
|
||||
required = true)
|
||||
@PathParam("uuid") String applicationUuid,
|
||||
@ApiParam(
|
||||
|
||||
@ -23,15 +23,18 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
|
||||
import org.wso2.carbon.device.application.mgt.common.*;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationReleaseEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.LifecycleStateEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException;
|
||||
import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.ValidationException;
|
||||
import org.wso2.carbon.device.application.mgt.core.util.APIUtil;
|
||||
import org.wso2.carbon.device.application.mgt.publisher.api.services.ApplicationManagementAPI;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
||||
import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException;
|
||||
@ -39,8 +42,10 @@ import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.Map;
|
||||
import javax.activation.DataHandler;
|
||||
import javax.validation.Valid;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
@ -56,7 +61,7 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* Implementation of Application Management related APIs.
|
||||
* Implementation of ApplicationEntity Management related APIs.
|
||||
*/
|
||||
@Produces({"application/json"})
|
||||
@Path("/applications")
|
||||
@ -81,9 +86,9 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
|
||||
try {
|
||||
Filter filter = APIUtil
|
||||
.constructFilter(deviceType, appName, appType, appCategory, isFullMatch, releaseState, offset,
|
||||
.constructFilter(appName, appType, appCategory, isFullMatch, releaseState, offset,
|
||||
limit, sortBy);
|
||||
ApplicationList applications = applicationManager.getApplications(filter);
|
||||
ApplicationList applications = applicationManager.getApplications(filter, deviceType);
|
||||
if (applications.getApplications().isEmpty()) {
|
||||
return Response.status(Response.Status.NOT_FOUND)
|
||||
.entity("Couldn't find any application for the requested query.").build();
|
||||
@ -108,10 +113,10 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@DefaultValue("PUBLISHED") @QueryParam("state") String state) {
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
try {
|
||||
Application application = applicationManager.getApplicationById(appId, state);
|
||||
ApplicationEntity application = applicationManager.getApplicationById(appId, state);
|
||||
return Response.status(Response.Status.OK).entity(application).build();
|
||||
} catch (NotFoundException e) {
|
||||
String msg = "Application with application id: " + appId + " not found";
|
||||
String msg = "ApplicationEntity with application id: " + appId + " not found";
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
|
||||
} catch (ApplicationManagementException e) {
|
||||
@ -124,7 +129,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@POST
|
||||
@Consumes("multipart/mixed")
|
||||
public Response createApplication(
|
||||
@Multipart("application") Application application,
|
||||
@Multipart("application") ApplicationWrapper applicationWrapper,
|
||||
@Multipart("binaryFile") Attachment binaryFile,
|
||||
@Multipart("icon") Attachment iconFile,
|
||||
@Multipart("banner") Attachment bannerFile,
|
||||
@ -133,6 +138,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@Multipart("screenshot3") Attachment screenshot3) {
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
List<Attachment> attachmentList = new ArrayList<>();
|
||||
|
||||
if (screenshot1 != null) {
|
||||
attachmentList.add(screenshot1);
|
||||
}
|
||||
@ -144,13 +150,15 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
}
|
||||
|
||||
try {
|
||||
applicationManager
|
||||
.validateAppCreatingRequest(applicationWrapper, binaryFile, iconFile, bannerFile, attachmentList);
|
||||
// Created new application entry
|
||||
Application createdApplication = applicationManager
|
||||
.createApplication(application, binaryFile, iconFile, bannerFile, attachmentList);
|
||||
ApplicationEntity createdApplication = applicationManager.createApplication(applicationWrapper,
|
||||
constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList));
|
||||
if (createdApplication != null) {
|
||||
return Response.status(Response.Status.CREATED).entity(createdApplication).build();
|
||||
} else {
|
||||
String msg = "Application creation is failed";
|
||||
String msg = "ApplicationEntity creation is failed";
|
||||
log.error(msg);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
}
|
||||
@ -165,91 +173,91 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Consumes("multipart/mixed")
|
||||
@Path("/{deviceType}/{appType}/{appId}")
|
||||
public Response createRelease(
|
||||
@PathParam("deviceType") String deviceType,
|
||||
@PathParam("appType") String appType,
|
||||
@PathParam("appId") int appId,
|
||||
@Multipart("applicationRelease") ApplicationRelease applicationRelease,
|
||||
@Multipart("binaryFile") Attachment binaryFile,
|
||||
@Multipart("icon") Attachment iconFile,
|
||||
@Multipart("banner") Attachment bannerFile,
|
||||
@Multipart("screenshot1") Attachment screenshot1,
|
||||
@Multipart("screenshot2") Attachment screenshot2,
|
||||
@Multipart("screenshot3") Attachment screenshot3) {
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
||||
InputStream iconFileStream;
|
||||
InputStream bannerFileStream;
|
||||
List<InputStream> attachments = new ArrayList<>();
|
||||
List<Attachment> attachmentList = new ArrayList<>();
|
||||
attachmentList.add(screenshot1);
|
||||
if (screenshot2 != null) {
|
||||
attachmentList.add(screenshot2);
|
||||
}
|
||||
if (screenshot3 != null) {
|
||||
attachmentList.add(screenshot3);
|
||||
}
|
||||
|
||||
try {
|
||||
applicationManager
|
||||
.validateReleaseCreatingRequest(applicationRelease, appType, binaryFile, iconFile, bannerFile,
|
||||
attachmentList);
|
||||
|
||||
// The application executable artifacts such as apks are uploaded.
|
||||
if (!ApplicationType.ENTERPRISE.toString().equals(appType)) {
|
||||
applicationRelease = applicationStorageManager
|
||||
.uploadReleaseArtifact(applicationRelease, appType, deviceType, null);
|
||||
} else {
|
||||
applicationRelease = applicationStorageManager
|
||||
.uploadReleaseArtifact(applicationRelease, appType, deviceType,
|
||||
binaryFile.getDataHandler().getInputStream());
|
||||
if (applicationRelease.getAppStoredLoc() == null || applicationRelease.getAppHashValue() == null) {
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
}
|
||||
}
|
||||
|
||||
iconFileStream = iconFile.getDataHandler().getInputStream();
|
||||
bannerFileStream = bannerFile.getDataHandler().getInputStream();
|
||||
|
||||
for (Attachment screenshot : attachmentList) {
|
||||
attachments.add(screenshot.getDataHandler().getInputStream());
|
||||
}
|
||||
|
||||
// Upload images
|
||||
applicationRelease = applicationStorageManager
|
||||
.uploadImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
||||
applicationRelease.setUuid(UUID.randomUUID().toString());
|
||||
|
||||
// Created new application release entry
|
||||
ApplicationRelease release = applicationManager.createRelease(appId, applicationRelease);
|
||||
if (release != null) {
|
||||
return Response.status(Response.Status.CREATED).entity(release).build();
|
||||
} else {
|
||||
log.error("Application Creation Failed");
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
}
|
||||
} catch (ApplicationManagementException e) {
|
||||
String msg = "Error occurred while creating the application";
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
} catch (ResourceManagementException e) {
|
||||
String msg = "Error occurred while uploading the releases artifacts of the application ID: " + appId;
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
} catch (IOException e) {
|
||||
String msg = "Error while uploading binary file and resources for the application release of the "
|
||||
+ "application ID: " + appId;
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
} catch (RequestValidatingException e) {
|
||||
String msg = "Error occurred while handling the application creating request";
|
||||
log.error(msg, e);
|
||||
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
|
||||
}
|
||||
}
|
||||
// @POST
|
||||
// @Consumes("multipart/mixed")
|
||||
// @Path("/{deviceType}/{appType}/{appId}")
|
||||
// public Response createRelease(
|
||||
// @PathParam("deviceType") String deviceType,
|
||||
// @PathParam("appType") String appType,
|
||||
// @PathParam("appId") int appId,
|
||||
// @Multipart("applicationRelease") ApplicationReleaseEntity applicationRelease,
|
||||
// @Multipart("binaryFile") Attachment binaryFile,
|
||||
// @Multipart("icon") Attachment iconFile,
|
||||
// @Multipart("banner") Attachment bannerFile,
|
||||
// @Multipart("screenshot1") Attachment screenshot1,
|
||||
// @Multipart("screenshot2") Attachment screenshot2,
|
||||
// @Multipart("screenshot3") Attachment screenshot3) {
|
||||
// ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
// ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
||||
// InputStream iconFileStream;
|
||||
// InputStream bannerFileStream;
|
||||
// List<InputStream> attachments = new ArrayList<>();
|
||||
// List<Attachment> attachmentList = new ArrayList<>();
|
||||
// attachmentList.add(screenshot1);
|
||||
// if (screenshot2 != null) {
|
||||
// attachmentList.add(screenshot2);
|
||||
// }
|
||||
// if (screenshot3 != null) {
|
||||
// attachmentList.add(screenshot3);
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// applicationManager
|
||||
// .validateReleaseCreatingRequest(applicationRelease, appType, binaryFile, iconFile, bannerFile,
|
||||
// attachmentList);
|
||||
//
|
||||
// // The application executable artifacts such as apks are uploaded.
|
||||
// if (!ApplicationType.ENTERPRISE.toString().equals(appType)) {
|
||||
// applicationRelease = applicationStorageManager
|
||||
// .uploadReleaseArtifact(applicationRelease, appType, deviceType, null);
|
||||
// } else {
|
||||
// applicationRelease = applicationStorageManager
|
||||
// .uploadReleaseArtifact(applicationRelease, appType, deviceType,
|
||||
// binaryFile.getDataHandler().getInputStream());
|
||||
// if (applicationRelease.getInstallerName() == null || applicationRelease.getAppHashValue() == null) {
|
||||
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// iconFileStream = iconFile.getDataHandler().getInputStream();
|
||||
// bannerFileStream = bannerFile.getDataHandler().getInputStream();
|
||||
//
|
||||
// for (Attachment screenshot : attachmentList) {
|
||||
// attachments.add(screenshot.getDataHandler().getInputStream());
|
||||
// }
|
||||
//
|
||||
// // Upload images
|
||||
// applicationRelease = applicationStorageManager
|
||||
// .uploadImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
||||
// applicationRelease.setUuid(UUID.randomUUID().toString());
|
||||
//
|
||||
// // Created new application release entry
|
||||
// ApplicationReleaseEntity release = applicationManager.createRelease(appId, applicationRelease);
|
||||
// if (release != null) {
|
||||
// return Response.status(Response.Status.CREATED).entity(release).build();
|
||||
// } else {
|
||||
// log.error("ApplicationEntity Creation Failed");
|
||||
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||
// }
|
||||
// } catch (ApplicationManagementException e) {
|
||||
// String msg = "Error occurred while creating the application";
|
||||
// log.error(msg, e);
|
||||
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
// } catch (ResourceManagementException e) {
|
||||
// String msg = "Error occurred while uploading the releases artifacts of the application ID: " + appId;
|
||||
// log.error(msg, e);
|
||||
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
// } catch (IOException e) {
|
||||
// String msg = "Error while uploading binary file and resources for the application release of the "
|
||||
// + "application ID: " + appId;
|
||||
// log.error(msg, e);
|
||||
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||
// } catch (RequestValidatingException e) {
|
||||
// String msg = "Error occurred while handling the application creating request";
|
||||
// log.error(msg, e);
|
||||
// return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
@PUT
|
||||
@ -328,7 +336,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
+ applicationReleaseUuid).build();
|
||||
}
|
||||
if (!ApplicationType.ENTERPRISE.toString().equals(appType)) {
|
||||
return Response.status(Response.Status.BAD_REQUEST).entity("If Application type is " + appType
|
||||
return Response.status(Response.Status.BAD_REQUEST).entity("If ApplicationEntity type is " + appType
|
||||
+ ", therefore you don't have application release artifact to update for application release UUID: "
|
||||
+ applicationReleaseUuid).build();
|
||||
}
|
||||
@ -361,7 +369,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@Path("/{appId}")
|
||||
public Response updateApplication(
|
||||
@PathParam("appId") int applicationId,
|
||||
@Valid Application application) {
|
||||
@Valid ApplicationEntity application) {
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
try {
|
||||
application = applicationManager.updateApplication(applicationId, application);
|
||||
@ -386,7 +394,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@PathParam("deviceType") String deviceType,
|
||||
@PathParam("appId") int applicationId,
|
||||
@PathParam("uuid") String applicationUUID,
|
||||
@Multipart("applicationRelease") ApplicationRelease applicationRelease,
|
||||
@Multipart("applicationRelease") ApplicationReleaseEntity applicationRelease,
|
||||
@Multipart("binaryFile") Attachment binaryFile,
|
||||
@Multipart("icon") Attachment iconFile,
|
||||
@Multipart("banner") Attachment bannerFile,
|
||||
@ -425,12 +433,12 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
.updateRelease(applicationId, applicationUUID, deviceType, applicationRelease, binaryFileStram,
|
||||
iconFileStream, bannerFileStream, attachments);
|
||||
if (!status){
|
||||
log.error("Application release updating is failed. Please contact the administrator. Application id: "
|
||||
+ applicationId + ", Application release UUID: " + applicationUUID + ", Supported device type: "
|
||||
log.error("ApplicationEntity release updating is failed. Please contact the administrator. ApplicationEntity id: "
|
||||
+ applicationId + ", ApplicationEntity release UUID: " + applicationUUID + ", Supported device type: "
|
||||
+ deviceType);
|
||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(applicationRelease).build();
|
||||
}
|
||||
return Response.status(Response.Status.OK).entity("Application release is successfully updated.").build();
|
||||
return Response.status(Response.Status.OK).entity("ApplicationEntity release is successfully updated.").build();
|
||||
} catch(BadRequestException e){
|
||||
String msg = "Invalid request to update application release for application release UUID " + applicationUUID;
|
||||
log.error(msg, e);
|
||||
@ -527,7 +535,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
public Response getLifecycleState(
|
||||
@PathParam("appId") int applicationId,
|
||||
@PathParam("uuid") String applicationUuid) {
|
||||
LifecycleState lifecycleState;
|
||||
LifecycleStateEntity lifecycleState;
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
try {
|
||||
lifecycleState = applicationManager.getLifecycleState(applicationId, applicationUuid);
|
||||
@ -558,7 +566,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
log.error(msg);
|
||||
return Response.status(Response.Status.BAD_REQUEST).build();
|
||||
}
|
||||
LifecycleState state = new LifecycleState();
|
||||
LifecycleStateEntity state = new LifecycleStateEntity();
|
||||
state.setCurrentState(action);
|
||||
applicationManager.changeLifecycleState(applicationId, applicationUuid, state);
|
||||
} catch (NotFoundException e) {
|
||||
@ -574,4 +582,106 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
return Response.status(Response.Status.CREATED).entity("Lifecycle state added successfully.").build();
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param binaryFile binary file of the application release
|
||||
* @param iconFile icon file of the application release
|
||||
* @param bannerFile banner file of the application release
|
||||
* @param attachmentList list of screenshot of the application release
|
||||
* @return {@link ApplicationArtifact}
|
||||
* @throws ApplicationManagementException if an error occurs when reading the attached data.
|
||||
*/
|
||||
private ApplicationArtifact constructApplicationArtifact(Attachment binaryFile, Attachment iconFile,
|
||||
Attachment bannerFile, List<Attachment> attachmentList) throws ApplicationManagementException {
|
||||
try {
|
||||
ApplicationArtifact applicationArtifact = new ApplicationArtifact();
|
||||
DataHandler dataHandler;
|
||||
if (binaryFile != null) {
|
||||
dataHandler = binaryFile.getDataHandler();
|
||||
InputStream installerStream = dataHandler.getInputStream();
|
||||
String installerFileName = dataHandler.getName();
|
||||
if (installerStream == null) {
|
||||
String msg = "Stream of the application release installer is null. Hence can't proceed. Please "
|
||||
+ "verify the installer file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
if (installerFileName == null) {
|
||||
String msg = "Installer file name retrieving is failed.. Hence can't proceed. Please verify the "
|
||||
+ "installer file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
applicationArtifact.setInstallerName(installerFileName);
|
||||
applicationArtifact.setInstallerStream(installerStream);
|
||||
}
|
||||
|
||||
dataHandler = iconFile.getDataHandler();
|
||||
String iconFileName = dataHandler.getName();
|
||||
InputStream iconStream = dataHandler.getInputStream();
|
||||
|
||||
if (iconStream == null) {
|
||||
String msg = "Stream of the application release icon is null. Hence can't proceed. Please "
|
||||
+ "verify the uploaded icon file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
if (iconFileName == null) {
|
||||
String msg =
|
||||
"Icon file name retrieving is failed.. Hence can't proceed. Please verify the " + "icon file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
applicationArtifact.setIconName(iconFileName);
|
||||
applicationArtifact.setIconStream(iconStream);
|
||||
|
||||
dataHandler = bannerFile.getDataHandler();
|
||||
String bannerFileName = dataHandler.getName();
|
||||
InputStream bannerStream = dataHandler.getInputStream();
|
||||
if (bannerStream == null) {
|
||||
String msg = "Stream of the application release banner is null. Hence can't proceed. Please "
|
||||
+ "verify the uploaded banner file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
if (bannerFileName == null) {
|
||||
String msg = "Banner file name retrieving is failed.. Hence can't proceed. Please verify the "
|
||||
+ "banner file.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
applicationArtifact.setBannername(bannerFileName);
|
||||
applicationArtifact.setBannerStream(bannerStream);
|
||||
|
||||
Map<String, InputStream> scrrenshotData = new HashMap<>();
|
||||
for (Attachment sc : attachmentList) {
|
||||
dataHandler = sc.getDataHandler();
|
||||
String screenshotrFileName = dataHandler.getName();
|
||||
InputStream screenshotStream = dataHandler.getInputStream();
|
||||
if (screenshotStream == null) {
|
||||
String msg =
|
||||
"Stream of one of the application release screenshot is null. Hence can't proceed. Please "
|
||||
+ "verify the uploaded screenshots.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
if (screenshotrFileName == null) {
|
||||
String msg =
|
||||
"Screenshot file name retrieving is failed for one screenshot. Hence can't proceed. Please verify the "
|
||||
+ "screenshots.";
|
||||
log.error(msg);
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
scrrenshotData.put(screenshotrFileName, screenshotStream);
|
||||
}
|
||||
applicationArtifact.setScreenshots(scrrenshotData);
|
||||
return applicationArtifact;
|
||||
} catch (IOException e) {
|
||||
String msg = "Error occurred when reading attachment data.";
|
||||
log.error(msg, e);
|
||||
throw new ApplicationManagementException(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<PermissionConfiguration>
|
||||
<APIVersion></APIVersion>
|
||||
|
||||
<!-- Application related permissions -->
|
||||
<!-- ApplicationEntity related permissions -->
|
||||
<Permission>
|
||||
<name>Get Application Details</name>
|
||||
<path>/device-mgt/application/get</path>
|
||||
|
||||
@ -1841,7 +1841,7 @@ c29.2568 87.7715 113.371 149.942 212.114 149.942z" />
|
||||
d="M512 411.429v-413.257h-512v413.257h512zM138.972 257.828h175.543v87.7715h-175.543v-87.7715zM318.172 213.942h-175.543v-65.8281h175.543v65.8281zM142.629 42.0576h175.543v65.8281h-175.543v-65.8281zM43.8857 345.6v-87.7715h54.8574v87.7715h-54.8574z
|
||||
M362.058 257.828h106.057v87.7715h-106.057v-87.7715zM95.0859 148.114v65.8281h-54.8574v-65.8281h54.8574zM362.058 148.114h106.057v65.8281h-106.057v-65.8281zM43.8857 104.229v-65.8281h54.8574v65.8281h-54.8574zM468.114 104.229h-106.057v-65.8281h106.057v65.8281
|
||||
z" />
|
||||
<glyph glyph-name="tag" unicode=""
|
||||
<glyph glyph-name="tagEntity" unicode=""
|
||||
d="M336.724 352.915l175.542 -179.201l-171.886 -182.856l-193.828 182.856l-32.916 128l32.916 36.5723c-7.31543 3.65625 -10.9717 3.65625 -14.6299 3.65625c-10.9707 -3.65625 -25.5986 -10.9717 -32.9131 -18.2861
|
||||
c-10.9707 -14.627 -10.9707 -29.2568 -10.9707 -47.542c0 -18.2861 3.65625 -36.5723 7.3125 -54.8574c0 0 21.9443 -80.458 -40.2275 -87.7705c-62.1719 0 -54.8574 87.7705 -54.8574 87.7705v25.6006v7.31445c0 14.627 3.65625 29.2568 10.9707 43.8857
|
||||
c21.9443 62.1699 91.4287 84.1143 128 73.1436c10.9717 0 21.9443 -3.65918 29.2568 -7.31543l25.6006 25.6006zM62.4375 250.514c-3.29199 27.4287 5.85059 73.5088 9.87305 79.7275c-32.1807 -25.6006 -42.7881 -61.4424 -46.4443 -72.4131
|
||||
|
||||
|
Before Width: | Height: | Size: 443 KiB After Width: | Height: | Size: 443 KiB |
@ -31,7 +31,7 @@ import io.swagger.annotations.Tag;
|
||||
import org.wso2.carbon.apimgt.annotations.api.Scope;
|
||||
import org.wso2.carbon.apimgt.annotations.api.Scopes;
|
||||
import org.wso2.carbon.device.application.mgt.common.ErrorResponse;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
@ -49,7 +49,7 @@ import javax.ws.rs.core.Response;
|
||||
@SwaggerDefinition(
|
||||
info = @Info(
|
||||
version = "1.0.0",
|
||||
title = "Application Storage Management Service",
|
||||
title = "ApplicationEntity Storage Management Service",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = "name", value = "ApplicationStorageManagementService"),
|
||||
@ -58,14 +58,14 @@ import javax.ws.rs.core.Response;
|
||||
}
|
||||
),
|
||||
tags = {
|
||||
@Tag(name = "application_management, device_management", description = "Application Storage Management "
|
||||
@Tag(name = "application_management, device_management", description = "ApplicationEntity Storage Management "
|
||||
+ "related APIs")
|
||||
}
|
||||
)
|
||||
@Scopes(
|
||||
scopes = {
|
||||
@Scope(
|
||||
name = "Get Application Details",
|
||||
name = "Get ApplicationEntity Details",
|
||||
description = "Get application details",
|
||||
key = "perm:app:store:view",
|
||||
permissions = {"/device-mgt/application/get"}
|
||||
@ -73,7 +73,7 @@ import javax.ws.rs.core.Response;
|
||||
}
|
||||
)
|
||||
@Path("/store/applications")
|
||||
@Api(value = "Application Management", description = "This API carries all app store management related operations " +
|
||||
@Api(value = "ApplicationEntity Management", description = "This API carries all app store management related operations " +
|
||||
"such as get all the applications etc.")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface ApplicationManagementAPI {
|
||||
@ -89,7 +89,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "GET",
|
||||
value = "get all applications",
|
||||
notes = "This will get all applications",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:application:get")
|
||||
@ -121,7 +121,7 @@ public interface ApplicationManagementAPI {
|
||||
@QueryParam("type") String appType,
|
||||
@ApiParam(
|
||||
name = "category",
|
||||
value = "Category of the application")
|
||||
value = "CategoryEntity of the application")
|
||||
@QueryParam("category") String appCategory,
|
||||
@ApiParam(
|
||||
name = "exact-match",
|
||||
@ -152,7 +152,7 @@ public interface ApplicationManagementAPI {
|
||||
httpMethod = "GET",
|
||||
value = "get the application of requesting application type",
|
||||
notes = "This will get the application identified by the application type and name, if exists",
|
||||
tags = "Application Management",
|
||||
tags = "ApplicationEntity Management",
|
||||
extensions = {
|
||||
@Extension(properties = {
|
||||
@ExtensionProperty(name = SCOPE, value = "perm:application:get")
|
||||
@ -164,10 +164,10 @@ public interface ApplicationManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully retrieved relevant application.",
|
||||
response = Application.class),
|
||||
response = ApplicationEntity.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Application not found"),
|
||||
message = "ApplicationEntity not found"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Error occurred while getting relevant application.",
|
||||
|
||||
@ -28,7 +28,7 @@ import io.swagger.annotations.Info;
|
||||
import io.swagger.annotations.SwaggerDefinition;
|
||||
import io.swagger.annotations.Tag;
|
||||
import org.wso2.carbon.apimgt.annotations.api.Scopes;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse;
|
||||
import org.wso2.carbon.device.application.mgt.common.EnterpriseInstallationDetails;
|
||||
import org.wso2.carbon.device.application.mgt.common.InstallationDetails;
|
||||
@ -65,13 +65,13 @@ import javax.ws.rs.core.Response;
|
||||
@Scopes(
|
||||
scopes = {
|
||||
@org.wso2.carbon.apimgt.annotations.api.Scope(
|
||||
name = "Install an Application",
|
||||
name = "Install an ApplicationEntity",
|
||||
description = "Install an application",
|
||||
key = "perm:subscription:install",
|
||||
permissions = {"/device-mgt/subscription/install"}
|
||||
),
|
||||
@org.wso2.carbon.apimgt.annotations.api.Scope(
|
||||
name = "Install an Application",
|
||||
name = "Install an ApplicationEntity",
|
||||
description = "Install an application",
|
||||
key = "perm:application-mgt:login",
|
||||
permissions = {"/device-mgt/application-mgt/login"}
|
||||
@ -117,7 +117,7 @@ public interface SubscriptionManagementAPI {
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Application cannot be found to install."
|
||||
message = "Not Found. \n ApplicationEntity cannot be found to install."
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -162,7 +162,7 @@ public interface SubscriptionManagementAPI {
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Application cannot be found to install."
|
||||
message = "Not Found. \n ApplicationEntity cannot be found to install."
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -198,7 +198,7 @@ public interface SubscriptionManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully uninstalled the application.",
|
||||
response = Application.class
|
||||
response = ApplicationEntity.class
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
@ -206,7 +206,7 @@ public interface SubscriptionManagementAPI {
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Application cannot be found to uninstall."
|
||||
message = "Not Found. \n ApplicationEntity cannot be found to uninstall."
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -242,7 +242,7 @@ public interface SubscriptionManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully uninstalled the application.",
|
||||
response = Application.class
|
||||
response = ApplicationEntity.class
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
@ -250,7 +250,7 @@ public interface SubscriptionManagementAPI {
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Application cannot be found to uninstall."
|
||||
message = "Not Found. \n ApplicationEntity cannot be found to uninstall."
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -287,7 +287,7 @@ public interface SubscriptionManagementAPI {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully installed the application.",
|
||||
response = Application.class
|
||||
response = ApplicationEntity.class
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
@ -302,7 +302,7 @@ public interface SubscriptionManagementAPI {
|
||||
Response getApplication(
|
||||
@ApiParam(
|
||||
name = "applicationUUID",
|
||||
value = "Application ID"
|
||||
value = "ApplicationEntity ID"
|
||||
)
|
||||
@QueryParam("applicationUUID") String applicationUUID,
|
||||
@ApiParam(
|
||||
|
||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.application.mgt.store.api.services.impl;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.application.mgt.common.AppLifecycleState;
|
||||
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||
import org.wso2.carbon.device.application.mgt.common.entity.ApplicationEntity;
|
||||
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||
import org.wso2.carbon.device.application.mgt.common.Filter;
|
||||
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
|
||||
@ -77,7 +77,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
if (appCategory != null && !appCategory.isEmpty()) {
|
||||
filter.setAppCategory(appCategory);
|
||||
}
|
||||
ApplicationList applications = applicationManager.getApplications(filter);
|
||||
ApplicationList applications = applicationManager.getApplications(filter, null);
|
||||
if (applications.getApplications().isEmpty()) {
|
||||
return Response.status(Response.Status.NOT_FOUND)
|
||||
.entity("Couldn't find any application for requested query.").build();
|
||||
@ -97,7 +97,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
||||
@PathParam("uuid") String uuid) {
|
||||
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
||||
try {
|
||||
Application application = applicationManager
|
||||
ApplicationEntity application = applicationManager
|
||||
.getApplicationByUuid(uuid, AppLifecycleState.PUBLISHED.toString());
|
||||
return Response.status(Response.Status.OK).entity(application).build();
|
||||
} catch (NotFoundException e) {
|
||||
|
||||
@ -48,7 +48,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
|
||||
@Override
|
||||
@POST
|
||||
@Path("/install-application")
|
||||
public Response installApplication(@ApiParam(name = "installationDetails", value = "Application ID and list of" +
|
||||
public Response installApplication(@ApiParam(name = "installationDetails", value = "ApplicationEntity ID and list of" +
|
||||
"devices", required = true) @Valid InstallationDetails installationDetails) {
|
||||
SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager();
|
||||
String applicationUUID = installationDetails.getApplicationUUID();
|
||||
@ -81,7 +81,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
|
||||
ApplicationInstallResponse response;
|
||||
|
||||
if (applicationUUID.isEmpty()) {
|
||||
msg = "Application UUID is empty in the incoming request. Therefore unable to proceed with the "
|
||||
msg = "ApplicationEntity UUID is empty in the incoming request. Therefore unable to proceed with the "
|
||||
+ "installation.";
|
||||
log.error(msg);
|
||||
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
|
||||
@ -128,7 +128,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response getApplication(@ApiParam(name = "applicationUUID", value = "Application ID") String
|
||||
public Response getApplication(@ApiParam(name = "applicationUUID", value = "ApplicationEntity ID") String
|
||||
applicationUUID, @ApiParam(name = "deviceId", value = "The device ID")
|
||||
String deviceId) {
|
||||
return null;
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<PermissionConfiguration>
|
||||
<APIVersion></APIVersion>
|
||||
|
||||
<!-- Application related permissions -->
|
||||
<!-- ApplicationEntity related permissions -->
|
||||
<Permission>
|
||||
<name>Get Application</name>
|
||||
<path>/device-mgt/application/get</path>
|
||||
|
||||
@ -28,12 +28,31 @@
|
||||
</parent>
|
||||
<artifactId>org.wso2.carbon.device.application.mgt.store.ui</artifactId>
|
||||
<version>3.2.2-SNAPSHOT</version>
|
||||
|
||||
<packaging>war</packaging>
|
||||
<name>WSO2 Carbon - Application Management Store UI Component</name>
|
||||
<url>http://wso2.org</url>
|
||||
<description>This Component contains Application Management store UI</description>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<packagingExcludes>WEB-INF/lib/*cxf*.jar</packagingExcludes>
|
||||
<warName>store</warName>
|
||||
<webResources>
|
||||
<resource>
|
||||
<directory>${npm.output.directory}/dist</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${npm.output.directory}/public</directory>
|
||||
<targetPath>public</targetPath>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
@ -46,10 +65,11 @@
|
||||
</goals>
|
||||
<phase>initialize</phase>
|
||||
<configuration>
|
||||
<workingDirectory>${basedir}/src/main/resources/store</workingDirectory>
|
||||
<workingDirectory>react-app</workingDirectory>
|
||||
<executable>${npm.executable}</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
<argument>--silent</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -60,7 +80,7 @@
|
||||
</goals>
|
||||
<phase>compile</phase>
|
||||
<configuration>
|
||||
<workingDirectory>${basedir}/src/main/resources/store</workingDirectory>
|
||||
<workingDirectory>react-app</workingDirectory>
|
||||
<executable>${npm.executable}</executable>
|
||||
<arguments>
|
||||
<argument>run</argument>
|
||||
@ -73,7 +93,6 @@
|
||||
<workingDirectory>${npm.working.dir}</workingDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
@ -94,6 +113,8 @@
|
||||
<maven.test.skip>false</maven.test.skip>
|
||||
<npm.executable>npm</npm.executable>
|
||||
<npm.build.command>build_prod</npm.build.command>
|
||||
<npm.working.dir>./src/main/</npm.working.dir>
|
||||
<npm.working.dir>./react-app</npm.working.dir>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<npm.output.directory>react-app</npm.output.directory>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
module.exports = function (api) {
|
||||
api.cache(true);
|
||||
const presets = [ "@babel/preset-env",
|
||||
"@babel/preset-react" ];
|
||||
const plugins = ["@babel/plugin-proposal-class-properties"];
|
||||
|
||||
return {
|
||||
presets,
|
||||
plugins
|
||||
};
|
||||
};
|
||||
@ -0,0 +1,71 @@
|
||||
{
|
||||
"name": "store",
|
||||
"version": "1.0.0",
|
||||
"description": "WSO2 IoT Server App Publisher",
|
||||
"main": "App.js",
|
||||
"proxy": "http://localhost:3001",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/wso2/carbon-devicemgt"
|
||||
},
|
||||
"license": "Apache License 2.0",
|
||||
"dependencies": {
|
||||
"acorn": "^6.1.1",
|
||||
"antd": "^3.15.0",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4",
|
||||
"react-router-config": "^5.0.0",
|
||||
"react-router-dom": "latest",
|
||||
"react-scripts": "2.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"babel-loader": "^8.0.0",
|
||||
"body-parser": "^1.18.3",
|
||||
"chai": "^4.1.2",
|
||||
"css-loader": "^0.28.11",
|
||||
"express": "^4.16.4",
|
||||
"express-pino-logger": "^4.0.0",
|
||||
"file-loader": "^2.0.0",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"img-loader": "^3.0.1",
|
||||
"less": "^3.9.0",
|
||||
"less-loader": "^4.1.0",
|
||||
"mini-css-extract-plugin": "^0.5.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mock-local-storage": "^1.0.5",
|
||||
"node-env-run": "^3.0.2",
|
||||
"node-sass": "^4.11.0",
|
||||
"nodemon": "^1.18.9",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"pino-colada": "^1.4.4",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"react": "^15.6.2",
|
||||
"react-dom": "^15.6.2",
|
||||
"react-intl": "^2.4.0",
|
||||
"redux": "^4.0.1",
|
||||
"sass-loader": "^6.0.7",
|
||||
"style-loader": "^0.18.2",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^4.27.1",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-server": "^3.1.10"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server --mode development --open",
|
||||
"dev": "webpack --mode development",
|
||||
"build": "webpack --mode production",
|
||||
"watch": "webpack --watch --mode development",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules",
|
||||
"build_dev": "NODE_ENV=development webpack -d --watch ",
|
||||
"server": "node-env-run server --exec nodemon | pino-colada",
|
||||
"dev2": "run-p server start"
|
||||
}
|
||||
}
|
||||
@ -7,5 +7,6 @@
|
||||
"hostname": "localhost",
|
||||
"httpsPort": "9443",
|
||||
"apiPort": "8243"
|
||||
}
|
||||
},
|
||||
"serverUrl" : "https://localhost:9443"
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"short_name": "App Store",
|
||||
"name": "WSO2 IoT App Store",
|
||||
"short_name": "App Publisher",
|
||||
"name": "WSO2 IoT App Publisher",
|
||||
"icons": [
|
||||
{
|
||||
"src": "images/favicon.png",
|
||||
@ -1841,7 +1841,7 @@ c29.2568 87.7715 113.371 149.942 212.114 149.942z" />
|
||||
d="M512 411.429v-413.257h-512v413.257h512zM138.972 257.828h175.543v87.7715h-175.543v-87.7715zM318.172 213.942h-175.543v-65.8281h175.543v65.8281zM142.629 42.0576h175.543v65.8281h-175.543v-65.8281zM43.8857 345.6v-87.7715h54.8574v87.7715h-54.8574z
|
||||
M362.058 257.828h106.057v87.7715h-106.057v-87.7715zM95.0859 148.114v65.8281h-54.8574v-65.8281h54.8574zM362.058 148.114h106.057v65.8281h-106.057v-65.8281zM43.8857 104.229v-65.8281h54.8574v65.8281h-54.8574zM468.114 104.229h-106.057v-65.8281h106.057v65.8281
|
||||
z" />
|
||||
<glyph glyph-name="tag" unicode=""
|
||||
<glyph glyph-name="tagEntity" unicode=""
|
||||
d="M336.724 352.915l175.542 -179.201l-171.886 -182.856l-193.828 182.856l-32.916 128l32.916 36.5723c-7.31543 3.65625 -10.9717 3.65625 -14.6299 3.65625c-10.9707 -3.65625 -25.5986 -10.9717 -32.9131 -18.2861
|
||||
c-10.9707 -14.627 -10.9707 -29.2568 -10.9707 -47.542c0 -18.2861 3.65625 -36.5723 7.3125 -54.8574c0 0 21.9443 -80.458 -40.2275 -87.7705c-62.1719 0 -54.8574 87.7705 -54.8574 87.7705v25.6006v7.31445c0 14.627 3.65625 29.2568 10.9707 43.8857
|
||||
c21.9443 62.1699 91.4287 84.1143 128 73.1436c10.9717 0 21.9443 -3.65918 29.2568 -7.31543l25.6006 25.6006zM62.4375 250.514c-3.29199 27.4287 5.85059 73.5088 9.87305 79.7275c-32.1807 -25.6006 -42.7881 -61.4424 -46.4443 -72.4131
|
||||
|
Before Width: | Height: | Size: 443 KiB After Width: | Height: | Size: 443 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,798 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 232 81" style="enable-background:new 0 0 232 81;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
.st1{clip-path:url(#SVGID_2_);fill:#308BD6;}
|
||||
.st2{clip-path:url(#SVGID_2_);fill:#318CD6;}
|
||||
.st3{clip-path:url(#SVGID_2_);fill:#328DD7;}
|
||||
.st4{clip-path:url(#SVGID_2_);fill:#338ED7;}
|
||||
.st5{clip-path:url(#SVGID_2_);fill:#348FD8;}
|
||||
.st6{clip-path:url(#SVGID_2_);fill:#3590D8;}
|
||||
.st7{clip-path:url(#SVGID_2_);fill:#3691D9;}
|
||||
.st8{clip-path:url(#SVGID_2_);fill:#3792D9;}
|
||||
.st9{clip-path:url(#SVGID_2_);fill:#3893DA;}
|
||||
.st10{clip-path:url(#SVGID_2_);fill:#3994DA;}
|
||||
.st11{clip-path:url(#SVGID_2_);fill:#3A95DA;}
|
||||
.st12{clip-path:url(#SVGID_2_);fill:#3B96DB;}
|
||||
.st13{clip-path:url(#SVGID_2_);fill:#3C97DB;}
|
||||
.st14{clip-path:url(#SVGID_2_);fill:#3D98DC;}
|
||||
.st15{clip-path:url(#SVGID_2_);fill:#3E99DC;}
|
||||
.st16{clip-path:url(#SVGID_2_);fill:#3F9ADD;}
|
||||
.st17{clip-path:url(#SVGID_2_);fill:#409BDD;}
|
||||
.st18{clip-path:url(#SVGID_2_);fill:#419CDE;}
|
||||
.st19{clip-path:url(#SVGID_2_);fill:#429DDE;}
|
||||
.st20{clip-path:url(#SVGID_2_);fill:#439EDE;}
|
||||
.st21{clip-path:url(#SVGID_2_);fill:#449FDF;}
|
||||
.st22{clip-path:url(#SVGID_2_);fill:#45A0DF;}
|
||||
.st23{clip-path:url(#SVGID_2_);fill:#46A1E0;}
|
||||
.st24{clip-path:url(#SVGID_2_);fill:#47A2E0;}
|
||||
.st25{clip-path:url(#SVGID_2_);fill:#48A4E1;}
|
||||
.st26{clip-path:url(#SVGID_2_);fill:#49A5E1;}
|
||||
.st27{clip-path:url(#SVGID_2_);fill:#4AA6E2;}
|
||||
.st28{clip-path:url(#SVGID_2_);fill:#4BA7E2;}
|
||||
.st29{clip-path:url(#SVGID_2_);fill:#4CA8E3;}
|
||||
.st30{clip-path:url(#SVGID_2_);fill:#4DA9E3;}
|
||||
.st31{clip-path:url(#SVGID_2_);fill:#4EAAE3;}
|
||||
.st32{clip-path:url(#SVGID_2_);fill:#4FABE4;}
|
||||
.st33{clip-path:url(#SVGID_2_);fill:#50ACE4;}
|
||||
.st34{clip-path:url(#SVGID_2_);fill:#51ADE5;}
|
||||
.st35{clip-path:url(#SVGID_2_);fill:#52AEE5;}
|
||||
.st36{clip-path:url(#SVGID_2_);fill:#53AFE6;}
|
||||
.st37{clip-path:url(#SVGID_2_);fill:#54B0E6;}
|
||||
.st38{clip-path:url(#SVGID_2_);fill:#55B1E7;}
|
||||
.st39{clip-path:url(#SVGID_2_);fill:#56B2E7;}
|
||||
.st40{clip-path:url(#SVGID_2_);fill:#57B3E7;}
|
||||
.st41{clip-path:url(#SVGID_2_);fill:#58B4E8;}
|
||||
.st42{clip-path:url(#SVGID_2_);fill:#59B5E8;}
|
||||
.st43{clip-path:url(#SVGID_2_);fill:#5AB6E9;}
|
||||
.st44{clip-path:url(#SVGID_2_);fill:#5BB7E9;}
|
||||
.st45{clip-path:url(#SVGID_2_);fill:#5CB8EA;}
|
||||
.st46{clip-path:url(#SVGID_2_);fill:#5DB9EA;}
|
||||
.st47{clip-path:url(#SVGID_2_);fill:#5EBAEB;}
|
||||
.st48{clip-path:url(#SVGID_2_);fill:#5FBBEB;}
|
||||
.st49{clip-path:url(#SVGID_4_);fill:#2E5E87;}
|
||||
.st50{clip-path:url(#SVGID_4_);fill:#2E5F88;}
|
||||
.st51{clip-path:url(#SVGID_4_);fill:#2F5F89;}
|
||||
.st52{clip-path:url(#SVGID_4_);fill:#2F608A;}
|
||||
.st53{clip-path:url(#SVGID_4_);fill:#30618B;}
|
||||
.st54{clip-path:url(#SVGID_4_);fill:#30628C;}
|
||||
.st55{clip-path:url(#SVGID_4_);fill:#31628D;}
|
||||
.st56{clip-path:url(#SVGID_4_);fill:#31638E;}
|
||||
.st57{clip-path:url(#SVGID_4_);fill:#31648F;}
|
||||
.st58{clip-path:url(#SVGID_4_);fill:#326590;}
|
||||
.st59{clip-path:url(#SVGID_4_);fill:#326591;}
|
||||
.st60{clip-path:url(#SVGID_4_);fill:#336692;}
|
||||
.st61{clip-path:url(#SVGID_4_);fill:#336793;}
|
||||
.st62{clip-path:url(#SVGID_4_);fill:#346894;}
|
||||
.st63{clip-path:url(#SVGID_4_);fill:#346895;}
|
||||
.st64{clip-path:url(#SVGID_4_);fill:#356996;}
|
||||
.st65{clip-path:url(#SVGID_4_);fill:#356A97;}
|
||||
.st66{clip-path:url(#SVGID_4_);fill:#356B98;}
|
||||
.st67{clip-path:url(#SVGID_4_);fill:#366B99;}
|
||||
.st68{clip-path:url(#SVGID_4_);fill:#366C9A;}
|
||||
.st69{clip-path:url(#SVGID_4_);fill:#376D9B;}
|
||||
.st70{clip-path:url(#SVGID_4_);fill:#376E9C;}
|
||||
.st71{clip-path:url(#SVGID_4_);fill:#386E9D;}
|
||||
.st72{clip-path:url(#SVGID_4_);fill:#386F9E;}
|
||||
.st73{clip-path:url(#SVGID_4_);fill:#38709F;}
|
||||
.st74{clip-path:url(#SVGID_4_);fill:#3971A0;}
|
||||
.st75{clip-path:url(#SVGID_4_);fill:#3971A1;}
|
||||
.st76{clip-path:url(#SVGID_4_);fill:#3A72A2;}
|
||||
.st77{clip-path:url(#SVGID_4_);fill:#3A73A3;}
|
||||
.st78{clip-path:url(#SVGID_4_);fill:#3B74A4;}
|
||||
.st79{clip-path:url(#SVGID_4_);fill:#3B74A5;}
|
||||
.st80{clip-path:url(#SVGID_4_);fill:#3C75A7;}
|
||||
.st81{clip-path:url(#SVGID_4_);fill:#3C76A8;}
|
||||
.st82{clip-path:url(#SVGID_4_);fill:#3C76A9;}
|
||||
.st83{clip-path:url(#SVGID_4_);fill:#3D77AA;}
|
||||
.st84{clip-path:url(#SVGID_4_);fill:#3D78AB;}
|
||||
.st85{clip-path:url(#SVGID_4_);fill:#3E79AC;}
|
||||
.st86{clip-path:url(#SVGID_4_);fill:#3E79AD;}
|
||||
.st87{clip-path:url(#SVGID_4_);fill:#3F7AAE;}
|
||||
.st88{clip-path:url(#SVGID_4_);fill:#3F7BAF;}
|
||||
.st89{clip-path:url(#SVGID_4_);fill:#3F7CB0;}
|
||||
.st90{clip-path:url(#SVGID_4_);fill:#407CB1;}
|
||||
.st91{clip-path:url(#SVGID_4_);fill:#407DB2;}
|
||||
.st92{clip-path:url(#SVGID_4_);fill:#417EB3;}
|
||||
.st93{clip-path:url(#SVGID_4_);fill:#417FB4;}
|
||||
.st94{clip-path:url(#SVGID_4_);fill:#427FB5;}
|
||||
.st95{clip-path:url(#SVGID_4_);fill:#4280B6;}
|
||||
.st96{clip-path:url(#SVGID_4_);fill:#4281B7;}
|
||||
.st97{clip-path:url(#SVGID_4_);fill:#4382B8;}
|
||||
.st98{clip-path:url(#SVGID_4_);fill:#4382B9;}
|
||||
.st99{clip-path:url(#SVGID_4_);fill:#4483BA;}
|
||||
.st100{clip-path:url(#SVGID_4_);fill:#4484BB;}
|
||||
.st101{clip-path:url(#SVGID_4_);fill:#4585BC;}
|
||||
.st102{clip-path:url(#SVGID_4_);fill:#4585BD;}
|
||||
.st103{clip-path:url(#SVGID_4_);fill:#4686BE;}
|
||||
.st104{clip-path:url(#SVGID_4_);fill:#4687BF;}
|
||||
.st105{clip-path:url(#SVGID_4_);fill:#4688C0;}
|
||||
.st106{clip-path:url(#SVGID_4_);fill:#4788C1;}
|
||||
.st107{clip-path:url(#SVGID_4_);fill:#4789C2;}
|
||||
.st108{clip-path:url(#SVGID_4_);fill:#488AC3;}
|
||||
.st109{clip-path:url(#SVGID_4_);fill:#488BC4;}
|
||||
.st110{clip-path:url(#SVGID_4_);fill:#498BC5;}
|
||||
.st111{clip-path:url(#SVGID_4_);fill:#498CC6;}
|
||||
.st112{clip-path:url(#SVGID_6_);fill:#4CE8C6;}
|
||||
.st113{clip-path:url(#SVGID_6_);fill:#4BE8C7;}
|
||||
.st114{clip-path:url(#SVGID_6_);fill:#4AE7C7;}
|
||||
.st115{clip-path:url(#SVGID_6_);fill:#49E7C8;}
|
||||
.st116{clip-path:url(#SVGID_6_);fill:#48E6C8;}
|
||||
.st117{clip-path:url(#SVGID_6_);fill:#47E6C9;}
|
||||
.st118{clip-path:url(#SVGID_6_);fill:#46E6C9;}
|
||||
.st119{clip-path:url(#SVGID_6_);fill:#45E5CA;}
|
||||
.st120{clip-path:url(#SVGID_6_);fill:#44E5CB;}
|
||||
.st121{clip-path:url(#SVGID_6_);fill:#43E4CB;}
|
||||
.st122{clip-path:url(#SVGID_6_);fill:#42E4CC;}
|
||||
.st123{clip-path:url(#SVGID_6_);fill:#41E4CC;}
|
||||
.st124{clip-path:url(#SVGID_6_);fill:#40E3CD;}
|
||||
.st125{clip-path:url(#SVGID_6_);fill:#3FE3CE;}
|
||||
.st126{clip-path:url(#SVGID_6_);fill:#3EE2CE;}
|
||||
.st127{clip-path:url(#SVGID_6_);fill:#3DE2CF;}
|
||||
.st128{clip-path:url(#SVGID_6_);fill:#3CE2CF;}
|
||||
.st129{clip-path:url(#SVGID_6_);fill:#3BE1D0;}
|
||||
.st130{clip-path:url(#SVGID_6_);fill:#3AE1D0;}
|
||||
.st131{clip-path:url(#SVGID_6_);fill:#39E0D1;}
|
||||
.st132{clip-path:url(#SVGID_6_);fill:#38E0D2;}
|
||||
.st133{clip-path:url(#SVGID_6_);fill:#37E0D2;}
|
||||
.st134{clip-path:url(#SVGID_6_);fill:#36DFD3;}
|
||||
.st135{clip-path:url(#SVGID_6_);fill:#35DFD3;}
|
||||
.st136{clip-path:url(#SVGID_6_);fill:#34DED4;}
|
||||
.st137{clip-path:url(#SVGID_6_);fill:#33DED5;}
|
||||
.st138{clip-path:url(#SVGID_6_);fill:#31DED5;}
|
||||
.st139{clip-path:url(#SVGID_6_);fill:#30DDD6;}
|
||||
.st140{clip-path:url(#SVGID_6_);fill:#2FDDD6;}
|
||||
.st141{clip-path:url(#SVGID_6_);fill:#2EDCD7;}
|
||||
.st142{clip-path:url(#SVGID_6_);fill:#2DDCD7;}
|
||||
.st143{clip-path:url(#SVGID_6_);fill:#2CDCD8;}
|
||||
.st144{clip-path:url(#SVGID_6_);fill:#2BDBD9;}
|
||||
.st145{clip-path:url(#SVGID_6_);fill:#2ADBD9;}
|
||||
.st146{clip-path:url(#SVGID_6_);fill:#29DADA;}
|
||||
.st147{clip-path:url(#SVGID_6_);fill:#28DADA;}
|
||||
.st148{clip-path:url(#SVGID_6_);fill:#27DADB;}
|
||||
.st149{clip-path:url(#SVGID_6_);fill:#26D9DB;}
|
||||
.st150{clip-path:url(#SVGID_6_);fill:#25D9DC;}
|
||||
.st151{clip-path:url(#SVGID_6_);fill:#24D8DD;}
|
||||
.st152{clip-path:url(#SVGID_6_);fill:#23D8DD;}
|
||||
.st153{clip-path:url(#SVGID_6_);fill:#22D8DE;}
|
||||
.st154{clip-path:url(#SVGID_6_);fill:#21D7DE;}
|
||||
.st155{clip-path:url(#SVGID_6_);fill:#20D7DF;}
|
||||
.st156{clip-path:url(#SVGID_6_);fill:#1FD6E0;}
|
||||
.st157{clip-path:url(#SVGID_6_);fill:#1ED6E0;}
|
||||
.st158{clip-path:url(#SVGID_6_);fill:#1DD6E1;}
|
||||
.st159{clip-path:url(#SVGID_6_);fill:#1CD5E1;}
|
||||
.st160{clip-path:url(#SVGID_6_);fill:#1BD5E2;}
|
||||
.st161{clip-path:url(#SVGID_6_);fill:#1AD4E2;}
|
||||
.st162{clip-path:url(#SVGID_6_);fill:#19D4E3;}
|
||||
.st163{opacity:0.4;}
|
||||
.st164{clip-path:url(#SVGID_8_);fill:#4CE8C6;}
|
||||
.st165{clip-path:url(#SVGID_8_);fill:#4BE8C7;}
|
||||
.st166{clip-path:url(#SVGID_8_);fill:#4AE7C7;}
|
||||
.st167{clip-path:url(#SVGID_8_);fill:#49E7C8;}
|
||||
.st168{clip-path:url(#SVGID_8_);fill:#48E6C8;}
|
||||
.st169{clip-path:url(#SVGID_8_);fill:#47E6C9;}
|
||||
.st170{clip-path:url(#SVGID_8_);fill:#46E6C9;}
|
||||
.st171{clip-path:url(#SVGID_8_);fill:#45E5CA;}
|
||||
.st172{clip-path:url(#SVGID_8_);fill:#44E5CB;}
|
||||
.st173{clip-path:url(#SVGID_8_);fill:#43E4CB;}
|
||||
.st174{clip-path:url(#SVGID_8_);fill:#42E4CC;}
|
||||
.st175{clip-path:url(#SVGID_8_);fill:#41E4CC;}
|
||||
.st176{clip-path:url(#SVGID_8_);fill:#40E3CD;}
|
||||
.st177{clip-path:url(#SVGID_8_);fill:#3FE3CE;}
|
||||
.st178{clip-path:url(#SVGID_8_);fill:#3EE2CE;}
|
||||
.st179{clip-path:url(#SVGID_8_);fill:#3DE2CF;}
|
||||
.st180{clip-path:url(#SVGID_8_);fill:#3CE2CF;}
|
||||
.st181{clip-path:url(#SVGID_8_);fill:#3BE1D0;}
|
||||
.st182{clip-path:url(#SVGID_8_);fill:#3AE1D0;}
|
||||
.st183{clip-path:url(#SVGID_8_);fill:#39E0D1;}
|
||||
.st184{clip-path:url(#SVGID_8_);fill:#38E0D2;}
|
||||
.st185{clip-path:url(#SVGID_8_);fill:#37E0D2;}
|
||||
.st186{clip-path:url(#SVGID_8_);fill:#36DFD3;}
|
||||
.st187{clip-path:url(#SVGID_8_);fill:#35DFD3;}
|
||||
.st188{clip-path:url(#SVGID_8_);fill:#34DED4;}
|
||||
.st189{clip-path:url(#SVGID_8_);fill:#33DED5;}
|
||||
.st190{clip-path:url(#SVGID_8_);fill:#31DED5;}
|
||||
.st191{clip-path:url(#SVGID_8_);fill:#30DDD6;}
|
||||
.st192{clip-path:url(#SVGID_8_);fill:#2FDDD6;}
|
||||
.st193{clip-path:url(#SVGID_8_);fill:#2EDCD7;}
|
||||
.st194{clip-path:url(#SVGID_8_);fill:#2DDCD7;}
|
||||
.st195{clip-path:url(#SVGID_8_);fill:#2CDCD8;}
|
||||
.st196{clip-path:url(#SVGID_8_);fill:#2BDBD9;}
|
||||
.st197{clip-path:url(#SVGID_8_);fill:#2ADBD9;}
|
||||
.st198{clip-path:url(#SVGID_8_);fill:#29DADA;}
|
||||
.st199{clip-path:url(#SVGID_8_);fill:#28DADA;}
|
||||
.st200{clip-path:url(#SVGID_8_);fill:#27DADB;}
|
||||
.st201{clip-path:url(#SVGID_8_);fill:#26D9DB;}
|
||||
.st202{clip-path:url(#SVGID_8_);fill:#25D9DC;}
|
||||
.st203{clip-path:url(#SVGID_8_);fill:#24D8DD;}
|
||||
.st204{clip-path:url(#SVGID_8_);fill:#23D8DD;}
|
||||
.st205{clip-path:url(#SVGID_8_);fill:#22D8DE;}
|
||||
.st206{clip-path:url(#SVGID_8_);fill:#21D7DE;}
|
||||
.st207{clip-path:url(#SVGID_8_);fill:#20D7DF;}
|
||||
.st208{clip-path:url(#SVGID_8_);fill:#1FD6E0;}
|
||||
.st209{clip-path:url(#SVGID_8_);fill:#1ED6E0;}
|
||||
.st210{clip-path:url(#SVGID_8_);fill:#1DD6E1;}
|
||||
.st211{clip-path:url(#SVGID_8_);fill:#1CD5E1;}
|
||||
.st212{clip-path:url(#SVGID_8_);fill:#1BD5E2;}
|
||||
.st213{clip-path:url(#SVGID_8_);fill:#1AD4E2;}
|
||||
.st214{clip-path:url(#SVGID_8_);fill:#19D4E3;}
|
||||
.st215{opacity:0.5;}
|
||||
.st216{clip-path:url(#SVGID_10_);fill:#316490;}
|
||||
.st217{clip-path:url(#SVGID_10_);fill:#316591;}
|
||||
.st218{clip-path:url(#SVGID_10_);fill:#326692;}
|
||||
.st219{clip-path:url(#SVGID_10_);fill:#326693;}
|
||||
.st220{clip-path:url(#SVGID_10_);fill:#336794;}
|
||||
.st221{clip-path:url(#SVGID_10_);fill:#336895;}
|
||||
.st222{clip-path:url(#SVGID_10_);fill:#346996;}
|
||||
.st223{clip-path:url(#SVGID_10_);fill:#346997;}
|
||||
.st224{clip-path:url(#SVGID_10_);fill:#356A98;}
|
||||
.st225{clip-path:url(#SVGID_10_);fill:#356B99;}
|
||||
.st226{clip-path:url(#SVGID_10_);fill:#366C9A;}
|
||||
.st227{clip-path:url(#SVGID_10_);fill:#366C9B;}
|
||||
.st228{clip-path:url(#SVGID_10_);fill:#366D9C;}
|
||||
.st229{clip-path:url(#SVGID_10_);fill:#376E9D;}
|
||||
.st230{clip-path:url(#SVGID_10_);fill:#376F9E;}
|
||||
.st231{clip-path:url(#SVGID_10_);fill:#386F9F;}
|
||||
.st232{clip-path:url(#SVGID_10_);fill:#3870A0;}
|
||||
.st233{clip-path:url(#SVGID_10_);fill:#3971A1;}
|
||||
.st234{clip-path:url(#SVGID_10_);fill:#3972A2;}
|
||||
.st235{clip-path:url(#SVGID_10_);fill:#3A72A3;}
|
||||
.st236{clip-path:url(#SVGID_10_);fill:#3A73A4;}
|
||||
.st237{clip-path:url(#SVGID_10_);fill:#3B74A5;}
|
||||
.st238{clip-path:url(#SVGID_10_);fill:#3B75A6;}
|
||||
.st239{clip-path:url(#SVGID_10_);fill:#3B75A7;}
|
||||
.st240{clip-path:url(#SVGID_10_);fill:#3C76A8;}
|
||||
.st241{clip-path:url(#SVGID_10_);fill:#3C77A9;}
|
||||
.st242{clip-path:url(#SVGID_10_);fill:#3D78AA;}
|
||||
.st243{clip-path:url(#SVGID_10_);fill:#3D78AC;}
|
||||
.st244{clip-path:url(#SVGID_10_);fill:#3E79AD;}
|
||||
.st245{clip-path:url(#SVGID_10_);fill:#3E7AAE;}
|
||||
.st246{clip-path:url(#SVGID_10_);fill:#3F7BAF;}
|
||||
.st247{clip-path:url(#SVGID_10_);fill:#3F7BB0;}
|
||||
.st248{clip-path:url(#SVGID_10_);fill:#3F7CB1;}
|
||||
.st249{clip-path:url(#SVGID_10_);fill:#407DB2;}
|
||||
.st250{clip-path:url(#SVGID_10_);fill:#407EB3;}
|
||||
.st251{clip-path:url(#SVGID_10_);fill:#417EB4;}
|
||||
.st252{clip-path:url(#SVGID_10_);fill:#417FB5;}
|
||||
.st253{clip-path:url(#SVGID_10_);fill:#4280B6;}
|
||||
.st254{clip-path:url(#SVGID_10_);fill:#4281B7;}
|
||||
.st255{clip-path:url(#SVGID_10_);fill:#4381B8;}
|
||||
.st256{clip-path:url(#SVGID_10_);fill:#4382B9;}
|
||||
.st257{clip-path:url(#SVGID_10_);fill:#4483BA;}
|
||||
.st258{clip-path:url(#SVGID_10_);fill:#4484BB;}
|
||||
.st259{clip-path:url(#SVGID_10_);fill:#4484BC;}
|
||||
.st260{clip-path:url(#SVGID_10_);fill:#4585BD;}
|
||||
.st261{clip-path:url(#SVGID_10_);fill:#4586BE;}
|
||||
.st262{clip-path:url(#SVGID_10_);fill:#4687BF;}
|
||||
.st263{clip-path:url(#SVGID_10_);fill:#4687C0;}
|
||||
.st264{clip-path:url(#SVGID_10_);fill:#4788C1;}
|
||||
.st265{clip-path:url(#SVGID_10_);fill:#4789C2;}
|
||||
.st266{clip-path:url(#SVGID_10_);fill:#488AC3;}
|
||||
.st267{clip-path:url(#SVGID_10_);fill:#488AC4;}
|
||||
.st268{clip-path:url(#SVGID_10_);fill:#498BC5;}
|
||||
.st269{clip-path:url(#SVGID_10_);fill:#498CC6;}
|
||||
.st270{clip-path:url(#SVGID_12_);fill:#5FBBEB;}
|
||||
.st271{clip-path:url(#SVGID_12_);fill:#5EBAEB;}
|
||||
.st272{clip-path:url(#SVGID_12_);fill:#5DB9EA;}
|
||||
.st273{clip-path:url(#SVGID_12_);fill:#5CB8EA;}
|
||||
.st274{clip-path:url(#SVGID_12_);fill:#5BB7E9;}
|
||||
.st275{clip-path:url(#SVGID_12_);fill:#5AB6E9;}
|
||||
.st276{clip-path:url(#SVGID_12_);fill:#59B5E8;}
|
||||
.st277{clip-path:url(#SVGID_12_);fill:#58B4E8;}
|
||||
.st278{clip-path:url(#SVGID_12_);fill:#57B3E7;}
|
||||
.st279{clip-path:url(#SVGID_12_);fill:#56B2E7;}
|
||||
.st280{clip-path:url(#SVGID_12_);fill:#55B1E7;}
|
||||
.st281{clip-path:url(#SVGID_12_);fill:#54B0E6;}
|
||||
.st282{clip-path:url(#SVGID_12_);fill:#53AFE6;}
|
||||
.st283{clip-path:url(#SVGID_12_);fill:#52AEE5;}
|
||||
.st284{clip-path:url(#SVGID_12_);fill:#51ADE5;}
|
||||
.st285{clip-path:url(#SVGID_12_);fill:#50ACE4;}
|
||||
.st286{clip-path:url(#SVGID_12_);fill:#4FABE4;}
|
||||
.st287{clip-path:url(#SVGID_12_);fill:#4EAAE3;}
|
||||
.st288{clip-path:url(#SVGID_12_);fill:#4DA9E3;}
|
||||
.st289{clip-path:url(#SVGID_12_);fill:#4CA8E3;}
|
||||
.st290{clip-path:url(#SVGID_12_);fill:#4BA7E2;}
|
||||
.st291{clip-path:url(#SVGID_12_);fill:#4AA6E2;}
|
||||
.st292{clip-path:url(#SVGID_12_);fill:#49A5E1;}
|
||||
.st293{clip-path:url(#SVGID_12_);fill:#48A4E1;}
|
||||
.st294{clip-path:url(#SVGID_12_);fill:#47A2E0;}
|
||||
.st295{clip-path:url(#SVGID_12_);fill:#46A1E0;}
|
||||
.st296{clip-path:url(#SVGID_12_);fill:#45A0DF;}
|
||||
.st297{clip-path:url(#SVGID_12_);fill:#449FDF;}
|
||||
.st298{clip-path:url(#SVGID_12_);fill:#439EDE;}
|
||||
.st299{clip-path:url(#SVGID_12_);fill:#429DDE;}
|
||||
.st300{clip-path:url(#SVGID_12_);fill:#419CDE;}
|
||||
.st301{clip-path:url(#SVGID_12_);fill:#409BDD;}
|
||||
.st302{clip-path:url(#SVGID_12_);fill:#3F9ADD;}
|
||||
.st303{clip-path:url(#SVGID_12_);fill:#3E99DC;}
|
||||
.st304{clip-path:url(#SVGID_12_);fill:#3D98DC;}
|
||||
.st305{clip-path:url(#SVGID_12_);fill:#3C97DB;}
|
||||
.st306{clip-path:url(#SVGID_12_);fill:#3B96DB;}
|
||||
.st307{clip-path:url(#SVGID_12_);fill:#3A95DA;}
|
||||
.st308{clip-path:url(#SVGID_12_);fill:#3994DA;}
|
||||
.st309{clip-path:url(#SVGID_12_);fill:#3893DA;}
|
||||
.st310{clip-path:url(#SVGID_12_);fill:#3792D9;}
|
||||
.st311{clip-path:url(#SVGID_12_);fill:#3691D9;}
|
||||
.st312{clip-path:url(#SVGID_12_);fill:#3590D8;}
|
||||
.st313{clip-path:url(#SVGID_12_);fill:#348FD8;}
|
||||
.st314{clip-path:url(#SVGID_12_);fill:#338ED7;}
|
||||
.st315{clip-path:url(#SVGID_12_);fill:#328DD7;}
|
||||
.st316{clip-path:url(#SVGID_12_);fill:#318CD6;}
|
||||
.st317{clip-path:url(#SVGID_12_);fill:#308BD6;}
|
||||
.st318{fill:#316490;}
|
||||
</style>
|
||||
<path class="st0" d="M224,81H8c-4.4,0-8-3.6-8-8V8c0-4.4,3.6-8,8-8h216c4.4,0,8,3.6,8,8v65C232,77.4,228.4,81,224,81z"/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_1_" points="15.2,15 15.2,62.9 59.2,56 59.2,8.1 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_2_">
|
||||
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<polygon class="st1" points="56.7,62.9 59.2,56 59.2,62.9 "/>
|
||||
<polygon class="st1" points="55.7,62.9 59.2,53.1 59.2,56 56.7,62.9 "/>
|
||||
<polygon class="st2" points="54.6,62.9 59.2,50.3 59.2,53.1 55.7,62.9 "/>
|
||||
<polygon class="st3" points="53.6,62.9 59.2,47.4 59.2,50.3 54.6,62.9 "/>
|
||||
<polygon class="st4" points="52.6,62.9 59.2,44.6 59.2,47.4 53.6,62.9 "/>
|
||||
<polygon class="st5" points="51.5,62.9 59.2,41.7 59.2,44.6 52.6,62.9 "/>
|
||||
<polygon class="st6" points="50.5,62.9 59.2,38.9 59.2,41.7 51.5,62.9 "/>
|
||||
<polygon class="st7" points="49.4,62.9 59.2,36 59.2,38.9 50.5,62.9 "/>
|
||||
<polygon class="st8" points="48.4,62.9 59.2,33.1 59.2,36 49.4,62.9 "/>
|
||||
<polygon class="st9" points="47.4,62.9 59.2,30.3 59.2,33.1 48.4,62.9 "/>
|
||||
<polygon class="st10" points="46.3,62.9 59.2,27.4 59.2,30.3 47.4,62.9 "/>
|
||||
<polygon class="st11" points="45.3,62.9 59.2,24.6 59.2,27.4 46.3,62.9 "/>
|
||||
<polygon class="st12" points="44.2,62.9 59.2,21.7 59.2,24.6 45.3,62.9 "/>
|
||||
<polygon class="st13" points="43.2,62.9 59.2,18.9 59.2,21.7 44.2,62.9 "/>
|
||||
<polygon class="st14" points="42.2,62.9 59.2,16 59.2,18.9 43.2,62.9 "/>
|
||||
<polygon class="st15" points="41.1,62.9 59.2,13.2 59.2,16 42.2,62.9 "/>
|
||||
<polygon class="st16" points="40.1,62.9 59.2,10.3 59.2,13.2 41.1,62.9 "/>
|
||||
<polygon class="st17" points="39,62.9 59,8.1 59.2,8.1 59.2,10.3 40.1,62.9 "/>
|
||||
<polygon class="st18" points="38,62.9 57.9,8.1 59,8.1 39,62.9 "/>
|
||||
<polygon class="st19" points="37,62.9 56.9,8.1 57.9,8.1 38,62.9 "/>
|
||||
<polygon class="st20" points="35.9,62.9 55.9,8.1 56.9,8.1 37,62.9 "/>
|
||||
<polygon class="st21" points="34.9,62.9 54.8,8.1 55.9,8.1 35.9,62.9 "/>
|
||||
<polygon class="st22" points="33.8,62.9 53.8,8.1 54.8,8.1 34.9,62.9 "/>
|
||||
<polygon class="st23" points="32.8,62.9 52.7,8.1 53.8,8.1 33.8,62.9 "/>
|
||||
<polygon class="st24" points="31.8,62.9 51.7,8.1 52.7,8.1 32.8,62.9 "/>
|
||||
<polygon class="st25" points="30.7,62.9 50.7,8.1 51.7,8.1 31.8,62.9 "/>
|
||||
<polygon class="st26" points="29.7,62.9 49.6,8.1 50.7,8.1 30.7,62.9 "/>
|
||||
<polygon class="st27" points="28.7,62.9 48.6,8.1 49.6,8.1 29.7,62.9 "/>
|
||||
<polygon class="st28" points="27.6,62.9 47.5,8.1 48.6,8.1 28.7,62.9 "/>
|
||||
<polygon class="st29" points="26.6,62.9 46.5,8.1 47.5,8.1 27.6,62.9 "/>
|
||||
<polygon class="st30" points="25.5,62.9 45.5,8.1 46.5,8.1 26.6,62.9 "/>
|
||||
<polygon class="st31" points="24.5,62.9 44.4,8.1 45.5,8.1 25.5,62.9 "/>
|
||||
<polygon class="st32" points="23.5,62.9 43.4,8.1 44.4,8.1 24.5,62.9 "/>
|
||||
<polygon class="st33" points="22.4,62.9 42.3,8.1 43.4,8.1 23.5,62.9 "/>
|
||||
<polygon class="st34" points="21.4,62.9 41.3,8.1 42.3,8.1 22.4,62.9 "/>
|
||||
<polygon class="st35" points="20.3,62.9 40.3,8.1 41.3,8.1 21.4,62.9 "/>
|
||||
<polygon class="st36" points="19.3,62.9 39.2,8.1 40.3,8.1 20.3,62.9 "/>
|
||||
<polygon class="st37" points="18.3,62.9 38.2,8.1 39.2,8.1 19.3,62.9 "/>
|
||||
<polygon class="st38" points="17.2,62.9 37.1,8.1 38.2,8.1 18.3,62.9 "/>
|
||||
<polygon class="st39" points="16.2,62.9 36.1,8.1 37.1,8.1 17.2,62.9 "/>
|
||||
<polygon class="st40" points="15.2,62.7 35.1,8.1 36.1,8.1 16.2,62.9 15.2,62.9 "/>
|
||||
<polygon class="st41" points="15.2,59.9 34,8.1 35.1,8.1 15.2,62.7 "/>
|
||||
<polygon class="st42" points="15.2,57 33,8.1 34,8.1 15.2,59.9 "/>
|
||||
<polygon class="st43" points="15.2,54.2 32,8.1 33,8.1 15.2,57 "/>
|
||||
<polygon class="st44" points="15.2,51.3 30.9,8.1 32,8.1 15.2,54.2 "/>
|
||||
<polygon class="st45" points="15.2,48.5 29.9,8.1 30.9,8.1 15.2,51.3 "/>
|
||||
<polygon class="st46" points="15.2,45.6 28.8,8.1 29.9,8.1 15.2,48.5 "/>
|
||||
<polygon class="st47" points="15.2,42.7 27.8,8.1 28.8,8.1 15.2,45.6 "/>
|
||||
<polygon class="st48" points="15.2,39.9 26.8,8.1 27.8,8.1 15.2,42.7 "/>
|
||||
<polygon class="st48" points="26.8,8.1 15.2,39.9 15.2,8.1 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_3_" points="83,68.7 83,20.8 59.2,8.1 59.2,56 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_4_">
|
||||
<use xlink:href="#SVGID_3_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<polygon class="st49" points="83,20.8 78.4,8.1 83,8.1 "/>
|
||||
<polygon class="st49" points="83,22 77.9,8.1 78.4,8.1 83,20.8 "/>
|
||||
<polygon class="st50" points="83,23.1 77.5,8.1 77.9,8.1 83,22 "/>
|
||||
<polygon class="st51" points="83,24.3 77.1,8.1 77.5,8.1 83,23.1 "/>
|
||||
<polygon class="st52" points="83,25.4 76.7,8.1 77.1,8.1 83,24.3 "/>
|
||||
<polygon class="st53" points="83,26.6 76.3,8.1 76.7,8.1 83,25.4 "/>
|
||||
<polygon class="st54" points="83,27.7 75.9,8.1 76.3,8.1 83,26.6 "/>
|
||||
<polygon class="st55" points="83,28.8 75.4,8.1 75.9,8.1 83,27.7 "/>
|
||||
<polygon class="st56" points="83,30 75,8.1 75.4,8.1 83,28.8 "/>
|
||||
<polygon class="st57" points="83,31.1 74.6,8.1 75,8.1 83,30 "/>
|
||||
<polygon class="st58" points="83,32.3 74.2,8.1 74.6,8.1 83,31.1 "/>
|
||||
<polygon class="st59" points="83,33.4 73.8,8.1 74.2,8.1 83,32.3 "/>
|
||||
<polygon class="st60" points="83,34.6 73.4,8.1 73.8,8.1 83,33.4 "/>
|
||||
<polygon class="st61" points="83,35.7 72.9,8.1 73.4,8.1 83,34.6 "/>
|
||||
<polygon class="st62" points="83,36.9 72.5,8.1 72.9,8.1 83,35.7 "/>
|
||||
<polygon class="st63" points="83,38 72.1,8.1 72.5,8.1 83,36.9 "/>
|
||||
<polygon class="st64" points="83,39.1 71.7,8.1 72.1,8.1 83,38 "/>
|
||||
<polygon class="st65" points="83,40.3 71.3,8.1 71.7,8.1 83,39.1 "/>
|
||||
<polygon class="st66" points="83,41.4 70.9,8.1 71.3,8.1 83,40.3 "/>
|
||||
<polygon class="st67" points="83,42.6 70.4,8.1 70.9,8.1 83,41.4 "/>
|
||||
<polygon class="st68" points="83,43.7 70,8.1 70.4,8.1 83,42.6 "/>
|
||||
<polygon class="st69" points="83,44.9 69.6,8.1 70,8.1 83,43.7 "/>
|
||||
<polygon class="st70" points="83,46 69.2,8.1 69.6,8.1 83,44.9 "/>
|
||||
<polygon class="st71" points="83,47.2 68.8,8.1 69.2,8.1 83,46 "/>
|
||||
<polygon class="st72" points="83,48.3 68.4,8.1 68.8,8.1 83,47.2 "/>
|
||||
<polygon class="st73" points="83,49.5 67.9,8.1 68.4,8.1 83,48.3 "/>
|
||||
<polygon class="st74" points="83,50.6 67.5,8.1 67.9,8.1 83,49.5 "/>
|
||||
<polygon class="st75" points="83,51.7 67.1,8.1 67.5,8.1 83,50.6 "/>
|
||||
<polygon class="st76" points="83,52.9 66.7,8.1 67.1,8.1 83,51.7 "/>
|
||||
<polygon class="st77" points="83,54 66.3,8.1 66.7,8.1 83,52.9 "/>
|
||||
<polygon class="st78" points="83,55.2 65.9,8.1 66.3,8.1 83,54 "/>
|
||||
<polygon class="st79" points="83,56.3 65.4,8.1 65.9,8.1 83,55.2 "/>
|
||||
<polygon class="st80" points="83,57.5 65,8.1 65.4,8.1 83,56.3 "/>
|
||||
<polygon class="st81" points="83,58.6 64.6,8.1 65,8.1 83,57.5 "/>
|
||||
<polygon class="st82" points="83,59.8 64.2,8.1 64.6,8.1 83,58.6 "/>
|
||||
<polygon class="st83" points="83,60.9 63.8,8.1 64.2,8.1 83,59.8 "/>
|
||||
<polygon class="st84" points="83,62 63.3,8.1 63.8,8.1 83,60.9 "/>
|
||||
<polygon class="st85" points="83,63.2 62.9,8.1 63.3,8.1 83,62 "/>
|
||||
<polygon class="st86" points="83,64.3 62.5,8.1 62.9,8.1 83,63.2 "/>
|
||||
<polygon class="st87" points="83,65.5 62.1,8.1 62.5,8.1 83,64.3 "/>
|
||||
<polygon class="st88" points="83,66.6 61.7,8.1 62.1,8.1 83,65.5 "/>
|
||||
<polygon class="st89" points="83,67.8 61.3,8.1 61.7,8.1 83,66.6 "/>
|
||||
<polygon class="st90" points="82.9,68.7 60.8,8.1 61.3,8.1 83,67.8 83,68.7 "/>
|
||||
<polygon class="st91" points="82.5,68.7 60.4,8.1 60.8,8.1 82.9,68.7 "/>
|
||||
<polygon class="st92" points="82.1,68.7 60,8.1 60.4,8.1 82.5,68.7 "/>
|
||||
<polygon class="st93" points="81.6,68.7 59.6,8.1 60,8.1 82.1,68.7 "/>
|
||||
<polygon class="st94" points="81.2,68.7 59.2,8.1 59.2,8.1 59.6,8.1 81.6,68.7 "/>
|
||||
<polygon class="st95" points="80.8,68.7 59.2,9.3 59.2,8.1 81.2,68.7 "/>
|
||||
<polygon class="st96" points="80.4,68.7 59.2,10.4 59.2,9.3 80.8,68.7 "/>
|
||||
<polygon class="st97" points="80,68.7 59.2,11.6 59.2,10.4 80.4,68.7 "/>
|
||||
<polygon class="st98" points="79.6,68.7 59.2,12.7 59.2,11.6 80,68.7 "/>
|
||||
<polygon class="st99" points="79.1,68.7 59.2,13.8 59.2,12.7 79.6,68.7 "/>
|
||||
<polygon class="st100" points="78.7,68.7 59.2,15 59.2,13.8 79.1,68.7 "/>
|
||||
<polygon class="st101" points="78.3,68.7 59.2,16.1 59.2,15 78.7,68.7 "/>
|
||||
<polygon class="st102" points="77.9,68.7 59.2,17.3 59.2,16.1 78.3,68.7 "/>
|
||||
<polygon class="st103" points="77.5,68.7 59.2,18.4 59.2,17.3 77.9,68.7 "/>
|
||||
<polygon class="st104" points="77.1,68.7 59.2,19.6 59.2,18.4 77.5,68.7 "/>
|
||||
<polygon class="st105" points="76.6,68.7 59.2,20.7 59.2,19.6 77.1,68.7 "/>
|
||||
<polygon class="st106" points="76.2,68.7 59.2,21.9 59.2,20.7 76.6,68.7 "/>
|
||||
<polygon class="st107" points="75.8,68.7 59.2,23 59.2,21.9 76.2,68.7 "/>
|
||||
<polygon class="st108" points="75.4,68.7 59.2,24.1 59.2,23 75.8,68.7 "/>
|
||||
<polygon class="st109" points="75,68.7 59.2,25.3 59.2,24.1 75.4,68.7 "/>
|
||||
<polygon class="st110" points="74.6,68.7 59.2,26.4 59.2,25.3 75,68.7 "/>
|
||||
<polygon class="st111" points="74.1,68.7 59.2,27.6 59.2,26.4 74.6,68.7 "/>
|
||||
<polygon class="st111" points="59.2,27.6 74.1,68.7 59.2,68.7 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_5_" points="39,75.5 83,68.7 59.2,56 15.2,62.9 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_6_">
|
||||
<use xlink:href="#SVGID_5_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<path class="st112" d="M83,75.5v-6.9V75.5z"/>
|
||||
<rect x="82.1" y="56" class="st112" width="0.9" height="19.5"/>
|
||||
<rect x="81.2" y="56" class="st113" width="0.9" height="19.5"/>
|
||||
<rect x="80.3" y="56" class="st114" width="0.9" height="19.5"/>
|
||||
<rect x="79.4" y="56" class="st115" width="0.9" height="19.5"/>
|
||||
<rect x="78.5" y="56" class="st116" width="0.9" height="19.5"/>
|
||||
<rect x="77.6" y="56" class="st117" width="0.9" height="19.5"/>
|
||||
<rect x="76.7" y="56" class="st118" width="0.9" height="19.5"/>
|
||||
<rect x="75.8" y="56" class="st119" width="0.9" height="19.5"/>
|
||||
<rect x="74.9" y="56" class="st120" width="0.9" height="19.5"/>
|
||||
<rect x="74" y="56" class="st121" width="0.9" height="19.5"/>
|
||||
<rect x="73.1" y="56" class="st122" width="0.9" height="19.5"/>
|
||||
<rect x="72.2" y="56" class="st123" width="0.9" height="19.5"/>
|
||||
<rect x="71.3" y="56" class="st124" width="0.9" height="19.5"/>
|
||||
<rect x="70.4" y="56" class="st125" width="0.9" height="19.5"/>
|
||||
<rect x="69.5" y="56" class="st126" width="0.9" height="19.5"/>
|
||||
<rect x="68.6" y="56" class="st127" width="0.9" height="19.5"/>
|
||||
<rect x="67.7" y="56" class="st128" width="0.9" height="19.5"/>
|
||||
<rect x="66.8" y="56" class="st129" width="0.9" height="19.5"/>
|
||||
<rect x="65.9" y="56" class="st130" width="0.9" height="19.5"/>
|
||||
<rect x="65" y="56" class="st131" width="0.9" height="19.5"/>
|
||||
<rect x="64.1" y="56" class="st132" width="0.9" height="19.5"/>
|
||||
<rect x="63.2" y="56" class="st133" width="0.9" height="19.5"/>
|
||||
<rect x="62.3" y="56" class="st134" width="0.9" height="19.5"/>
|
||||
<rect x="61.4" y="56" class="st135" width="0.9" height="19.5"/>
|
||||
<rect x="60.5" y="56" class="st136" width="0.9" height="19.5"/>
|
||||
<rect x="59.6" y="56" class="st137" width="0.9" height="19.5"/>
|
||||
<rect x="58.7" y="56" class="st138" width="0.9" height="19.5"/>
|
||||
<rect x="57.8" y="56" class="st139" width="0.9" height="19.5"/>
|
||||
<rect x="56.9" y="56" class="st140" width="0.9" height="19.5"/>
|
||||
<rect x="56" y="56" class="st141" width="0.9" height="19.5"/>
|
||||
<rect x="55.1" y="56" class="st142" width="0.9" height="19.5"/>
|
||||
<rect x="54.2" y="56" class="st143" width="0.9" height="19.5"/>
|
||||
<rect x="53.3" y="56" class="st144" width="0.9" height="19.5"/>
|
||||
<rect x="52.4" y="56" class="st145" width="0.9" height="19.5"/>
|
||||
<rect x="51.5" y="56" class="st146" width="0.9" height="19.5"/>
|
||||
<rect x="50.6" y="56" class="st147" width="0.9" height="19.5"/>
|
||||
<rect x="49.7" y="56" class="st148" width="0.9" height="19.5"/>
|
||||
<rect x="48.8" y="56" class="st149" width="0.9" height="19.5"/>
|
||||
<rect x="47.9" y="56" class="st150" width="0.9" height="19.5"/>
|
||||
<rect x="47" y="56" class="st151" width="0.9" height="19.5"/>
|
||||
<rect x="46.1" y="56" class="st152" width="0.9" height="19.5"/>
|
||||
<rect x="45.2" y="56" class="st153" width="0.9" height="19.5"/>
|
||||
<rect x="44.3" y="56" class="st154" width="0.9" height="19.5"/>
|
||||
<rect x="43.4" y="56" class="st155" width="0.9" height="19.5"/>
|
||||
<rect x="42.5" y="56" class="st156" width="0.9" height="19.5"/>
|
||||
<rect x="41.6" y="56" class="st157" width="0.9" height="19.5"/>
|
||||
<rect x="40.7" y="56" class="st158" width="0.9" height="19.5"/>
|
||||
<rect x="39.8" y="56" class="st159" width="0.9" height="19.5"/>
|
||||
<rect x="38.9" y="56" class="st160" width="0.9" height="19.5"/>
|
||||
<rect x="38" y="56" class="st161" width="0.9" height="19.5"/>
|
||||
<rect x="37.1" y="56" class="st162" width="0.9" height="19.5"/>
|
||||
<rect x="15.2" y="56" class="st162" width="21.9" height="19.5"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g class="st163">
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_7_" points="39,27.6 15.2,15 15.2,62.9 39,75.5 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_8_">
|
||||
<use xlink:href="#SVGID_7_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<polygon class="st164" points="37.7,75.5 39,73.7 39,75.5 "/>
|
||||
<polygon class="st165" points="36.4,75.5 39,71.8 39,73.7 37.7,75.5 "/>
|
||||
<polygon class="st166" points="35.1,75.5 39,70 39,71.8 36.4,75.5 "/>
|
||||
<polygon class="st167" points="33.8,75.5 39,68.1 39,70 35.1,75.5 "/>
|
||||
<polygon class="st168" points="32.5,75.5 39,66.2 39,68.1 33.8,75.5 "/>
|
||||
<polygon class="st169" points="31.9,75.5 31.4,75.2 39,64.4 39,66.2 32.5,75.5 "/>
|
||||
<polygon class="st170" points="31.4,75.2 30.5,74.6 39,62.5 39,64.4 "/>
|
||||
<polygon class="st171" points="30.5,74.6 29.7,74 39,60.7 39,62.5 "/>
|
||||
<polygon class="st172" points="29.7,74 28.8,73.4 39,58.8 39,60.7 "/>
|
||||
<polygon class="st173" points="28.8,73.4 27.9,72.8 39,57 39,58.8 "/>
|
||||
<polygon class="st174" points="27.9,72.8 27.1,72.1 39,55.1 39,57 "/>
|
||||
<polygon class="st175" points="27.1,72.1 26.2,71.5 39,53.3 39,55.1 "/>
|
||||
<polygon class="st176" points="26.2,71.5 25.3,70.9 39,51.4 39,53.3 "/>
|
||||
<polygon class="st177" points="25.3,70.9 24.4,70.3 39,49.6 39,51.4 "/>
|
||||
<polygon class="st178" points="24.4,70.3 23.6,69.7 39,47.7 39,49.6 "/>
|
||||
<polygon class="st179" points="23.6,69.7 22.7,69.1 39,45.9 39,47.7 "/>
|
||||
<polygon class="st180" points="22.7,69.1 21.8,68.5 39,44 39,45.9 "/>
|
||||
<polygon class="st181" points="21.8,68.5 21,67.9 39,42.2 39,44 "/>
|
||||
<polygon class="st182" points="21,67.9 20.1,67.3 39,40.3 39,42.2 "/>
|
||||
<polygon class="st183" points="20.1,67.3 19.2,66.7 39,38.4 39,40.3 "/>
|
||||
<polygon class="st184" points="19.2,66.7 18.4,66 39,36.6 39,38.4 "/>
|
||||
<polygon class="st185" points="18.4,66 17.5,65.4 39,34.7 39,36.6 "/>
|
||||
<polygon class="st186" points="17.5,65.4 16.6,64.8 39,32.9 39,34.7 "/>
|
||||
<polygon class="st187" points="16.6,64.8 15.7,64.2 39,31 39,32.9 "/>
|
||||
<polygon class="st188" points="15.7,64.2 15.2,63.8 15.2,63.2 39,29.2 39,31 "/>
|
||||
<polygon class="st189" points="15.2,61.3 39,27.3 39,29.2 15.2,63.2 "/>
|
||||
<polygon class="st190" points="15.2,59.5 38.4,26.3 39,26.7 39,27.3 15.2,61.3 "/>
|
||||
<polygon class="st191" points="15.2,57.6 37.5,25.7 38.4,26.3 15.2,59.5 "/>
|
||||
<polygon class="st192" points="15.2,55.7 36.7,25 37.5,25.7 15.2,57.6 "/>
|
||||
<polygon class="st193" points="15.2,53.9 35.8,24.4 36.7,25 15.2,55.7 "/>
|
||||
<polygon class="st194" points="15.2,52 34.9,23.8 35.8,24.4 15.2,53.9 "/>
|
||||
<polygon class="st195" points="15.2,50.2 34.1,23.2 34.9,23.8 15.2,52 "/>
|
||||
<polygon class="st196" points="15.2,48.3 33.2,22.6 34.1,23.2 15.2,50.2 "/>
|
||||
<polygon class="st197" points="15.2,46.5 32.3,22 33.2,22.6 15.2,48.3 "/>
|
||||
<polygon class="st198" points="15.2,44.6 31.5,21.4 32.3,22 15.2,46.5 "/>
|
||||
<polygon class="st199" points="15.2,42.8 30.6,20.8 31.5,21.4 15.2,44.6 "/>
|
||||
<polygon class="st200" points="15.2,40.9 29.7,20.2 30.6,20.8 15.2,42.8 "/>
|
||||
<polygon class="st201" points="15.2,39.1 28.8,19.6 29.7,20.2 15.2,40.9 "/>
|
||||
<polygon class="st202" points="15.2,37.2 28,18.9 28.8,19.6 15.2,39.1 "/>
|
||||
<polygon class="st203" points="15.2,35.4 27.1,18.3 28,18.9 15.2,37.2 "/>
|
||||
<polygon class="st204" points="15.2,33.5 26.2,17.7 27.1,18.3 15.2,35.4 "/>
|
||||
<polygon class="st205" points="15.2,31.6 25.4,17.1 26.2,17.7 15.2,33.5 "/>
|
||||
<polygon class="st206" points="15.2,29.8 24.5,16.5 25.4,17.1 15.2,31.6 "/>
|
||||
<polygon class="st207" points="15.2,27.9 23.6,15.9 24.5,16.5 15.2,29.8 "/>
|
||||
<polygon class="st208" points="15.2,26.1 22.7,15.3 23.6,15.9 15.2,27.9 "/>
|
||||
<polygon class="st209" points="15.2,24.2 21.7,15 22.3,15 22.7,15.3 15.2,26.1 "/>
|
||||
<polygon class="st210" points="15.2,22.4 20.4,15 21.7,15 15.2,24.2 "/>
|
||||
<polygon class="st211" points="15.2,20.5 19.1,15 20.4,15 15.2,22.4 "/>
|
||||
<polygon class="st212" points="15.2,18.7 17.8,15 19.1,15 15.2,20.5 "/>
|
||||
<polygon class="st213" points="15.2,16.8 16.5,15 17.8,15 15.2,18.7 "/>
|
||||
<polygon class="st214" points="15.2,15 15.2,15 16.5,15 15.2,16.8 "/>
|
||||
<polygon class="st214" points="15.2,15 15.2,15 15.2,15 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g class="st215">
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_9_" points="83,20.8 59.2,8.1 15.2,15 39,27.6 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_10_">
|
||||
<use xlink:href="#SVGID_9_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<path class="st216" d="M83,27.6v-6.9V27.6z"/>
|
||||
<rect x="81.7" y="8.1" class="st216" width="1.3" height="19.5"/>
|
||||
<rect x="80.4" y="8.1" class="st217" width="1.3" height="19.5"/>
|
||||
<rect x="79.2" y="8.1" class="st218" width="1.3" height="19.5"/>
|
||||
<rect x="77.9" y="8.1" class="st219" width="1.3" height="19.5"/>
|
||||
<rect x="76.7" y="8.1" class="st220" width="1.3" height="19.5"/>
|
||||
<rect x="75.4" y="8.1" class="st221" width="1.3" height="19.5"/>
|
||||
<rect x="74.2" y="8.1" class="st222" width="1.3" height="19.5"/>
|
||||
<rect x="72.9" y="8.1" class="st223" width="1.3" height="19.5"/>
|
||||
<rect x="71.7" y="8.1" class="st224" width="1.3" height="19.5"/>
|
||||
<rect x="70.4" y="8.1" class="st225" width="1.3" height="19.5"/>
|
||||
<rect x="69.2" y="8.1" class="st226" width="1.3" height="19.5"/>
|
||||
<rect x="67.9" y="8.1" class="st227" width="1.3" height="19.5"/>
|
||||
<rect x="66.6" y="8.1" class="st228" width="1.3" height="19.5"/>
|
||||
<rect x="65.4" y="8.1" class="st229" width="1.3" height="19.5"/>
|
||||
<rect x="64.1" y="8.1" class="st230" width="1.3" height="19.5"/>
|
||||
<rect x="62.9" y="8.1" class="st231" width="1.3" height="19.5"/>
|
||||
<rect x="61.6" y="8.1" class="st232" width="1.3" height="19.5"/>
|
||||
<rect x="60.4" y="8.1" class="st233" width="1.3" height="19.5"/>
|
||||
<rect x="59.1" y="8.1" class="st234" width="1.3" height="19.5"/>
|
||||
<rect x="57.9" y="8.1" class="st235" width="1.3" height="19.5"/>
|
||||
<rect x="56.6" y="8.1" class="st236" width="1.3" height="19.5"/>
|
||||
<rect x="55.3" y="8.1" class="st237" width="1.3" height="19.5"/>
|
||||
<rect x="54.1" y="8.1" class="st238" width="1.3" height="19.5"/>
|
||||
<rect x="52.8" y="8.1" class="st239" width="1.3" height="19.5"/>
|
||||
<rect x="51.6" y="8.1" class="st240" width="1.3" height="19.5"/>
|
||||
<rect x="50.3" y="8.1" class="st241" width="1.3" height="19.5"/>
|
||||
<rect x="49.1" y="8.1" class="st242" width="1.3" height="19.5"/>
|
||||
<rect x="47.8" y="8.1" class="st243" width="1.3" height="19.5"/>
|
||||
<rect x="46.6" y="8.1" class="st244" width="1.3" height="19.5"/>
|
||||
<rect x="45.3" y="8.1" class="st245" width="1.3" height="19.5"/>
|
||||
<rect x="44.1" y="8.1" class="st246" width="1.3" height="19.5"/>
|
||||
<rect x="42.8" y="8.1" class="st247" width="1.3" height="19.5"/>
|
||||
<rect x="41.5" y="8.1" class="st248" width="1.3" height="19.5"/>
|
||||
<rect x="40.3" y="8.1" class="st249" width="1.3" height="19.5"/>
|
||||
<rect x="39" y="8.1" class="st250" width="1.3" height="19.5"/>
|
||||
<rect x="37.8" y="8.1" class="st251" width="1.3" height="19.5"/>
|
||||
<rect x="36.5" y="8.1" class="st252" width="1.3" height="19.5"/>
|
||||
<rect x="35.3" y="8.1" class="st253" width="1.3" height="19.5"/>
|
||||
<rect x="34" y="8.1" class="st254" width="1.3" height="19.5"/>
|
||||
<rect x="32.8" y="8.1" class="st255" width="1.3" height="19.5"/>
|
||||
<rect x="31.5" y="8.1" class="st256" width="1.3" height="19.5"/>
|
||||
<rect x="30.2" y="8.1" class="st257" width="1.3" height="19.5"/>
|
||||
<rect x="29" y="8.1" class="st258" width="1.3" height="19.5"/>
|
||||
<rect x="27.7" y="8.1" class="st259" width="1.3" height="19.5"/>
|
||||
<rect x="26.5" y="8.1" class="st260" width="1.3" height="19.5"/>
|
||||
<rect x="25.2" y="8.1" class="st261" width="1.3" height="19.5"/>
|
||||
<rect x="24" y="8.1" class="st262" width="1.3" height="19.5"/>
|
||||
<rect x="22.7" y="8.1" class="st263" width="1.3" height="19.5"/>
|
||||
<rect x="21.5" y="8.1" class="st264" width="1.3" height="19.5"/>
|
||||
<rect x="20.2" y="8.1" class="st265" width="1.3" height="19.5"/>
|
||||
<rect x="18.9" y="8.1" class="st266" width="1.3" height="19.5"/>
|
||||
<rect x="17.7" y="8.1" class="st267" width="1.3" height="19.5"/>
|
||||
<rect x="16.4" y="8.1" class="st268" width="1.3" height="19.5"/>
|
||||
<polygon class="st269" points="15.2,15 15.2,8.1 16.4,8.1 16.4,27.6 15.2,27.6 "/>
|
||||
<path class="st269" d="M15.2,8.1V15V8.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g class="st215">
|
||||
<g>
|
||||
<g>
|
||||
<defs>
|
||||
<polygon id="SVGID_11_" points="39,27.6 39,75.5 83,68.7 83,20.8 "/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_12_">
|
||||
<use xlink:href="#SVGID_11_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<polygon class="st270" points="77.2,75.5 83,68.7 83,75.5 "/>
|
||||
<polygon class="st270" points="76.2,75.5 83,67.5 83,68.7 77.2,75.5 "/>
|
||||
<polygon class="st271" points="75.3,75.5 83,66.3 83,67.5 76.2,75.5 "/>
|
||||
<polygon class="st272" points="74.3,75.5 83,65.1 83,66.3 75.3,75.5 "/>
|
||||
<polygon class="st273" points="73.3,75.5 83,64 83,65.1 74.3,75.5 "/>
|
||||
<polygon class="st274" points="72.3,75.5 83,62.8 83,64 73.3,75.5 "/>
|
||||
<polygon class="st275" points="71.3,75.5 83,61.6 83,62.8 72.3,75.5 "/>
|
||||
<polygon class="st276" points="70.3,75.5 83,60.4 83,61.6 71.3,75.5 "/>
|
||||
<polygon class="st277" points="69.3,75.5 83,59.3 83,60.4 70.3,75.5 "/>
|
||||
<polygon class="st278" points="68.4,75.5 83,58.1 83,59.3 69.3,75.5 "/>
|
||||
<polygon class="st279" points="67.4,75.5 83,56.9 83,58.1 68.4,75.5 "/>
|
||||
<polygon class="st280" points="66.4,75.5 83,55.7 83,56.9 67.4,75.5 "/>
|
||||
<polygon class="st281" points="65.4,75.5 83,54.6 83,55.7 66.4,75.5 "/>
|
||||
<polygon class="st282" points="64.4,75.5 83,53.4 83,54.6 65.4,75.5 "/>
|
||||
<polygon class="st283" points="63.4,75.5 83,52.2 83,53.4 64.4,75.5 "/>
|
||||
<polygon class="st284" points="62.4,75.5 83,51 83,52.2 63.4,75.5 "/>
|
||||
<polygon class="st285" points="61.5,75.5 83,49.9 83,51 62.4,75.5 "/>
|
||||
<polygon class="st286" points="60.5,75.5 83,48.7 83,49.9 61.5,75.5 "/>
|
||||
<polygon class="st287" points="59.5,75.5 83,47.5 83,48.7 60.5,75.5 "/>
|
||||
<polygon class="st288" points="58.5,75.5 83,46.3 83,47.5 59.5,75.5 "/>
|
||||
<polygon class="st289" points="57.5,75.5 83,45.2 83,46.3 58.5,75.5 "/>
|
||||
<polygon class="st290" points="56.5,75.5 83,44 83,45.2 57.5,75.5 "/>
|
||||
<polygon class="st291" points="55.6,75.5 83,42.8 83,44 56.5,75.5 "/>
|
||||
<polygon class="st292" points="54.6,75.5 83,41.7 83,42.8 55.6,75.5 "/>
|
||||
<polygon class="st293" points="53.6,75.5 83,40.5 83,41.7 54.6,75.5 "/>
|
||||
<polygon class="st294" points="52.6,75.5 83,39.3 83,40.5 53.6,75.5 "/>
|
||||
<polygon class="st295" points="51.6,75.5 83,38.1 83,39.3 52.6,75.5 "/>
|
||||
<polygon class="st296" points="50.6,75.5 83,37 83,38.1 51.6,75.5 "/>
|
||||
<polygon class="st297" points="49.6,75.5 83,35.8 83,37 50.6,75.5 "/>
|
||||
<polygon class="st298" points="48.7,75.5 83,34.6 83,35.8 49.6,75.5 "/>
|
||||
<polygon class="st299" points="47.7,75.5 83,33.4 83,34.6 48.7,75.5 "/>
|
||||
<polygon class="st300" points="46.7,75.5 83,32.3 83,33.4 47.7,75.5 "/>
|
||||
<polygon class="st301" points="45.7,75.5 83,31.1 83,32.3 46.7,75.5 "/>
|
||||
<polygon class="st302" points="44.7,75.5 83,29.9 83,31.1 45.7,75.5 "/>
|
||||
<polygon class="st303" points="43.7,75.5 83,28.7 83,29.9 44.7,75.5 "/>
|
||||
<polygon class="st304" points="42.8,75.5 83,27.6 83,28.7 43.7,75.5 "/>
|
||||
<polygon class="st305" points="41.8,75.5 83,26.4 83,27.6 42.8,75.5 "/>
|
||||
<polygon class="st306" points="40.8,75.5 83,25.2 83,26.4 41.8,75.5 "/>
|
||||
<polygon class="st307" points="39.8,75.5 83,24 83,25.2 40.8,75.5 "/>
|
||||
<polygon class="st308" points="39,75.4 83,22.9 83,24 39.8,75.5 39,75.5 "/>
|
||||
<polygon class="st309" points="39,74.2 83,21.7 83,22.9 39,75.4 "/>
|
||||
<polygon class="st310" points="39,73 82.8,20.8 83,20.8 83,21.7 39,74.2 "/>
|
||||
<polygon class="st311" points="39,71.8 81.8,20.8 82.8,20.8 39,73 "/>
|
||||
<polygon class="st312" points="39,70.7 80.8,20.8 81.8,20.8 39,71.8 "/>
|
||||
<polygon class="st313" points="39,69.5 79.8,20.8 80.8,20.8 39,70.7 "/>
|
||||
<polygon class="st314" points="39,68.3 78.9,20.8 79.8,20.8 39,69.5 "/>
|
||||
<polygon class="st315" points="39,67.1 77.9,20.8 78.9,20.8 39,68.3 "/>
|
||||
<polygon class="st316" points="39,66 76.9,20.8 77.9,20.8 39,67.1 "/>
|
||||
<polygon class="st317" points="39,64.8 75.9,20.8 76.9,20.8 39,66 "/>
|
||||
<polygon class="st317" points="75.9,20.8 39,64.8 39,20.8 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M36.6,28.1c0-1.4,1.1-2.7,2.5-2.9l22.5-3.6v31.9c0,2.6-1.9,4.7-4.4,5.1L36.5,62L36.6,28.1z M56.7,27.3
|
||||
l-15.3,2.4l0,26.6l15.4-2.5V27.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<rect x="36.6" y="48.3" class="st0" width="4.8" height="28.2"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<rect x="59.2" y="3.9" class="st0" width="2.4" height="36.7"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M83,23.4v42.4c0,1.5-1.1,2.9-2.6,3.1l-35.3,5.7c-1.9,0.3-3.6-1.2-3.6-3.1v-7.6c0-1.5,1.1-2.9,2.6-3.1l14-2.2
|
||||
c2-0.3,3.5-2.1,3.5-4.1l0.2-39.7c0-2.4,2.5-3.9,4.6-2.8l14.3,7.7C82.1,20.4,83,21.8,83,23.4z M86.5,16L62.3,3
|
||||
c-0.8-0.6-1.9-0.1-1.9,0.9l-1.1,51c0,0.6-0.4,1.1-1,1.2L40,59c-0.6,0.1-1,0.6-1,1.2l0,18.7c0,0.7,0.7,1.3,1.4,1.2L86,71.8
|
||||
c0.6-0.1,1-0.6,1-1.2V17C87,16.6,86.8,16.3,86.5,16z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M59.2,11.7l0,7.5c0,1.6-1.2,3-2.7,3.2l-17.1,2.8c-1.6,0.3-2.7,1.6-2.7,3.2l0,40.3c0,2.5-2.6,4-4.8,2.9
|
||||
l-14.8-7.9c-1.1-0.6-1.7-1.7-1.7-2.9V17.6c0-1.6,1.2-3,2.8-3.2l37.5-5.8C57.4,8.2,59.2,9.7,59.2,11.7z M58.8,2.6l-45.5,7.9
|
||||
c-0.8,0.1-1.4,0.8-1.4,1.6l-0.2,49.6c-0.1,0.7,0.3,1.3,0.9,1.6l25.2,15.4c1.2,0.6,2.6-0.2,2.5-1.6L39,29.3c0-0.9,0.6-1.7,1.5-1.8
|
||||
l18.5-2.1c0.9-0.1,1.5-0.8,1.5-1.7l0.2-19.4C60.8,3.3,59.8,2.4,58.8,2.6z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M47.5,43.8c-0.6,0-1.1-0.4-1.2-1c-0.1-0.7,0.3-1.3,1-1.4l10.1-1.6c0.7-0.1,1.3,0.3,1.4,1
|
||||
c0.1,0.7-0.3,1.3-1,1.4l-10.1,1.6C47.6,43.8,47.6,43.8,47.5,43.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M55.2,42.6L55.2,42.6c0.8-0.1,1.6,0.5,1.6,1.3v8.7l4.5,0V30.1l-4.5,0.2V38c0,1.1-0.8,2-1.8,2.2l-1.7,0.3
|
||||
L55.2,42.6z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<polygon class="st318" points="112.5,28.8 112.5,37.1 125.6,37.1 125.6,41.2 112.5,41.2 112.5,49.5 125.6,49.5 125.6,53.6
|
||||
108,53.6 108,24.7 125.6,24.7 125.6,28.8 "/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st318" d="M147.2,38.3v14.2l-3.8,1.8h-0.6v-16c0-1.7-0.8-1.9-1.5-1.9h-4.3c-0.7,0-1.5,0.2-1.5,1.9v14.2l-3.8,1.8H131
|
||||
v-16c0-4,2-6,6-6h4.3C145.2,32.3,147.2,34.3,147.2,38.3z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st318" points="161.5,32.3 161.5,32.9 159.8,36.4 156.7,36.4 156.7,52.5 152.8,54.3 152.2,54.3 152.2,27.7
|
||||
156,25.9 156.7,25.9 156.7,32.3 "/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st318" d="M174.6,32.3h-4.3c-4,0-6,2-6,6v9.3c0,4,2,6,6,6h4.3c0.6,0,1.1-0.1,1.5-0.3v2c0,1.7-0.8,1.9-1.5,1.9h-10.3
|
||||
v4.1h10.3c4,0,6-2,6-6v-17C180.5,34.3,178.5,32.3,174.6,32.3z M176.1,47.6c0,1.7-0.8,1.9-1.5,1.9h-4.3c-0.7,0-1.5-0.2-1.5-1.9
|
||||
v-9.3c0-1.7,0.8-1.9,1.5-1.9h4.3c0.7,0,1.5,0.2,1.5,1.9V47.6z"/>
|
||||
<path class="st318" d="M197,32.3v0.6l-1.6,3.5H192c-0.7,0-1.5,0.2-1.5,1.9v14.2l-3.8,1.8H186v-16c0-4,2-6,6-6H197z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st318" d="M208,32.3h-7v4.1h7c0.7,0,1.5,0.2,1.5,1.9v1.1c-0.5-0.2-1-0.3-1.5-0.3h-3.9c-4,0-6,2-6,6v2.6c0,4,2,6,6,6
|
||||
h3.9c0.6,0,1.1-0.1,1.5-0.3v1.4h0.6l3.8-1.8V38.3C214,34.3,212,32.3,208,32.3z M208,49.5h-3.9c-0.7,0-1.5-0.2-1.5-1.9V45
|
||||
c0-1.7,0.8-1.9,1.5-1.9h3.9c0.7,0,1.5,0.2,1.5,1.9v2.6C209.5,49.3,208.7,49.5,208,49.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 44 KiB |
@ -1,6 +1,7 @@
|
||||
{
|
||||
"Title" : "Title",
|
||||
"Description" : "Description",
|
||||
"ShortDescription" : "Short Description",
|
||||
"Category" : "Category",
|
||||
"Visibility" : "Visibility",
|
||||
"Devices" : "Devices",
|
||||
@ -8,22 +9,26 @@
|
||||
"Groups" : "Groups",
|
||||
"Tags" : "Tags",
|
||||
"Platform" : "Platform",
|
||||
"Platforms" : "Platfomrs",
|
||||
"Platforms" : "Platforms",
|
||||
"Applications": "Applications",
|
||||
"No.Platform" : "No Platforms",
|
||||
"Screenshots" : "Screenshots",
|
||||
"Icon" : "Icon",
|
||||
"Info" : "Info",
|
||||
"Banner" : "Banner",
|
||||
"Create.Application" : "Create Application",
|
||||
"Back" : "Back",
|
||||
"Cancel" : "Cancel",
|
||||
"Finish" : "Finish",
|
||||
"Continue" : "Continue",
|
||||
"Name" : "Name",
|
||||
"Application.Name" : "Application Name",
|
||||
"General" : "General",
|
||||
"App.Releases" : "Application Releases",
|
||||
"Package.Manager" : "Package Manager",
|
||||
"Save" : "Save",
|
||||
"Create.Release" : "Create Release",
|
||||
"Release.Channel" : "Release Channel",
|
||||
"Release" : "Release",
|
||||
"New.Release.For" : "New Release for",
|
||||
"Upload.Package.File" : "Upload Package File",
|
||||
@ -38,6 +43,25 @@
|
||||
"Version" : "Version",
|
||||
"Status" : "Status",
|
||||
"App.Publisher" : "Application Publisher",
|
||||
"Login": "Login",
|
||||
"Logout" : "Logout"
|
||||
"Search.Apps" : "Search for Applications",
|
||||
"View.In.Store" : "View in Store",
|
||||
"Last.Updated" : "Last updated on",
|
||||
"Installs" : "Installs",
|
||||
"General.Info" : "General Info",
|
||||
"Select.Platform": "Select Platform",
|
||||
"Add.Release" : "Add Release to Application",
|
||||
"Share.With.Tenants" : "Share with Tenants",
|
||||
"Disable" : "Disable",
|
||||
"File.Based" : "File Based",
|
||||
"Activate" : "Activate",
|
||||
"Yes" : "Yes",
|
||||
"No" : "No",
|
||||
"No.Platform.Tags" : "No Platform Tags",
|
||||
"Create.Platform" : "Create Platform",
|
||||
"Optional": "Optional",
|
||||
"Identifier": "Identifier",
|
||||
"Next": "Next",
|
||||
"Platform.Enable": "Enable Platform",
|
||||
"Share.with.Tenants": "Share between all tenants",
|
||||
"Platform.Properties": "Platform Properties"
|
||||
}
|
||||
@ -0,0 +1,903 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: "Roboto-Medium";
|
||||
src: url('../../fonts/Roboto-Medium.woff');
|
||||
src: local("Roboto-Medium"), url("../../fonts/Roboto-Medium.ttf") format("ttf");
|
||||
src: local("Roboto-Medium"), url("../../fonts/Roboto-Medium.woff") format("woff");
|
||||
src: local("Roboto-Medium"), url("../../fonts/Roboto-Medium.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Roboto-Regular";
|
||||
src: url("../../fonts/Roboto-Regular.woff");
|
||||
src: local("Roboto-Regular"), url("../../fonts/Roboto-Regular.ttf") format("ttf");
|
||||
src: local("Roboto-Regular"), url("../../fonts/Roboto-Regular.woff") format("woff");
|
||||
src: local("Roboto-Regular"), url("../../fonts/Roboto-Regular.woff2") format("woff2");
|
||||
}
|
||||
|
||||
/*Colors*/
|
||||
.primary {
|
||||
color: white;
|
||||
background-color: #2196f3 !important;
|
||||
}
|
||||
|
||||
.primary-flat {
|
||||
color: #2196F3 !important;
|
||||
}
|
||||
|
||||
.danger {
|
||||
color: white;
|
||||
background-color: #e91e63 !important;
|
||||
}
|
||||
|
||||
.danger-flat {
|
||||
color: #e91e63 !important;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #b3b3b3 !important;
|
||||
}
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Custom button styles based on material design specs. */
|
||||
|
||||
.custom-raised {
|
||||
font-family: Roboto-Medium;
|
||||
text-transform: uppercase !important;
|
||||
font-size: 14px !important;
|
||||
padding-left: 16px !important;
|
||||
border-radius: 2px !important;
|
||||
padding-right: 16px !important;
|
||||
height: 36px !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.custom-raised:hover {
|
||||
cursor: pointer;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
|
||||
-webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
|
||||
background-color: #1976D2 !important;
|
||||
}
|
||||
|
||||
.custom-raised:focus {
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
background-color: #1976D2 !important;
|
||||
}
|
||||
|
||||
.custom-flat {
|
||||
font-family: Roboto-Medium;
|
||||
height: 36px !important;
|
||||
border-radius: 2px !important;
|
||||
margin-left: 8px !important;
|
||||
margin-right: 8px !important;
|
||||
padding-left: 8px !important;
|
||||
padding-right: 8px !important;
|
||||
background-color: transparent !important;
|
||||
text-transform: uppercase;
|
||||
outline: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.custom-flat:hover {
|
||||
cursor: pointer;
|
||||
background-color: rgba(0, 0, 0, 0.12) !important;
|
||||
}
|
||||
|
||||
.custom-flat:focus {
|
||||
outline: none !important;
|
||||
border: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
background-color: rgba(0, 0, 0, 0.40) !important;
|
||||
}
|
||||
|
||||
.circle-button {
|
||||
border-radius: 100% !important;
|
||||
height: 36px !important;
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
/* ==================================================================== */
|
||||
|
||||
/* Body Styling */
|
||||
body {
|
||||
width: 100%;
|
||||
font-family: "Roboto-Regular" !important;
|
||||
font-size: 14px !important;
|
||||
background-color: #e8e8e8 !important;
|
||||
}
|
||||
|
||||
.app-manager-title {
|
||||
font-family: "Roboto-Medium";
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.app-manager-sub-title {
|
||||
font-family: "Roboto-Regular";
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#app-mgt-footer {
|
||||
clear: both;
|
||||
position: relative;
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
color: white;
|
||||
background-color: #334d88;
|
||||
}
|
||||
|
||||
/* Login page styles*/
|
||||
#userName {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#password {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.login-header {
|
||||
background-color: #3f50b5;
|
||||
color: white;
|
||||
height: 128px;
|
||||
width: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 20px;
|
||||
box-shadow: -2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
#login-card {
|
||||
width: 25%;
|
||||
height: 50%;
|
||||
margin: 10% auto;
|
||||
font-family: Roboto-Regular;
|
||||
font-size: 14px;
|
||||
border-radius: 0;
|
||||
background-color: #ffffff;
|
||||
box-shadow: -2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
.login-header-title {
|
||||
font-family: Roboto-Medium;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.login-header-logo {
|
||||
height: 70px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
margin: 0 !important;
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
/* Base layout container */
|
||||
|
||||
/* Base layout header content*/
|
||||
.header-content {
|
||||
height: 128px !important;
|
||||
width: 100% !important;
|
||||
margin: 0 10px 0 0;
|
||||
background-color: #3f50b5 !important;
|
||||
position: fixed; /* Set the navbar to fixed position */
|
||||
top: 0; /* Position the navbar at the top of the page */
|
||||
z-index: 2;
|
||||
box-shadow: -2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
/* Contains the header styles.*/
|
||||
.header {
|
||||
padding: 24px 24px 10px 24px;
|
||||
/*margin: 16px 16px 20px 16px;*/
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#header-text {
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
font-family: Roboto-Medium;
|
||||
top: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* The buttons in the header (User and Notification)*/
|
||||
.header-button-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.header-user-name {
|
||||
font-family: Roboto-Medium;
|
||||
font-size: 14px;
|
||||
padding-top: 15px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.header-image {
|
||||
height: 43px;
|
||||
width: 100px;
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
#header-button {
|
||||
border-radius: 50%;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#header-button:hover {
|
||||
background-color: #4353bd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#header-button i {
|
||||
position: absolute;
|
||||
bottom: 19px;
|
||||
left: 17px;
|
||||
}
|
||||
|
||||
.btn-header {
|
||||
margin-top: 15px;
|
||||
margin-right: 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#sub-title {
|
||||
font-family: Roboto-Regular;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
padding-top: 5px;
|
||||
padding-left: 18px;
|
||||
color: RGBA(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
/* Search box styles */
|
||||
.search-box {
|
||||
display: flex;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.search-box i {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
color: #BaBaBa;
|
||||
}
|
||||
|
||||
#search {
|
||||
position: relative;
|
||||
color: white;
|
||||
background-color: transparent;
|
||||
left: 15px;
|
||||
top: 0px;
|
||||
height: 25px;
|
||||
outline: none;
|
||||
border: none;
|
||||
border-radius: 0%;
|
||||
}
|
||||
|
||||
/* Application Add button */
|
||||
#add-btn-container {
|
||||
position: absolute;
|
||||
top: 98px;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
background-color: #ff5722;
|
||||
}
|
||||
|
||||
.add-btn:hover {
|
||||
background-color: #E64A19;
|
||||
}
|
||||
|
||||
#sub-title-container {
|
||||
height: 100px;
|
||||
padding: 50px 0 20px 0;
|
||||
}
|
||||
|
||||
.application-container {
|
||||
padding: 0 !important;
|
||||
min-height: 100% !important;
|
||||
margin-top: 128px !important;
|
||||
}
|
||||
|
||||
/* Holds the app publisher pages. */
|
||||
.publisher-card {
|
||||
height: auto;
|
||||
background-color: white;
|
||||
box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.platform-link-placeholder {
|
||||
color: #888888;
|
||||
float: right;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.platform-link-placeholder i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.application-list {
|
||||
transition: margin-right .5s;
|
||||
}
|
||||
|
||||
#batch-content {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.app-list-icon {
|
||||
border-radius: 50%;
|
||||
height: 50px;
|
||||
width: 50px
|
||||
}
|
||||
|
||||
.app-table-row {
|
||||
height: 62px;
|
||||
cursor: pointer;
|
||||
padding-top: 6px;
|
||||
font-family: "Roboto-Regular";
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
.app-table-row:hover {
|
||||
color: white;
|
||||
background-color: #3f50b5;
|
||||
}
|
||||
|
||||
.app-list-table-header {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
font-family: "Roboto-Medium";
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.app-view-image {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
#app-visibility-default {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#app-image-screenshot {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
#app-image-icon {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
#app-image-banner {
|
||||
width: 400px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
#form-error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.application-create-banner-dropzone {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
border-radius: 5%;
|
||||
position: relative;
|
||||
border: dashed #888888 2px;
|
||||
}
|
||||
|
||||
.application-create-banner-dropzone i {
|
||||
position: absolute;
|
||||
top: 65px;
|
||||
left: 145px;
|
||||
}
|
||||
|
||||
.application-create-screenshot-dropzone {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: 0 5px 0 5px;
|
||||
border-radius: 10%;
|
||||
position: relative;
|
||||
border: dashed #888888 2px;
|
||||
}
|
||||
|
||||
.application-create-screenshot-dropzone i {
|
||||
position: absolute;
|
||||
top: 65px;
|
||||
left: 65px;
|
||||
}
|
||||
|
||||
.application-create-icon-dropzone {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 10%;
|
||||
position: relative;
|
||||
border: dashed #888888 2px;
|
||||
}
|
||||
|
||||
.application-create-icon-dropzone i {
|
||||
position: absolute;
|
||||
top: 65px;
|
||||
left: 65px;
|
||||
}
|
||||
|
||||
#screenshot-container {
|
||||
max-width: 600px;
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
#app-icon-container {
|
||||
height: 300px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
#modal-body-content {
|
||||
max-height: 700px;
|
||||
padding-left: 24px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.custom-footer {
|
||||
justify-content: inherit !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.footer-main-btn {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
#img-btn-screenshot {
|
||||
margin: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
#app-create-modal {
|
||||
max-width: 850px;
|
||||
border-radius: 0% !important;
|
||||
}
|
||||
|
||||
.app-create-modal-header {
|
||||
background-color: #4353bd;
|
||||
color: white;
|
||||
padding: 24px !important;
|
||||
}
|
||||
|
||||
.app-create-modal-content {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
#store {
|
||||
border: none;
|
||||
border-bottom: solid #BDBDBD 1px;
|
||||
border-radius: 0px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#version {
|
||||
border: none;
|
||||
border-bottom: solid #BDBDBD 1px;
|
||||
border-radius: 0px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#app-release-switch-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#app-release-switch-label {
|
||||
position: absolute;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#app-release-switch {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.image-sub-title {
|
||||
font-style: italic;
|
||||
font-size: 12px;
|
||||
color: #818181;
|
||||
}
|
||||
|
||||
/* Application View */
|
||||
|
||||
#application-view-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#application-view-row {
|
||||
margin: 10px 10px 0 20px;
|
||||
}
|
||||
|
||||
#app-icon {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: solid 1px black;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.app-updated-date {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.app-install-count {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.app-details-tbl {
|
||||
outline: none;
|
||||
border-color: #2196F3;
|
||||
}
|
||||
|
||||
.app-details-tbl tr {
|
||||
margin: 20px 0 0 0;
|
||||
}
|
||||
|
||||
.app-details-tbl td {
|
||||
margin-left: 10px;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
/* Application Edit Base Layout */
|
||||
|
||||
#application-edit-header {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.application-header-text {
|
||||
margin: 10px 0px 0px 10px;
|
||||
}
|
||||
|
||||
#save-btn-content {
|
||||
float: right;
|
||||
|
||||
}
|
||||
|
||||
#app-save-btn {
|
||||
border-radius: 0%;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
margin: 5px 5px 5px 0px;
|
||||
height: 70%;
|
||||
width: 50%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*Tab styling*/
|
||||
|
||||
div.tab {
|
||||
float: left;
|
||||
border-right: 1px solid #d8d8d8;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Style the tab buttons */
|
||||
|
||||
div.tab button {
|
||||
display: block;
|
||||
background-color: inherit;
|
||||
color: black;
|
||||
padding: 15px 16px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
outline: none;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
/* Change background color of buttons on hover */
|
||||
|
||||
div.tab button:hover {
|
||||
background-color: #ddd6d7;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Create an active/current "tab button" class */
|
||||
|
||||
div.tab button.active {
|
||||
background-color: #1b3bcc;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#application-edit-main-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#application-edit-outer-content {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#app-edit-content {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.back-to-app {
|
||||
position: absolute;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.back-to-app i {
|
||||
padding: 12px 10px 10px 12px;
|
||||
}
|
||||
|
||||
.back-to-app:hover {
|
||||
cursor: pointer;
|
||||
background-color: #dedede;
|
||||
transition: .5s;
|
||||
}
|
||||
|
||||
/* Create Release and Release management */
|
||||
|
||||
.release-header {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.release-create {
|
||||
height: 150px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.release-detail-content {
|
||||
width: 100%;
|
||||
margin-top: 20%;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.form-btn {
|
||||
float: right;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.release-content {
|
||||
height: 180px;
|
||||
width: 95%;
|
||||
border: dashed 1px #626262;
|
||||
border-radius: 2%;
|
||||
position: relative;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
|
||||
.release-content:after {
|
||||
content: "";
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
.release {
|
||||
margin: 30px 10px 20px 30px;
|
||||
}
|
||||
|
||||
.no-release-content {
|
||||
position: absolute;
|
||||
margin-top: 10px;
|
||||
left: 40%;
|
||||
}
|
||||
|
||||
.button-add:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.release-inner {
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
/* Application Edit General Info */
|
||||
|
||||
.app-edit-general-info {
|
||||
margin-top: 20px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.save-info {
|
||||
float: right;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.app-view-field {
|
||||
font-family: Roboto-Medium;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.app-view-text {
|
||||
font-family: Roboto-Regular;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Platform Specific Styles. */
|
||||
#platform-listing {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.create-platform i {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#platform-list {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
}
|
||||
|
||||
.platform-content {
|
||||
margin: 10px;
|
||||
padding-top: 16px;
|
||||
box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
.platform-content .row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.platform-content .col {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.platform-content-basic {
|
||||
padding: 0 16px 0 16px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.platform-content-more-outer {
|
||||
|
||||
}
|
||||
|
||||
.platform-content-more {
|
||||
padding: 16px 16px 24px 16px;
|
||||
}
|
||||
|
||||
.platform-content-footer {
|
||||
display: flex;
|
||||
padding: 8px 8px 8px 8px;
|
||||
}
|
||||
|
||||
.platform-text-container {
|
||||
padding: 8px 16px 0 16px;
|
||||
}
|
||||
|
||||
.circle-button {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.platform-icon-letter {
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-family: Roboto-Medium;
|
||||
font-size: 70px;
|
||||
color: white;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.platform-icon-container {
|
||||
height: 120px;
|
||||
width: 120px;
|
||||
background-color: #01579B;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
|
||||
-webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
|
||||
}
|
||||
|
||||
.platform-property-container {
|
||||
padding-top: 20px;
|
||||
font-family: Roboto-Regular;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.platform-property-row {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.circle-btn-clear {
|
||||
background-color: white !important;
|
||||
color: rgba(0, 0, 0, 0.50) !important;
|
||||
}
|
||||
|
||||
.circle-btn-clear:hover {
|
||||
background-color: white !important;
|
||||
color: rgba(0, 0, 0, 0.38) !important;
|
||||
}
|
||||
|
||||
.circle-btn-clear:focus {
|
||||
background-color: white !important;
|
||||
color: rgba(0, 0, 0, 0.60) !important;
|
||||
}
|
||||
|
||||
.data-table-row-cell {
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.error-code {
|
||||
text-align: center;
|
||||
font-family: Roboto-Medium;
|
||||
font-weight: 800;
|
||||
font-size: 15em;
|
||||
color: #BaBaBa;
|
||||
}
|
||||
|
||||
.error-code p {
|
||||
|
||||
}
|
||||
|
||||
.error-text {
|
||||
text-align: center;
|
||||
font-family: Roboto-Regular;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #9e9e9e;
|
||||
}
|
||||
|
||||
.circle-btn-add {
|
||||
background-color: #bababa !important;
|
||||
border-radius: 50% !important;
|
||||
height: 30px !important;
|
||||
width: 30px;
|
||||
text-align: -webkit-center;
|
||||
font-size: 18px;
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.circle-btn-add:hover {
|
||||
background-color: #828282 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
If you need to change the color of active steps in stepper,
|
||||
uncomment the following and set the background color and font color as needed.
|
||||
*/
|
||||
/*
|
||||
.stepper-active-index {
|
||||
background-color: #0a6eff !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.stepper-passed-index {
|
||||
background-color: #0a6eff !important;
|
||||
color: green !important;
|
||||
}
|
||||
*/
|
||||
@ -0,0 +1,17 @@
|
||||
const express = require('express');
|
||||
const bodyParser = require('body-parser');
|
||||
const pino = require('express-pino-logger')();
|
||||
|
||||
const app = express();
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(pino);
|
||||
|
||||
app.get('/api/greeting', (req, res) => {
|
||||
const name = req.query.name || 'World';
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.send(JSON.stringify({ greeting: `Hello ${name}!` }));
|
||||
});
|
||||
|
||||
app.listen(3001, () =>
|
||||
console.log('Express server is running on localhost:3001')
|
||||
);
|
||||
@ -0,0 +1,33 @@
|
||||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
22
components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
import React from "react";
|
||||
import "antd/dist/antd.css";
|
||||
import { renderRoutes } from "react-router-config";
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
route : props.route
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{renderRoutes(this.state.route.routes)}
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
||||
@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
||||
@ -0,0 +1,3 @@
|
||||
.App {
|
||||
padding: 20px;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<div id="root"></div>
|
||||
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
import { renderRoutes } from "react-router-config";
|
||||
import Dashboard from "./pages/dashboard/Dashboard"
|
||||
import Login from "./pages/Login";
|
||||
import {BrowserRouter} from "react-router-dom";
|
||||
|
||||
|
||||
const routes = [
|
||||
{
|
||||
component: App,
|
||||
routes: [
|
||||
{
|
||||
path: "/publisher",
|
||||
exact: true,
|
||||
component: Dashboard,
|
||||
routes: [
|
||||
{
|
||||
path: "/publisher/a",
|
||||
component: Login
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/publisher/login",
|
||||
component: Login
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
ReactDOM.render( <BrowserRouter>
|
||||
{/* kick it all off with the root route */}
|
||||
{renderRoutes(routes)}
|
||||
</BrowserRouter>, document.getElementById('root'));
|
||||
|
||||
// If you want your app to work offline and load faster, you can change
|
||||
// unregister() to register() below. Note this comes with some pitfalls.
|
||||
// Learn more about service workers: https://bit.ly/CRA-PWA
|
||||
serviceWorker.unregister();
|
||||
@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
||||
<g fill="#61DAFB">
|
||||
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
||||
<circle cx="420.9" cy="296.5" r="45.7"/>
|
||||
<path d="M520.5 78.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,83 @@
|
||||
import React from "react";
|
||||
import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox,} from 'antd';
|
||||
import styles from './Login.less';
|
||||
const {Title} = Typography;
|
||||
|
||||
class Login extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className={styles.main}>
|
||||
<div className={styles.content}>
|
||||
<Row>
|
||||
<Col span={4} offset={10}>
|
||||
<Row style={{marginBottom: 20}}>
|
||||
<Col>
|
||||
<img className={styles.logo} src={require('../../public/images/logo.svg')}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Title type="secondary" level={2}>Login</Title>
|
||||
<WrappedNormalLoginForm/>
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={4} offset={10}>
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NormalLoginForm extends React.Component {
|
||||
handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
this.props.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
return (
|
||||
<Form onSubmit={this.handleSubmit} className="login-form">
|
||||
<Form.Item>
|
||||
{getFieldDecorator('userName', {
|
||||
rules: [{ required: true, message: 'Please input your username!' }],
|
||||
})(
|
||||
<Input style={{height: 32}} prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} placeholder="Username" />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator('password', {
|
||||
rules: [{ required: true, message: 'Please input your Password!' }],
|
||||
})(
|
||||
<Input style={{height: 32}} className={styles.input} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} type="password" placeholder="Password" />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator('remember', {
|
||||
valuePropName: 'checked',
|
||||
initialValue: true,
|
||||
})(
|
||||
<Checkbox>Remember me</Checkbox>
|
||||
)}
|
||||
<a className="login-form-forgot" href="">Forgot password</a>
|
||||
<Button block type="primary" htmlType="submit" className="login-form-button">
|
||||
Log in
|
||||
</Button>
|
||||
Or <a href="">register now!</a>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const WrappedNormalLoginForm = Form.create({ name: 'normal_login' })(NormalLoginForm);
|
||||
|
||||
export default Login;
|
||||
@ -0,0 +1,34 @@
|
||||
@nice-blue: #5B83AD;
|
||||
@light-blue: @nice-blue + #111;
|
||||
|
||||
.header {
|
||||
color: @nice-blue;
|
||||
}
|
||||
|
||||
.main{
|
||||
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center 110px;
|
||||
background-size: 100%;
|
||||
|
||||
.header {
|
||||
color: @nice-blue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.content{
|
||||
padding-top: 128px;
|
||||
}
|
||||
|
||||
.logo{
|
||||
height: 44px;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
input{
|
||||
min-height: 0;
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
import React from "react";
|
||||
import { Layout, Menu, Breadcrumb } from 'antd';
|
||||
|
||||
const { Header, Content, Footer } = Layout;
|
||||
|
||||
import styles from './Dashboard.less';
|
||||
import Logo from "../../../public/images/logo.svg";
|
||||
import Login from "../Login";
|
||||
import {renderRoutes} from "react-router-config";
|
||||
import {NavLink} from "react-router-dom";
|
||||
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
route : props.route
|
||||
}
|
||||
console.log(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Layout className="layout">
|
||||
<Header>
|
||||
<div style={{backgroundImage: "url(" + { Logo} + ")"}} className={styles.logo}/>
|
||||
<Menu
|
||||
theme="light"
|
||||
mode="horizontal"
|
||||
defaultSelectedKeys={['2']}
|
||||
style={{ lineHeight: '64px' }}
|
||||
>
|
||||
<Menu.Item key="1">nav 1</Menu.Item>
|
||||
<Menu.Item key="2">nav 2</Menu.Item>
|
||||
<Menu.Item key="3">nav 3</Menu.Item>
|
||||
</Menu>
|
||||
</Header>
|
||||
<Content style={{ padding: '0 50px' }}>
|
||||
<Breadcrumb style={{ margin: '16px 0' }}>
|
||||
<Breadcrumb.Item>Home</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>List</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>App</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<NavLink exact to="/publisher/a" className="nav-link" >
|
||||
Items
|
||||
</NavLink>
|
||||
|
||||
{/* child routes won't render without this */}
|
||||
{renderRoutes(this.state.route.routes, { someProp: "these extra props are optional" })}
|
||||
<div style={{ background: '#fff', padding: 24, minHeight: 280 }}>Content</div>
|
||||
</Content>
|
||||
<Footer style={{ textAlign: 'center' }}>
|
||||
©2019 entgra.io
|
||||
</Footer>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Dashboard;
|
||||
@ -0,0 +1,7 @@
|
||||
.logo {
|
||||
width: 120px;
|
||||
height: 31px;
|
||||
background: rgba(0,0,0,.2);
|
||||
margin: 16px 24px 16px 0;
|
||||
float: left;
|
||||
}
|
||||
@ -1,30 +1,14 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// In production, we register a service worker to serve assets from local cache.
|
||||
// This optional code is used to register a service worker.
|
||||
// register() is not called by default.
|
||||
|
||||
// This lets the app load faster on subsequent visits in production, and gives
|
||||
// it offline capabilities. However, it also means that developers (and users)
|
||||
// will only see deployed updates on the "N+1" visit to a page, since previously
|
||||
// cached resources are updated in the background.
|
||||
// will only see deployed updates on subsequent visits to a page, after all the
|
||||
// existing tabs open on the page have been closed, since previously cached
|
||||
// resources are updated in the background.
|
||||
|
||||
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
|
||||
// This link also includes instructions on opting out of this behavior.
|
||||
// To learn more about the benefits of this model and instructions on how to
|
||||
// opt-in, read https://bit.ly/CRA-PWA
|
||||
|
||||
const isLocalhost = Boolean(
|
||||
window.location.hostname === 'localhost' ||
|
||||
@ -36,50 +20,74 @@ const isLocalhost = Boolean(
|
||||
)
|
||||
);
|
||||
|
||||
export default function register() {
|
||||
export function register(config) {
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
// from what our page is served on. This might happen if a CDN is used to
|
||||
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
|
||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const swUrl = `${process.env.PUBLIC_URL}/store/service-worker.js`;
|
||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||
|
||||
if (!isLocalhost) {
|
||||
// Is not local host. Just register service worker
|
||||
registerValidSW(swUrl);
|
||||
if (isLocalhost) {
|
||||
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||
checkValidServiceWorker(swUrl, config);
|
||||
|
||||
// Add some additional logging to localhost, pointing developers to the
|
||||
// service worker/PWA documentation.
|
||||
navigator.serviceWorker.ready.then(() => {
|
||||
console.log(
|
||||
'This web app is being served cache-first by a service ' +
|
||||
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// This is running on localhost. Lets check if a service worker still exists or not.
|
||||
checkValidServiceWorker(swUrl);
|
||||
// Is not localhost. Just register service worker
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function registerValidSW(swUrl) {
|
||||
function registerValidSW(swUrl, config) {
|
||||
navigator.serviceWorker
|
||||
.register(swUrl)
|
||||
.then(registration => {
|
||||
registration.onupdatefound = () => {
|
||||
const installingWorker = registration.installing;
|
||||
if (installingWorker == null) {
|
||||
return;
|
||||
}
|
||||
installingWorker.onstatechange = () => {
|
||||
if (installingWorker.state === 'installed') {
|
||||
if (navigator.serviceWorker.controller) {
|
||||
// At this point, the old content will have been purged and
|
||||
// the fresh content will have been added to the cache.
|
||||
// It's the perfect time to display a "New content is
|
||||
// available; please refresh." message in your web app.
|
||||
console.log('New content is available; please refresh.');
|
||||
// At this point, the updated precached content has been fetched,
|
||||
// but the previous service worker will still serve the older
|
||||
// content until all client tabs are closed.
|
||||
console.log(
|
||||
'New content is available and will be used when all ' +
|
||||
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
||||
);
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onUpdate) {
|
||||
config.onUpdate(registration);
|
||||
}
|
||||
} else {
|
||||
// At this point, everything has been precached.
|
||||
// It's the perfect time to display a
|
||||
// "Content is cached for offline use." message.
|
||||
console.log('Content is cached for offline use.');
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onSuccess) {
|
||||
config.onSuccess(registration);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -90,14 +98,15 @@ function registerValidSW(swUrl) {
|
||||
});
|
||||
}
|
||||
|
||||
function checkValidServiceWorker(swUrl) {
|
||||
function checkValidServiceWorker(swUrl, config) {
|
||||
// Check if the service worker can be found. If it can't reload the page.
|
||||
fetch(swUrl)
|
||||
.then(response => {
|
||||
// Ensure service worker exists, and that we really are getting a JS file.
|
||||
const contentType = response.headers.get('content-type');
|
||||
if (
|
||||
response.status === 404 ||
|
||||
response.headers.get('content-type').indexOf('javascript') === -1
|
||||
(contentType != null && contentType.indexOf('javascript') === -1)
|
||||
) {
|
||||
// No service worker found. Probably a different app. Reload the page.
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
@ -107,7 +116,7 @@ function checkValidServiceWorker(swUrl) {
|
||||
});
|
||||
} else {
|
||||
// Service worker found. Proceed as normal.
|
||||
registerValidSW(swUrl);
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var path = require('path');
|
||||
const HtmlWebPackPlugin = require("html-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
const config = {
|
||||
devtool: "source-map",
|
||||
watch: false,
|
||||
resolve: {
|
||||
alias: {
|
||||
AppData: path.resolve(__dirname, 'source/src/app/common/'),
|
||||
AppComponents: path.resolve(__dirname, 'source/src/app/components/')
|
||||
},
|
||||
extensions: ['.jsx', '.js', '.ttf', '.woff', '.woff2', '.svg']
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: [
|
||||
{
|
||||
loader: "html-loader",
|
||||
options: { minimize: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [MiniCssExtractPlugin.loader, "css-loader"]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
"css-loader",
|
||||
"postcss-loader",
|
||||
"sass-loader"
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [ 'style-loader', 'scss-loader' ]
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: [
|
||||
{
|
||||
loader: "style-loader"
|
||||
},
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
modules: true,
|
||||
localIdentName: "[local]___[hash:base64:5]"
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: "less-loader"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.(woff|woff2|eot|ttf|svg)$/,
|
||||
loader: 'url-loader?limit=100000',
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g)/i,
|
||||
use: [
|
||||
{
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
name: "./img/[name].[ext]",
|
||||
limit: 10000
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: "img-loader"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebPackPlugin({
|
||||
template: "./src/index.html",
|
||||
filename: "./index.html"
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
chunkFilename: "[id].css"
|
||||
})
|
||||
],
|
||||
externals: {
|
||||
'Config': JSON.stringify(require('./public/conf/config.json'))
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
config.watch = true;
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
@ -1,68 +0,0 @@
|
||||
<%
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var log = new Log("api/data-tables-invoker-api.jag");
|
||||
|
||||
var uri = request.getRequestURI();
|
||||
var uriMatcher = new URIMatcher(String(uri));
|
||||
|
||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
|
||||
var utility = require("/app/modules/utility.js")["utility"];
|
||||
|
||||
function appendQueryParam (url, queryParam , value) {
|
||||
if (url.indexOf("?") > 0) {
|
||||
return url + "&" + queryParam + "=" + value;
|
||||
}
|
||||
return url + "?" + queryParam + "=" + value;
|
||||
}
|
||||
|
||||
if (uriMatcher.match("/{context}/api/data-tables/invoker")) {
|
||||
var url = request.getParameter("url");
|
||||
var targetURL = devicemgtProps["httpsURL"] + request.getParameter("url");
|
||||
//noinspection JSUnresolvedFunction getAllParameters
|
||||
var allParams = request.getAllParameters();
|
||||
|
||||
for (var allParamsKey in allParams) {
|
||||
if (allParams.hasOwnProperty(allParamsKey)) {
|
||||
if (allParamsKey == "limit" || allParamsKey == "offset") {
|
||||
targetURL = appendQueryParam(targetURL, allParamsKey, allParams[allParamsKey]);
|
||||
} else if (allParamsKey == "filter") {
|
||||
if (allParams[allParamsKey]) {
|
||||
var searchPayload = JSON.parse(allParams[allParamsKey]);
|
||||
for (var searchPayloadKey in searchPayload) {
|
||||
if (searchPayload.hasOwnProperty(searchPayloadKey)) {
|
||||
targetURL = appendQueryParam(targetURL, searchPayloadKey, searchPayload[searchPayloadKey]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
serviceInvokers.XMLHttp.get(
|
||||
targetURL,
|
||||
// response callback
|
||||
function (backendResponse) {
|
||||
response["status"] = backendResponse["status"];
|
||||
response["content"] = utility.encodeJson(backendResponse["responseText"]);
|
||||
response["contentType"] = "application/json";
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,201 +0,0 @@
|
||||
<%
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var uri = request.getRequestURI();
|
||||
var uriMatcher = new URIMatcher(String(uri));
|
||||
|
||||
var log = new Log("api/device-api.jag");
|
||||
var constants = require("/app/modules/constants.js");
|
||||
var deviceModule = require("/app/modules/business-controllers/app.js")["storeModule"];
|
||||
var utility = require("/app/modules/utility.js").utility;
|
||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
||||
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
|
||||
|
||||
var user = session.get(constants.USER_SESSION_KEY);
|
||||
var result;
|
||||
|
||||
response.contentType = 'application/json';
|
||||
|
||||
if (!user) {
|
||||
response.sendRedirect("/devicemgt/login?#login-required");
|
||||
exit();
|
||||
} else {
|
||||
if (uriMatcher.match("/{context}/api/devices/sketch/download")) {
|
||||
// works as a proxy to pass the relavant query string to back end api.
|
||||
var queryString = request.getQueryString();
|
||||
if (!queryString) {
|
||||
queryString = "";
|
||||
} else {
|
||||
queryString = "?" + queryString;
|
||||
}
|
||||
var type = request.getParameter("type"); // need a better solution here
|
||||
deviceTypeConfig = utility.getDeviceTypeConfig(type);
|
||||
if (deviceTypeConfig && deviceTypeConfig.type.downloadAgentUri) {
|
||||
hearders = [{"name": constants["ACCEPT_IDENTIFIER"], "value": constants["APPLICATION_ZIP"]}];
|
||||
sketchDownloadEndPoint = devicemgtProps["httpsURL"] + "/" + deviceTypeConfig.type.downloadAgentUri;
|
||||
serviceInvokers.HttpClient.get(sketchDownloadEndPoint + queryString, function (responsePayload, responseHeaders) {
|
||||
if (responseHeaders) {
|
||||
for (var i = 0; i < responseHeaders.length; i++) {
|
||||
var header = responseHeaders[i];
|
||||
var headerName = String(header.getName());
|
||||
var headerValue = String(header.getValue());
|
||||
response.addHeader(headerName, headerValue);
|
||||
}
|
||||
var streamObject = new Stream(responsePayload);
|
||||
print(streamObject);
|
||||
} else {
|
||||
return responsePayload;
|
||||
}
|
||||
}, function (responsePayload) {
|
||||
log.error(responsePayload);
|
||||
var response = {};
|
||||
response["status"] = "error";
|
||||
return response;
|
||||
}
|
||||
, hearders);
|
||||
} else {
|
||||
result = 400;
|
||||
}
|
||||
} else if (uriMatcher.match("/{context}/api/devices/all")) {
|
||||
result = deviceModule.getOwnDevices();
|
||||
|
||||
} else if (uriMatcher.match("/{context}/api/devices/count")) {
|
||||
var count = deviceModule.getOwnDevicesCount().data;
|
||||
result = count.toString();
|
||||
|
||||
} else if (uriMatcher.match("/{context}/api/devices/types")) {
|
||||
result = deviceModule.listDeviceTypes();
|
||||
|
||||
} else if (uriMatcher.match("/{context}/api/devices/{type}/{deviceId}/remove")) {
|
||||
var elements = uriMatcher.elements();
|
||||
var deviceId = elements.deviceId;
|
||||
var type = elements.type;
|
||||
result = deviceModule.removeDevice(type, deviceId);
|
||||
|
||||
} else if (uriMatcher.match("/{context}/api/devices/{type}/{deviceId}/update")) {
|
||||
var elements = uriMatcher.elements();
|
||||
var deviceId = elements.deviceId;
|
||||
var type = elements.type;
|
||||
var deviceName = request.getParameter("name");
|
||||
result = deviceModule.updateDevice(type, deviceId, deviceName);
|
||||
} else if (uriMatcher.match("/{context}/api/devices")) {
|
||||
var url = request.getParameter("url");
|
||||
var draw = request.getParameter("draw");
|
||||
var length = request.getParameter("length");
|
||||
var start = request.getParameter("start");
|
||||
var search = request.getParameter("search[value]");
|
||||
var deviceName = request.getParameter("columns[1][search][value]");
|
||||
var owner = request.getParameter("columns[2][search][value]");
|
||||
var status = request.getParameter("columns[3][search][value]");
|
||||
var platform = request.getParameter("columns[4][search][value]");
|
||||
var ownership = request.getParameter("columns[5][search][value]");
|
||||
var targetURL;
|
||||
|
||||
function appendQueryParam (url, queryParam , value) {
|
||||
if (url.indexOf("?") > 0) {
|
||||
return url + "&" + queryParam + "=" + value;
|
||||
}
|
||||
return url + "?" + queryParam + "=" + value;
|
||||
}
|
||||
targetURL = devicemgtProps.httpsURL + request.getParameter("url");
|
||||
targetURL = appendQueryParam(targetURL, "draw", draw);
|
||||
targetURL = appendQueryParam(targetURL, "start", start);
|
||||
targetURL = appendQueryParam(targetURL, "length", length);
|
||||
|
||||
if (search && search !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "search", search);
|
||||
}
|
||||
|
||||
if (deviceName && deviceName !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "device-name", deviceName);
|
||||
}
|
||||
|
||||
if (owner && owner !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "user", owner);
|
||||
}
|
||||
|
||||
if (status && status !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "status", status);
|
||||
}
|
||||
|
||||
if (platform && platform !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "type", platform);
|
||||
}
|
||||
|
||||
if (ownership && ownership !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "ownership", ownership);
|
||||
}
|
||||
|
||||
serviceInvokers.XMLHttp.get(
|
||||
targetURL, function (responsePayload) {
|
||||
response.status = 200;
|
||||
result = responsePayload;
|
||||
},
|
||||
function (responsePayload) {
|
||||
response.status = responsePayload.status;
|
||||
result = responsePayload.responseText;
|
||||
});
|
||||
} else if (uriMatcher.match("/{context}/api/devices/")) {
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/list")) {
|
||||
result = deviceModule.listDevices();
|
||||
} else {
|
||||
response.sendError(403);
|
||||
}
|
||||
} else if (uriMatcher.match("/{context}/api/devices/{type}/{deviceId}")) {
|
||||
elements = uriMatcher.elements();
|
||||
deviceId = elements.deviceId;
|
||||
type = elements.type;
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/list")) {
|
||||
result = deviceModule.viewApps(type, deviceId);
|
||||
}else {
|
||||
response.sendError(403);
|
||||
}
|
||||
} else if (uriMatcher.match("/{context}/api/devices/agent/{type}/{deviceId}/config")) {
|
||||
elements = uriMatcher.elements();
|
||||
deviceId = elements.deviceId;
|
||||
type = elements.type;
|
||||
operation = elements.operation;
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device")) {
|
||||
result = deviceModule.getDeviceAgentConfig(type, deviceId);
|
||||
if (!result) {
|
||||
response.sendError(500);
|
||||
}
|
||||
} else {
|
||||
response.sendError(403);
|
||||
}
|
||||
} else if (uriMatcher.match("{context}/api/devices/{type}/{deviceId}/{operation}")) {
|
||||
elements = uriMatcher.elements();
|
||||
deviceId = elements.deviceId;
|
||||
type = elements.type;
|
||||
operation = elements.operation;
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/operation")) {
|
||||
result = deviceModule.performOperation(deviceId, operation, [], type);
|
||||
} else {
|
||||
response.sendError(403);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returning the result.
|
||||
if (result) {
|
||||
print(result);
|
||||
}
|
||||
|
||||
%>
|
||||
@ -1,87 +0,0 @@
|
||||
<%
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var uri = request.getRequestURI();
|
||||
var uriMatcher = new URIMatcher(String(uri));
|
||||
|
||||
var log = new Log("api/device-api.jag");
|
||||
var constants = require("/app/modules/constants.js");
|
||||
var utility = require("/app/modules/utility.js").utility;
|
||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
|
||||
|
||||
var user = session.get(constants.USER_SESSION_KEY);
|
||||
var result;
|
||||
|
||||
response.contentType = 'application/json';
|
||||
|
||||
if (!user) {
|
||||
response.sendRedirect("/devicemgt/login?#login-required");
|
||||
exit();
|
||||
} else {
|
||||
if (uriMatcher.match("/{context}/api/groups")) {
|
||||
var url = request.getParameter("url");
|
||||
var draw = request.getParameter("draw");
|
||||
var length = request.getParameter("length");
|
||||
var start = request.getParameter("start");
|
||||
var search = request.getParameter("search[value]");
|
||||
var groupName = request.getParameter("columns[1][search][value]");
|
||||
var owner = request.getParameter("columns[2][search][value]");
|
||||
var targetURL;
|
||||
|
||||
function appendQueryParam(url, queryParam, value) {
|
||||
if (url.indexOf("?") > 0) {
|
||||
return url + "&" + queryParam + "=" + value;
|
||||
}
|
||||
return url + "?" + queryParam + "=" + value;
|
||||
}
|
||||
|
||||
targetURL = devicemgtProps.httpsURL + request.getParameter("url");
|
||||
targetURL = appendQueryParam(targetURL, "start", start);
|
||||
targetURL = appendQueryParam(targetURL, "length", length);
|
||||
|
||||
if (search && search !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "search", search);
|
||||
}
|
||||
|
||||
if (groupName && groupName !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "group-name", groupName);
|
||||
}
|
||||
|
||||
if (owner && owner !== "") {
|
||||
targetURL = appendQueryParam(targetURL, "user", owner);
|
||||
}
|
||||
|
||||
serviceInvokers.XMLHttp.get(
|
||||
targetURL, function (responsePayload) {
|
||||
response.status = 200;
|
||||
result = responsePayload;
|
||||
},
|
||||
function (responsePayload) {
|
||||
response.status = responsePayload.status;
|
||||
result = responsePayload.responseText;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
print(result);
|
||||
}
|
||||
|
||||
%>
|
||||