cancel
Showing results for 
Search instead for 
Did you mean: 

Sometimes i can found the space, sometimes can't

skwig
Champ in-the-making
Champ in-the-making
Hi,

I'm using Alfresco labs and I have a space named "ALIEN" in Alfresco,which is found from my application this way:


    ResultSetRow[] rows= null;
    String found= "";
    String space= "ALIEN";
    String search= "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:\"" + space+ "\"";
            Query query = new Query();
            query.setLanguage(Constants.QUERY_LANG_LUCENE);
            query.setStatement(search);

            try {
                QueryResult qrst = WebServiceFactory.getRepositoryService().query(ALF_STORE, query, false);
                ResultSet x = qrst.getResultSet();
                rows = x.getRows();   //THIS IS THE CONFLICTIVE LINE
                for (ResultSetRow aux : rows ) {
                    for (NamedValue aux2 : aux.getColumns()) {
                        if (ALF_NAME.equals(aux2.getName())) {
                            found= aux;
                        }
                    }
                }


Sometimes "rows" is null (Space "ALIEN" exists in Alfresco, and the user which makes this search has permission at this space). It is curious that sometimes "rows" gets me information, and sometimes is null.

What's happening?

Thanks for your time.
1 REPLY 1

libman
Champ in-the-making
Champ in-the-making
Better add type checking (cm:folder).