Add filter to get Web apps in Enrollment Application Install

Add filter file
uddhika-device-mgt
Ashvini Wegodapola 6 months ago
parent 03d6a145d8
commit 7616c2255c

@ -118,6 +118,11 @@ public class Filter {
*/ */
private boolean isNotRetired; private boolean isNotRetired;
/**
* To check whether web applications should be returned
*/
private boolean withWebApps;
public int getLimit() { public int getLimit() {
return limit; return limit;
} }
@ -221,4 +226,12 @@ public class Filter {
public void setNotRetired(boolean notRetired) { public void setNotRetired(boolean notRetired) {
isNotRetired = notRetired; isNotRetired = notRetired;
} }
public boolean isWithWebApps() {
return withWebApps;
}
public void setWithWebApps(boolean withWebApps) {
this.withWebApps = withWebApps;
}
} }

@ -178,7 +178,11 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
sql += "AND AP_APP_RELEASE.CURRENT_STATE = ? "; sql += "AND AP_APP_RELEASE.CURRENT_STATE = ? ";
} }
if (deviceTypeId != -1) { if (deviceTypeId != -1) {
sql += "AND AP_APP.DEVICE_TYPE_ID = ? "; sql += "AND (AP_APP.DEVICE_TYPE_ID = ? ";
if (filter.isWithWebApps()) {
sql += "OR AP_APP.DEVICE_TYPE_ID = 0 ";
}
sql += ") ";
} }
if (filter.isNotRetired()) { if (filter.isNotRetired()) {
sql += "AND AP_APP.STATUS != 'RETIRED' "; sql += "AND AP_APP.STATUS != 'RETIRED' ";
@ -309,7 +313,11 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
sql += " AND AP_APP_RELEASE.CURRENT_STATE = ?"; sql += " AND AP_APP_RELEASE.CURRENT_STATE = ?";
} }
if (deviceTypeId != -1) { if (deviceTypeId != -1) {
sql += " AND AP_APP.DEVICE_TYPE_ID = ?"; sql += "AND (AP_APP.DEVICE_TYPE_ID = ? ";
if (filter.isWithWebApps()) {
sql += "OR AP_APP.DEVICE_TYPE_ID = 0 ";
}
sql += ") ";
} }
if (filter.isNotRetired()) { if (filter.isNotRetired()) {
sql += " AND AP_APP.STATUS != 'RETIRED'"; sql += " AND AP_APP.STATUS != 'RETIRED'";

Loading…
Cancel
Save