예제 #1
0
  /**
   * Adds a single category to the given collection.
   *
   * @param collection
   * @param type
   */
  protected Category addTypeCategory(AppCollection collection, ArtifactTypeEnum type) {
    AppCategories categories = null;
    if (collection.getCategories().size() > 0) {
      categories = collection.getCategories().get(0);
    } else {
      categories = new AppCategories();
      categories.setFixed(true);
      collection.getCategories().add(categories);
    }

    Category category = new Category();
    category.setScheme(SrampAtomConstants.URN_X_S_RAMP_TYPE);
    category.setTerm(type.getType());
    category.setLabel(type.getLabel());
    categories.getCategory().add(category);

    return category;
  }
예제 #2
0
 /**
  * Adds a single collection to the workspace and returns it.
  *
  * @param path
  * @param title
  * @param accept
  */
 protected AppCollection addCollection(String path, String title, String accept) {
   AppCollection collection = new AppCollection(url(path), title);
   collection.getAccept().add(new AppAccept(accept));
   getCollection().add(collection);
   return collection;
 }