Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMIS Query on content with contains #10

Open
warnonphilippe opened this issue May 18, 2018 · 1 comment
Open

CMIS Query on content with contains #10

warnonphilippe opened this issue May 18, 2018 · 1 comment

Comments

@warnonphilippe
Copy link

warnonphilippe commented May 18, 2018

Hello,

Maybe a wrong config on my environnement or maybe an issue.

When I try to perform a cmis query on the content, the query doesn't found any result. Is solr included and working in your image ? I use your docker-compose file posted on the docker-hub, should I configure something else ?

Below my call :
`Session session = factory.getSession(repoId, username, pwd);
OperationContext oc = new OperationContextImpl();
ItemIterable results = session.query(cql, false, oc);

    for (QueryResult result : results) {
        for (PropertyData<?> prop : result.getProperties()) {
            System.out.println(prop.getQueryName() + ": " + prop.getFirstValue());
        }
        System.out.println("--------------------------------------");
    }`

And this is how I create my session in my factory:

`
SessionFactory factory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap();

    parameter.put("org.apache.chemistry.opencmis.user", username);
    parameter.put("org.apache.chemistry.opencmis.password", password);
    parameter.put("org.apache.chemistry.opencmis.binding.atompub.url", url);
    parameter.put("org.apache.chemistry.opencmis.binding.spi.type", BindingType.ATOMPUB.value());
    
    Optional<Repository> allRepos = factory.getRepositories(parameter).stream().findAny().map((r) -> {
        System.out.println(r.getId() + " : " + r.getName());
        return r;
    });

    Optional<Repository> repo = factory.getRepositories(parameter).stream().map((r) -> {
        System.out.println(r.getId() + " : " + r.getName());
        return r;
    }).filter((r) -> {
        return repoName.equals(r.getId()) || repoName.equals(r.getName());
    }).findAny();

    if (repo.isPresent()) {
        parameter.put("org.apache.chemistry.opencmis.session.repository.id", ((Repository)repo.get()).getId());
        return factory.createSession(parameter);
    } else {
        return null;
    }

`

I tried to use your other image with alfresco and solr6, but I get some postgresql errors at start.

Thanks,

Philippe

@pdubois
Copy link
Owner

pdubois commented May 29, 2018

Hi, how do you start your Alfresco? Docker command, docker-compose or docker cloud?
Please paste command you are using.

Philippe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants