forked from community/device-mgt-core
Add new application type for IoT use cases. Further, it is named as CUSTOM4.x.x
parent
bf67894924
commit
cfd0f709ef
@ -0,0 +1,125 @@
|
|||||||
|
/* 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.common.wrapper;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@ApiModel(value = "CustomAppReleaseWrapper", description = "This class holds the details when releasing an Custom app release to application store")
|
||||||
|
public class CustomAppReleaseWrapper {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "description",
|
||||||
|
value = "Description of the application release")
|
||||||
|
@NotNull
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "releaseType",
|
||||||
|
value = "Release type of the application release",
|
||||||
|
required = true,
|
||||||
|
example = "alpha, beta etc")
|
||||||
|
@NotNull
|
||||||
|
private String releaseType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "price",
|
||||||
|
value = "Price of the application release",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private Double price;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "isSharedWithAllTenants",
|
||||||
|
value = "If application release is shared with all tenants it is eqal to 1 otherwise 0",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private boolean isSharedWithAllTenants;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "metaData",
|
||||||
|
value = "Meta data of the application release",
|
||||||
|
required = true)
|
||||||
|
private String metaData;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "version",
|
||||||
|
value = "Version of the public app release.",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "packageName",
|
||||||
|
value = "Package name of the public app release.",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private String packageName;
|
||||||
|
|
||||||
|
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 getDescription() { return description; }
|
||||||
|
|
||||||
|
public void setDescription(String description) { this.description = description; }
|
||||||
|
|
||||||
|
public boolean isSharedWithAllTenants() { return isSharedWithAllTenants; }
|
||||||
|
|
||||||
|
public void setSharedWithAllTenants(boolean sharedWithAllTenants) {
|
||||||
|
isSharedWithAllTenants = sharedWithAllTenants;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPackageName() {
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackageName(String packageName) {
|
||||||
|
this.packageName = packageName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
/* 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.common.wrapper;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@ApiModel(value = "CustomAppWrapper", description = "CustomAppWrapper represents an Application used to install in IoT devices")
|
||||||
|
public class CustomAppWrapper {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",
|
||||||
|
value = "Name of the application",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "description",
|
||||||
|
value = "Description of the application",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "categories",
|
||||||
|
value = "CategoryDTO of the application",
|
||||||
|
required = true,
|
||||||
|
example = "Educational, Gaming, Travel, Entertainment etc")
|
||||||
|
@NotNull
|
||||||
|
private List<String> categories;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "subMethod",
|
||||||
|
value = "Subscription type of the application",
|
||||||
|
required = true,
|
||||||
|
example = "PAID, FREE")
|
||||||
|
@NotNull
|
||||||
|
private String subMethod;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "paymentCurrency",
|
||||||
|
value = "Payment currency of the application",
|
||||||
|
required = true,
|
||||||
|
example = "$")
|
||||||
|
private String paymentCurrency;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "tags",
|
||||||
|
value = "List of application tags")
|
||||||
|
@NotNull
|
||||||
|
private List<String> tags;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "unrestrictedRoles",
|
||||||
|
value = "List of roles that users should have to access the application")
|
||||||
|
@NotNull
|
||||||
|
private List<String> unrestrictedRoles;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deviceType",
|
||||||
|
value = "Related device type of the application",
|
||||||
|
required = true,
|
||||||
|
example = "IoS, Android, Arduino, RaspberryPi etc")
|
||||||
|
@NotNull
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "customAppReleaseWrappers",
|
||||||
|
value = "List of custom app releases",
|
||||||
|
required = true)
|
||||||
|
@NotNull
|
||||||
|
private List<CustomAppReleaseWrapper> customAppReleaseWrappers;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) { this.name = name; }
|
||||||
|
|
||||||
|
public List<String> getCategories() { return categories; }
|
||||||
|
|
||||||
|
public void setCategories(List<String> categories) {
|
||||||
|
this.categories = categories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getTags() { return tags; }
|
||||||
|
|
||||||
|
public void setTags(List<String> tags) { this.tags = tags; }
|
||||||
|
|
||||||
|
public String getSubMethod() { return subMethod; }
|
||||||
|
|
||||||
|
public void setSubMethod(String subMethod) { this.subMethod = subMethod; }
|
||||||
|
|
||||||
|
public String getPaymentCurrency() { return paymentCurrency; }
|
||||||
|
|
||||||
|
public void setPaymentCurrency(String paymentCurrency) { this.paymentCurrency = paymentCurrency; }
|
||||||
|
|
||||||
|
public List<CustomAppReleaseWrapper> getCustomAppReleaseWrappers() { return customAppReleaseWrappers; }
|
||||||
|
|
||||||
|
public void setCustomAppReleaseWrappers(List<CustomAppReleaseWrapper> customAppReleaseWrappers) {
|
||||||
|
this.customAppReleaseWrappers = customAppReleaseWrappers; }
|
||||||
|
|
||||||
|
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,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://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 React from "react";
|
||||||
|
import {
|
||||||
|
PageHeader,
|
||||||
|
Typography,
|
||||||
|
Breadcrumb,
|
||||||
|
Icon
|
||||||
|
} from "antd";
|
||||||
|
import AddNewAppForm from "../../../components/new-app/AddNewAppForm";
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
|
|
||||||
|
const {Paragraph} = Typography;
|
||||||
|
|
||||||
|
const formConfig = {
|
||||||
|
installationType: "CUSTOM",
|
||||||
|
endpoint: "/custom-app",
|
||||||
|
jsonPayloadName: "application",
|
||||||
|
releaseWrapperName: "customAppReleaseWrappers",
|
||||||
|
specificElements: {
|
||||||
|
binaryFile: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
packageName : {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
version : {
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class AddNewCustomApp extends React.Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
current: 0,
|
||||||
|
categories: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<PageHeader style={{paddingTop:0}}>
|
||||||
|
<Breadcrumb style={{paddingBottom:16}}>
|
||||||
|
<Breadcrumb.Item>
|
||||||
|
<Link to="/publisher/apps"><Icon type="home"/> Home</Link>
|
||||||
|
</Breadcrumb.Item>
|
||||||
|
<Breadcrumb.Item>Add New Custom App</Breadcrumb.Item>
|
||||||
|
</Breadcrumb>
|
||||||
|
<div className="wrap">
|
||||||
|
<h3>Add New Custom App</h3>
|
||||||
|
<Paragraph>Submit and share your own application to the corporate app store.</Paragraph>
|
||||||
|
</div>
|
||||||
|
</PageHeader>
|
||||||
|
<div style={{background: '#f0f2f5', padding: 24, minHeight: 720}}>
|
||||||
|
<AddNewAppForm formConfig={formConfig}/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AddNewCustomApp;
|
@ -0,0 +1,62 @@
|
|||||||
|
/* 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.mgt.common.app.mgt.android;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents the Enterprise AuthenticationImpl information.
|
||||||
|
*/
|
||||||
|
public class CustomApplication implements Serializable {
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
private String url;
|
||||||
|
private String appIdentifier;
|
||||||
|
|
||||||
|
public String getAppIdentifier() {
|
||||||
|
return appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppIdentifier(String appIdentifier) {
|
||||||
|
this.appIdentifier = appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJSON() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
return gson.toJson(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue