/**
  * Muestra los store de alfresco por la salida estandar
  *
  * @return
  * @throws
  */
 public static void getStores() {
   RepositoryServiceSoapBindingStub repoService = WebServiceFactory.getRepositoryService();
   Store[] stores;
   try {
     stores = repoService.getStores();
     for (Store s : stores) {
       System.out.println(s.getScheme() + "://" + s.getAddress());
     }
   } catch (RepositoryFault e) {
     e.printStackTrace();
   } catch (RemoteException e) {
     e.printStackTrace();
   }
 }
예제 #2
0
  /**
   * {@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;
  }