Giter VIP home page Giter VIP logo

Comments (10)

espona avatar espona commented on September 2, 2024

Dear wuweihust, the installation looks ok, the error doesn't make much sense since the template 'resource_item.html' does exist. I have a different order on the plugins in the .ini configuration, just to test, could you put restricted as the first plugin in the ckan.plugins line? Good luck!

from ckanext-restricted.

0wenwu avatar 0wenwu commented on September 2, 2024

Thank you for your rapid response. I put restricted as the first plugin in the ckan.plugins line, but it still doesn't work.
In fact, it is not that clear to me how to set up in development.ini and schema.json after all the relevant extension were installed.
Firstly, the JSON file you showed in Readme should add to which file? Is that schema.json?
Secondly, Readme says "ckanext.restricted.some_setting = some_default_value", what does this mean?

Dear wuweihust, the installation looks ok, the error doesn't make much sense since the template 'resource_item.html' does exist. I have a different order on the plugins in the .ini configuration, just to test, could you put restricted as the first plugin in the ckan.plugins line? Good luck!

from ckanext-restricted.

espona avatar espona commented on September 2, 2024

Hi, sorry that with ckanext.restricted.some_setting = some_default_value is part of the default README, I will remove it to avoid confusion.

On the ini file you just need to add restricted (and scheming, composite, repeating) to the plugin list as you did.

The JSON I show is the one that is used for scheming, please take a look at the documentation of that extension, it defines all the fields of your datasets.
On the ini file you write:
scheming.dataset_schemas = ckanext.envidat_theme:restricted.json
and then the presets too:
scheming.presets = ckanext.scheming:presets.json
ckanext.repeating:presets.json
ckanext.composite:presets.json

Here you have an example of such a file:
https://github.com/EnviDat/ckanext-envidat_schema/blob/master/ckanext/envidat_schema/datacite_dataset.json
Or more simple: https://github.com/ckan/ckanext-scheming/blob/master/ckanext/scheming/ckan_dataset.json

That is the JSON file you add the restricted fields to (at resource level). You need scheming working first to then use this extension.

from ckanext-restricted.

0wenwu avatar 0wenwu commented on September 2, 2024

Thanks, Lucia. Very helpful directions. I'd like to ask one more question, Where should I put the schema.json? I See all the project put it under the "ckanext" folder, is that necessary? and how to quote the scheming configuration file built by ourselves?

from ckanext-restricted.

espona avatar espona commented on September 2, 2024

No problem, feel free to ask :)
Yes, the schema.json file should be inside a ckanext folder, that means inside an extension. In our case, we have a specific extension "envidat_theme" and we have the file in that extension. to use it, just add the following line to the ini file:
scheming.dataset_schemas = ckanext.envidat_theme:schema.json
If you want to use the default one in scheming extension, then you do:
scheming.dataset_schemas = ckanext.scheming:ckan_dataset.json

I hope it helps!

from ckanext-restricted.

0wenwu avatar 0wenwu commented on September 2, 2024

Thx, it's very nice of you for the rapid reply.

Does it mean that I should build a extension first before I can make a self-defined schema json file?

Besides, I have installed ckanext-repeating from github
pip install git+https://github.com/eawag-rdm/ckanext-repeating.git@master
Should I install extension by downloading it and then running python setup.py develop.
Maybe it will be more convenient for development?

Once I added restricted to ckan.plugins, the website of dataset will show "Internal server error".
And then I removed, dataset can be visited normally.

No problem, feel free to ask :)
Yes, the schema.json file should be inside a ckanext folder, that means inside an extension. In our case, we have a specific extension "envidat_theme" and we have the file in that extension. to use it, just add the following line to the ini file:
scheming.dataset_schemas = ckanext.envidat_theme:schema.json
If you want to use the default one in scheming extension, then you do:
scheming.dataset_schemas = ckanext.scheming:ckan_dataset.json

I hope it helps!

from ckanext-restricted.

espona avatar espona commented on September 2, 2024

from ckanext-restricted.

olivierdalang avatar olivierdalang commented on September 2, 2024

Couldn't the .json be provided with the ckanext-restricted extension itself ? Seems a bit strange to require another extension to provide a default file for ckanext-restricted.

from ckanext-restricted.

dyaw-Drexel avatar dyaw-Drexel commented on September 2, 2024

from ckanext-restricted.

espona avatar espona commented on September 2, 2024

The json is dependent on the instance, we use a custom one if you are interested https://github.com/EnviDat/ckanext-envidat_theme/blob/master/ckanext/envidat_theme/datacite_dataset.json.

from ckanext-restricted.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.