Package org.alfresco.webservice.repository

Examples of org.alfresco.webservice.repository.QueryResult


   * @param session
   * @param node
   * @return TRUE if the reference contains a node that is an Alfresco space, otherwise FALSE
   */
  public static boolean isFolder(String username, String password, AuthenticationDetails session, Reference node){
    QueryResult queryResult = null;
    try {
      AuthenticationUtils.startSession(username, password);
      session = AuthenticationUtils.getAuthenticationDetails();
      queryResult = WebServiceFactory.getRepositoryService().queryChildren(node);
    } catch (RepositoryFault e) {
      Logging.connectors.warn(
          "Alfresco: Repository Error during the queryChildren: "
              + e.getMessage(), e);
    } catch (RemoteException e) {
      Logging.connectors.warn(
          "Alfresco: Remote Error during the queryChildren: "
              + e.getMessage(), e);
    } finally {
      AuthenticationUtils.endSession();
      session = null;
    }
   
    if(queryResult!=null){
      ResultSet rs = queryResult.getResultSet();
      if(rs!=null){
        ResultSetRow[] rows = rs.getRows();
        if(rows!=null){
          if(rows.length>0){
            return true;
View Full Code Here


    "{http://www.alfresco.org/model/application/1.0}user_homes",
    "{http://www.alfresco.org/model/site/1.0}sites"};
 

  public static QueryResult luceneSearch(String username, String password, AuthenticationDetails session, String luceneQuery){
    QueryResult queryResult = null;
    Query query = new Query(Constants.QUERY_LANG_LUCENE, luceneQuery);
    try {
      AuthenticationUtils.startSession(username, password);
      session = AuthenticationUtils.getAuthenticationDetails();
      queryResult = WebServiceFactory.getRepositoryService().query(STORE, query, false);
View Full Code Here

    }
    return queryResult;
  }
 
  public static QueryResult getChildren(String username, String password, AuthenticationDetails session, Reference reference){
    QueryResult queryResult = null;
    try {
      AuthenticationUtils.startSession(username, password);
      session = AuthenticationUtils.getAuthenticationDetails();
      queryResult = WebServiceFactory.getRepositoryService().queryChildren(reference);
    } catch (RepositoryFault e) {
View Full Code Here

   * @param session
   * @return filtered children of the Company Home without all the special spaces
   */
  public static QueryResult getChildrenFromCompanyHome(String username, String password, AuthenticationDetails session){
    Reference companyHome = new Reference(STORE, null, XPATH_COMPANY_HOME);
    QueryResult queryResult = SearchUtils.getChildren(username,password,session,companyHome);
    ResultSet rs = queryResult.getResultSet();
    ResultSetRow[] rows = rs.getRows();
    List<ResultSetRow> filteredRows = new ArrayList<ResultSetRow>();
    for (ResultSetRow row : rows) {
      boolean hasFilteredPath = false;
      NamedValue[] properties = row.getColumns();
View Full Code Here

        break;
      }
      i++;
    }

    QueryResult queryResult = null;
    if (StringUtils.isEmpty(luceneQuery)) {
      // get documents from the root of the Alfresco Repository
      queryResult = SearchUtils.getChildrenFromCompanyHome(username, password, session);
    } else {
      // execute a Lucene query against the repository
      queryResult = SearchUtils.luceneSearch(username, password, session, luceneQuery);
    }

    if(queryResult!=null){
      ResultSet resultSet = queryResult.getResultSet();
      ResultSetRow[] resultSetRows = resultSet.getRows();
      for (ResultSetRow resultSetRow : resultSetRows) {
          NamedValue[] properties = resultSetRow.getColumns();
          String nodeReference = PropertiesUtils.getNodeReference(properties);
          activities.addSeedDocument(nodeReference);
View Full Code Here

      boolean isFolder = ContentModelUtils.isFolder(username, password, session, reference);
     
      //a generic node in Alfresco could have child-associations
      if (isFolder) {
        // ingest all the children of the folder
        QueryResult queryResult = SearchUtils.getChildren(username, password, session, reference);
        ResultSet resultSet = queryResult.getResultSet();
        ResultSetRow[] resultSetRows = resultSet.getRows();
        for (ResultSetRow resultSetRow : resultSetRows) {
          NamedValue[] childProperties = resultSetRow.getColumns();
          String childNodeReference = PropertiesUtils.getNodeReference(childProperties);
          activities.addDocumentReference(childNodeReference, nodeReference, RELATIONSHIP_CHILD);
View Full Code Here

    AuthenticationUtils.startSession(ALFRESCO_USERNAME, ALFRESCO_PASSWORD);
    Reference reference = new Reference();
    try{
      RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
      Query query = new Query(Constants.QUERY_LANG_LUCENE, ALFRESCO_TEST_QUERY);
      QueryResult queryResult = repositoryService.query(STORE, query, false);
      ResultSetRow row = queryResult.getResultSet().getRows(0);
      reference.setStore(STORE);
      reference.setUuid(row.getNode().getId());
      return reference;
    } finally {
      AuthenticationUtils.endSession();
View Full Code Here

   
    try{
   
      RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();        
      Query query = new Query(Constants.QUERY_LANG_LUCENE, luceneQuery);
      QueryResult queryResult = repositoryService.query(STORE, query, false);
     
      ResultSetRow row = queryResult.getResultSet().getRows(0);
     
      Reference reference = new Reference();
      reference.setStore(STORE);
      reference.setUuid(row.getNode().getId());
     
View Full Code Here

   
    try{
   
      RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();        
      Query query = new Query(Constants.QUERY_LANG_LUCENE, luceneQuery);
      QueryResult queryResult = repositoryService.query(STORE, query, false);
     
      ResultSetRow row = queryResult.getResultSet().getRows(0);
     
      Reference reference = new Reference();
      reference.setStore(STORE);
      reference.setUuid(row.getNode().getId());
     
View Full Code Here

    throws Exception
  {
    WebServiceFactory.setEndpointAddress(ALFRESCO_ENDPOINT_TEST_SERVER);
    AuthenticationUtils.startSession(ALFRESCO_USERNAME, ALFRESCO_PASSWORD);
   
    QueryResult queryResultTestArea = null;
    try {
     
      RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
      Query query = new Query(Constants.QUERY_LANG_LUCENE, ALFRESCO_TEST_QUERY);
      queryResultTestArea = repositoryService.query(STORE, query, false);

      if(queryResultTestArea.getResultSet().getTotalRowCount()>0){
     
        ResultSetRow row = queryResultTestArea.getResultSet().getRows(0);
       
        Reference reference = new Reference();
        reference.setStore(STORE);
        reference.setUuid(row.getNode().getId());
       
View Full Code Here

TOP

Related Classes of org.alfresco.webservice.repository.QueryResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.