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

Manage Visibility/Searchable fields in dataset creation #28

Open
CostantinoPerciante opened this issue Jun 6, 2016 · 0 comments
Open

Comments

@CostantinoPerciante
Copy link

CostantinoPerciante commented Jun 6, 2016

Hi guys, I'm currently using the Jackan version 0.4.2 and I'm wondering if there is a way of using the Visibility/Searchable fields in order to make (make not) the dataset under creation visible and/or searchable. The extended CKanDataset class you provide, seems to have setPriv() and setOpen() methods, but I do not know if they are the ones I was looking for.

However I tried to use them, but they seem to have no effect. When creating a dataset using the CKanDataset (which extends CkanDatasetBase), the call reaches this point

` public synchronized CkanDataset createDataset(CkanDatasetBase dataset) {
checkNotNull(dataset, "Need a valid dataset!");

    checkToken("Tried to create dataset" + dataset.getName());

    String json = null;
    try {

        json = getObjectMapperForPosting(CkanDatasetBase.class).writeValueAsString(dataset);
    } catch (IOException e) {
        throw new CkanException(COULDNT_JSONIZE + dataset.getClass()
                                                         .getSimpleName(),
                this, e);
    }

    DatasetResponse response = postHttp(DatasetResponse.class, "/api/3/action/package_create", json,
            ContentType.APPLICATION_JSON);

    return response.result;
}`

Is getObjectMapperForPosting(CkanDatasetBase.class) method invocation right? Or we need to differenciate between CkanDatasetBase and CkanDataset?

Thanks :)

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

1 participant