Пример #1
0
    public List<PackageVersion> getInstalledPackages() {
      ContentManagerRemote contentManager = remoteClient.getContentManager();

      PackageVersionCriteria criteria = new PackageVersionCriteria();
      criteria.addFilterResourceId(resourceId);
      // criteria.addFilterPackageTypeId()  TODO ADD this when the filter is added

      return contentManager.findPackageVersionsByCriteria(remoteClient.getSubject(), criteria);
    }
Пример #2
0
  private void initContent() {
    ContentManagerRemote contentManager = remoteClient.getContentManager();
    List<PackageType> types = null;
    try {
      types =
          contentManager.findPackageTypes(
              remoteClient.getSubject(),
              resource.getResourceType().getName(),
              resource.getResourceType().getPlugin());

      for (PackageType packageType : types) {
        contentTypes.put(packageType.getName(), new ContentType(packageType));
      }
    } catch (ResourceTypeNotFoundException e) {
      LOG.error(
          "Could not find resource type while creating content mappings of the resource proxy for resource with id "
              + resourceId,
          e);
    }
  }