Add filter to display web apps in Enrollment Application Install

pull/412/head
Lasantha Dharmakeerthi 6 months ago
commit c03e317e4b

@ -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