コード例 #1
0
 /**
  * delete a content. It is registered to contentManager service
  *
  * @param con a Connection
  * @param pubPK the identifiant of the content to unregister
  */
 public void deleteSilverContent(Connection con, PublicationPK pubPK)
     throws ContentManagerException {
   int contentId = getContentManager().getSilverContentId(pubPK.getId(), pubPK.getComponentName());
   if (contentId != -1) {
     SilverTrace.info(
         "kmelia",
         "KmeliaContentManager.deleteSilverContent()",
         "root.MSG_GEN_ENTER_METHOD",
         "pubId = " + pubPK.getId() + ", contentId = " + contentId);
     getContentManager().removeSilverContent(con, contentId, pubPK.getComponentName());
   }
 }
コード例 #2
0
  private List<PublicationPK> filterPublicationPKs(
      List<PublicationPK> publicationPKs, int nbPublis) {
    List<PublicationPK> filteredPublicationPKs = new ArrayList<PublicationPK>();
    KmeliaSecurity security = new KmeliaSecurity();

    PublicationPK pk = null;
    for (int p = 0; publicationPKs != null && p < publicationPKs.size(); p++) {
      pk = publicationPKs.get(p);
      if (security.isObjectAvailable(pk.getInstanceId(), userId, pk.getId(), "Publication")) {
        filteredPublicationPKs.add(pk);
      }

      if (nbPublis != -1 && filteredPublicationPKs.size() == nbPublis) {
        return filteredPublicationPKs;
      }
    }

    return filteredPublicationPKs;
  }