@GET @Produces("text/html") @Path(value = "list") public Object doList(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getLocalService(PackageManager.class); String targetPlatform = getTargetPlatform(filterOnPlatform); List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listPackages(targetPlatform); } else { pkgs = pm.listPackages(PackageType.getByValue(pkgType), targetPlatform); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", true).arg("source", "list").arg( "filterOnPlatform", filterOnPlatform); }
@GET @Produces("text/html") @Path(value = "details/{pkgId}") public Object getDetails(@PathParam("pkgId") String pkgId) { PackageManager pm = Framework.getLocalService(PackageManager.class); DownloadablePackage pkg = pm.getPackage(pkgId); if (pkg != null) { return getView("pkgDetails").arg("pkg", pkg); } else { return getView("pkgNotFound").arg("pkgId", pkgId); } }
@GET @Produces("text/html") @Path(value = "details/{pkgId}") public Object getDetails(@PathParam("pkgId") String pkgId) { PackageManager pm = Framework.getService(PackageManager.class); DownloadablePackage pkg = pm.getPackage(pkgId); if (pkg != null) { return getView("pkgDetails").arg("pkg", pkg); } else { return getView("pkgNotFound").arg("pkgId", pkgId); } }
@GET @Produces("text/html") @Path(value = "list") public Object doList(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getService(PackageManager.class); String targetPlatform = getTargetPlatform(filterOnPlatform); List<DownloadablePackage> pkgs; if (StringUtils.isBlank(pkgType)) { pkgs = pm.listPackages(targetPlatform); } else { pkgs = pm.listPackages(PackageType.getByValue(pkgType), targetPlatform); } return getView("simpleListing").arg("pkgs", pm.sort(pkgs)) .arg("showCommunityInfo", true) .arg("source", "list") .arg("filterOnPlatform", filterOnPlatform); }
@GET @Produces("text/html") @Path(value = "studio") public Object getStudio() { PackageManager pm = Framework.getLocalService(PackageManager.class); List<DownloadablePackage> pkgs = pm.listAllStudioRemoteOrLocalPackages(); List<DownloadablePackage> pkgsWithoutSnapshot = StudioSnapshotHelper.removeSnapshot(pkgs); return getView("simpleListing").arg("pkgs", pm.sort(pkgsWithoutSnapshot)).arg("showCommunityInfo", false).arg( "source", "studio"); }
@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 = "studio") public Object getStudio() { PackageManager pm = Framework.getService(PackageManager.class); List<DownloadablePackage> pkgs = pm.listAllStudioRemoteOrLocalPackages(); List<DownloadablePackage> pkgsWithoutSnapshot = StudioSnapshotHelper.removeSnapshot(pkgs); return getView("simpleListing").arg("pkgs", pm.sort(pkgsWithoutSnapshot)) .arg("showCommunityInfo", false) .arg("source", "studio"); }
@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 = "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 = "updates") public Object getUpdates(@QueryParam("type") String pkgType, @QueryParam("filterOnPlatform") Boolean filterOnPlatform) { PackageManager pm = Framework.getService(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.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.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); }
String targetPlatform = getTargetPlatform(filterOnPlatform); if (!StringUtils.isEmpty(searchString)) { // SEARCH IS NOT IMPLEMENTED pkgs = pm.searchPackages(searchString); return getView("simpleListing").arg("pkgs", pm.sort(pkgs)).arg("showCommunityInfo", false).arg("source", "remote").arg("filterOnPlatform", filterOnPlatform.toString()).arg("type", pkgType.toString()).arg( "onlyRemote", onlyRemote.toString());
String targetPlatform = getTargetPlatform(filterOnPlatform); if (!StringUtils.isEmpty(searchString)) { // SEARCH IS NOT IMPLEMENTED pkgs = pm.searchPackages(searchString); return getView("simpleListing").arg("pkgs", pm.sort(pkgs)) .arg("showCommunityInfo", false) .arg("source", "remote")