Search in sources :

Example 1 with LocalRepoImpl

use of com.pogeyan.cmis.repo.local.LocalRepoImpl in project copper-cms by PogeyanOSS.

the class App method main.

public static void main(String[] args) throws Exception, ExpressionParserException, ExpressionParserInternalError, ExceptionVisitExpression {
    RepositoryManagerFactory.getInstance().init(new LocalRepoImpl());
    MongoClientFactory dbFactory = (MongoClientFactory) MongoClientFactory.createDatabaseService();
    MDocumentObjectDAOImpl dao = (MDocumentObjectDAOImpl) dbFactory.getObjectService("TestRepo", MDocumentObjectDAO.class);
    Query<MDocumentObject> query = dao.createQuery();
    // String filterExpressionQuery = "name eq 'fd' and name ne 'sd'";
    String filterExpressionQuery = "contains(name, 'fd')";
    FilterExpression expression = UriParser.parseFilter(filterExpressionQuery);
    Object filterExp = expression.accept(new MongoExpressionVisitor<MDocumentObject>(query));
    System.out.print("output: " + filterExp != null ? filterExp.toString() : "error");
    String orderByExpressionQuery = "name asc, repositoryId desc";
    OrderByExpression orderByExpression = UriParser.parseOrderBy(orderByExpressionQuery);
    Object orderByExp = orderByExpression.accept(new MongoExpressionVisitor<MDocumentObject>(query));
    System.out.print("output: " + orderByExp != null ? orderByExp.toString() : "error");
}
Also used : MDocumentObjectDAO(com.pogeyan.cmis.api.data.services.MDocumentObjectDAO) MongoClientFactory(com.pogeyan.cmis.data.mongo.services.MongoClientFactory) LocalRepoImpl(com.pogeyan.cmis.repo.local.LocalRepoImpl) MDocumentObjectDAOImpl(com.pogeyan.cmis.data.mongo.services.MDocumentObjectDAOImpl) FilterExpression(com.pogeyan.cmis.api.uri.expression.FilterExpression) OrderByExpression(com.pogeyan.cmis.api.uri.expression.OrderByExpression)

Aggregations

MDocumentObjectDAO (com.pogeyan.cmis.api.data.services.MDocumentObjectDAO)1 FilterExpression (com.pogeyan.cmis.api.uri.expression.FilterExpression)1 OrderByExpression (com.pogeyan.cmis.api.uri.expression.OrderByExpression)1 MDocumentObjectDAOImpl (com.pogeyan.cmis.data.mongo.services.MDocumentObjectDAOImpl)1 MongoClientFactory (com.pogeyan.cmis.data.mongo.services.MongoClientFactory)1 LocalRepoImpl (com.pogeyan.cmis.repo.local.LocalRepoImpl)1