コード例 #1
0
ファイル: ContentServiceBean.java プロジェクト: prowim/prowim
 /**
  * {@inheritDoc}
  *
  * @see org.prowim.dms.alfresco.ContentService#getAllDocuments()
  */
 @Override
 @Interceptors(AuthenticationInterceptor.class)
 public DocumentContentPropertiesArray getAllDocuments() throws DMSException {
   SearchService searcher = new SearchService();
   try {
     return searcher.getAllDocuments(DMSConstants.getCustomerFolderID());
   } catch (RemoteException e) {
     String message = "An remote exception occurs while searching the DMS";
     LOG.error(message, e);
     DMSFault dmsFault = new DMSFault();
     dmsFault.setMessage(message);
     throw new DMSException(message, dmsFault, e);
   }
 }
コード例 #2
0
ファイル: ContentServiceBean.java プロジェクト: prowim/prowim
  /**
   * {@inheritDoc}
   *
   * @see org.prowim.dms.alfresco.ContentService#findFolderOrContent(String)
   */
  @Override
  @Interceptors(AuthenticationInterceptor.class)
  public String findFolderOrContent(String contentName) {
    Validate.notNull(contentName, "The name of content or a folder can not be null");

    String idReference = null;
    RepositoryServiceSoapBindingStub repoService = WebServiceFactory.getRepositoryService();
    try {
      QueryResult results =
          repoService.queryChildren(
              new Reference(DMSStoreRegistry.STORE_REF, DMSConstants.getCustomerFolderID(), null));
      ResultSetRow[] rows = results.getResultSet().getRows();
      ResultSetRow currentRow;
      NamedValue[] colums;
      String currentName;
      String currentValue;
      if (rows != null) {
        for (int i = 0; i < rows.length; i++) {
          currentRow = rows[i];
          colums = currentRow.getColumns();
          for (int y = 0; y < colums.length; y++) {
            currentName = colums[y].getName();
            if (currentName.equals(Constants.PROP_NAME)) {
              currentValue = colums[y].getValue();
              if (currentValue.equals(contentName)) {
                idReference = currentRow.getNode().getId();
              }
            }
          }
        }
      }
    } catch (RepositoryFault e) {
      LOG.error("RepositoryFault-Error by search a item in DMS", e);
    } catch (RemoteException e) {
      LOG.error("RemoteException-Error by search a item in DMS", e);
    }
    return idReference;
  }