public static SharedPackageListingsSettings instance(HttpServletRequest request) { return instance(request.getSession(true)); }
public static SharedPackageListingsSettings instance(HttpServletRequest request) { return instance(request.getSession(true)); }
public boolean getOnlyRemote() { return SharedPackageListingsSettings.instance().get("remote").isOnlyRemote(); }
public void setOnlyRemote(boolean onlyRemote) { SharedPackageListingsSettings.instance().get("remote").setOnlyRemote(onlyRemote); }
public static SharedPackageListingsSettings instance() { HttpServletRequest request = null; if (FacesContext.getCurrentInstance() != null) { request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); } else if (RequestContext.getActiveContext() != null) { request = RequestContext.getActiveContext().getRequest(); } if (request != null) { return instance(request); } return null; }
public void setOnlyRemote(boolean onlyRemote) { SharedPackageListingsSettings.instance().get("remote").setOnlyRemote(onlyRemote); }
public boolean getOnlyRemote() { return SharedPackageListingsSettings.instance().get("remote").isOnlyRemote(); }
public void setPackageTypeFilter(String filter) { SharedPackageListingsSettings.instance().get(getListName()).setPackageTypeFilter(filter); }
public String getPackageTypeFilter() { return SharedPackageListingsSettings.instance().get(getListName()).getPackageTypeFilter(); }
public String getPackageTypeFilter() { return SharedPackageListingsSettings.instance().get(getListName()).getPackageTypeFilter(); }
public void setPlatformFilter(boolean doFilter) { SharedPackageListingsSettings.instance().get(getListName()).setPlatformFilter(doFilter); }
public void setPackageTypeFilter(String filter) { SharedPackageListingsSettings.instance().get(getListName()).setPackageTypeFilter(filter); }
public boolean getPlatformFilter() { return SharedPackageListingsSettings.instance().get(getListName()).getPlatformFilter(); }
public void setPlatformFilter(boolean doFilter) { SharedPackageListingsSettings.instance().get(getListName()).setPlatformFilter(doFilter); }
public boolean getPlatformFilter() { return SharedPackageListingsSettings.instance().get(getListName()).getPlatformFilter(); }
@GET @Produces("text/html") @Path(value = "updates") public Object getUpdates(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getLocalService(PackageManager.class); if (pkgType == null) { pkgType = SharedPackageListingsSettings.instance().get("updates").getPackageTypeFilter(); } if (filterOnPlatform == null) { filterOnPlatform = SharedPackageListingsSettings.instance().get("updates").getPlatformFilter(); } String targetPlatform = getTargetPlatform(filterOnPlatform); List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listUpdatePackages(null, targetPlatform); } else { pkgs = pm.listUpdatePackages(PackageType.getByValue(pkgType), targetPlatform); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", true).arg("source", "updates").arg("filterOnPlatform", filterOnPlatform); }
@GET @Produces("text/html") @Path(value = "local") public Object getLocal(@QueryParam("type") String pkgType) { PackageManager pm = Framework.getService(PackageManager.class); if (pkgType == null) { pkgType = SharedPackageListingsSettings.instance().get("local").getPackageTypeFilter(); } List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listLocalPackages(); } else { pkgs = pm.listLocalPackages(PackageType.getByValue(pkgType)); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", false).arg("source", "local"); }
@GET @Produces("text/html") @Path(value = "local") public Object getLocal(@QueryParam("type") String pkgType) { PackageManager pm = Framework.getLocalService(PackageManager.class); if (pkgType == null) { pkgType = SharedPackageListingsSettings.instance().get("local").getPackageTypeFilter(); } List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listLocalPackages(); } else { pkgs = pm.listLocalPackages(PackageType.getByValue(pkgType)); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", false).arg("source", "local"); }
@GET @Produces("text/html") @Path(value = "private") public Object getPrivate(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getLocalService(PackageManager.class); if (pkgType == null) { pkgType = SharedPackageListingsSettings.instance().get("private").getPackageTypeFilter(); } if (filterOnPlatform == null) { filterOnPlatform = SharedPackageListingsSettings.instance().get("private").getPlatformFilter(); } String targetPlatform = getTargetPlatform(filterOnPlatform); List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listPrivatePackages(targetPlatform); } else { pkgs = pm.listPrivatePackages(PackageType.getByValue(pkgType), targetPlatform); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", true).arg("source", "private").arg("filterOnPlatform", filterOnPlatform); }
@GET @Produces("text/html") @Path(value = "private") public Object getPrivate(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getService(PackageManager.class); if (pkgType == null) { pkgType = SharedPackageListingsSettings.instance().get("private").getPackageTypeFilter(); } if (filterOnPlatform == null) { filterOnPlatform = SharedPackageListingsSettings.instance().get("private").getPlatformFilter(); } String targetPlatform = getTargetPlatform(filterOnPlatform); List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listPrivatePackages(targetPlatform); } else { pkgs = pm.listPrivatePackages(PackageType.getByValue(pkgType), targetPlatform); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)) .arg("showCommunityInfo", true) .arg("source", "private") .arg("filterOnPlatform", filterOnPlatform); }