Esempio n. 1
0
 /** Load the collection */
 public void loadCollection() {
   if (id != null) {
     collection =
         ObjectLoader.loadCollectionLazy(
             ObjectHelper.getURI(CollectionImeji.class, id), sessionBean.getUser());
     if (collection != null && getCollection().getId() != null) {
       ItemController ic = new ItemController(sessionBean.getUser());
       collectionSize = ic.countContainerSize(collection.getId());
     }
   } else {
     BeanHelper.error(sessionBean.getLabel("error") + "No ID in URL");
   }
 }
Esempio n. 2
0
 /**
  * Initialize the elements of the page
  *
  * @return
  */
 @Override
 public String getInitPage() {
   uri = ObjectHelper.getURI(CollectionImeji.class, id);
   collection = ObjectLoader.loadCollectionLazy(uri, sb.getUser());
   browseInit();
   browseContext = getNavigationString() + id;
   return "";
 }
Esempio n. 3
0
 /**
  * Withdraw the current {@link CollectionImeji}
  *
  * @return
  * @throws Exception
  */
 public String withdraw() throws Exception {
   CollectionController cc = new CollectionController();
   try {
     cc.withdraw(collection, sb.getUser());
     BeanHelper.info(sb.getMessage("success_collection_withdraw"));
   } catch (Exception e) {
     BeanHelper.error(sb.getMessage("error_collection_withdraw"));
     BeanHelper.error(e.getMessage());
     logger.error("Error discarding collection", e);
   }
   return "pretty:";
 }
Esempio n. 4
0
 /**
  * Delete the current {@link CollectionImeji}
  *
  * @return
  */
 public String delete() {
   CollectionController cc = new CollectionController();
   try {
     cc.delete(collection, sb.getUser());
     BeanHelper.info(sb.getMessage("success_collection_delete"));
   } catch (Exception e) {
     BeanHelper.error(sb.getMessage("success_collection_delete"));
     BeanHelper.error(e.getMessage());
     logger.error("Error deleting collection", e);
   }
   return "pretty:collections";
 }
Esempio n. 5
0
 /**
  * Release the current {@link CollectionImeji}
  *
  * @return
  */
 public String release() {
   CollectionController cc = new CollectionController();
   try {
     cc.release(collection, sb.getUser());
     BeanHelper.info(sb.getMessage("success_collection_release"));
   } catch (Exception e) {
     BeanHelper.error(sb.getMessage("error_collection_release"));
     BeanHelper.error(e.getMessage());
     logger.error("Error releasing collection", e);
   }
   return "pretty:";
 }
Esempio n. 6
0
 @Override
 public SearchResult search(SearchQuery searchQuery, SortCriterion sortCriterion) {
   ItemController controller = new ItemController(sb.getUser());
   return controller.search(uri, searchQuery, sortCriterion, null);
 }
Esempio n. 7
0
 @Override
 public boolean isDeletable() {
   Security security = new Security();
   return security.check(OperationsType.DELETE, sb.getUser(), collection);
 }
Esempio n. 8
0
 @Override
 public boolean isVisible() {
   Security security = new Security();
   return security.check(OperationsType.READ, sb.getUser(), collection);
 }
Esempio n. 9
0
 /**
  * true if current {@link User} can UPDATE the {@link CollectionImeji}
  *
  * @return
  */
 public boolean isEditable() {
   Security security = new Security();
   return security.check(OperationsType.UPDATE, sessionBean.getUser(), collection);
 }
Esempio n. 10
0
 public User getUser() {
   return sessionBean.getUser();
 }