|
| 1 | +# DataPusher Plus Configuration |
| 2 | + |
| 3 | +## Optional Features |
| 4 | + |
| 5 | +DataPusher Plus includes some optional features that can be enabled through configuration. These features are disabled by default to ensure compatibility with different CKAN versions. |
| 6 | + |
| 7 | +### IFormRedirect Support |
| 8 | + |
| 9 | +The IFormRedirect interface provides custom redirect behavior after dataset and resource form submissions. This interface is only available in certain CKAN branches and is not yet merged into the main CKAN codebase. |
| 10 | + |
| 11 | +**Note**: IFormRedirect methods are only defined when this feature is enabled, keeping the plugin completely clean when disabled. |
| 12 | + |
| 13 | +**Configuration:** |
| 14 | +```ini |
| 15 | +# Enable IFormRedirect functionality (default: false) |
| 16 | +ckanext.datapusher_plus.enable_form_redirect = true |
| 17 | +``` |
| 18 | + |
| 19 | +**What it does:** |
| 20 | +- **Dynamically adds IFormRedirect methods** only when enabled |
| 21 | +- Provides custom redirect URLs after dataset/resource creation or editing |
| 22 | +- Redirects to dataset page after dataset metadata submission |
| 23 | +- Redirects to resource view after resource editing |
| 24 | +- Allows "add another resource" workflow |
| 25 | +- **Works best with DRUF** for complete resource-first workflow |
| 26 | + |
| 27 | +**Requirements:** |
| 28 | +- CKAN version with IFormRedirect interface support |
| 29 | +- If the interface is not available, the feature will be automatically disabled with a warning |
| 30 | +- **Recommended**: Enable together with DRUF for optimal resource-first experience |
| 31 | + |
| 32 | +### DRUF (Dataset Resource Upload First) Support |
| 33 | + |
| 34 | +DRUF allows users to upload resources before creating the dataset metadata, providing a resource-first workflow. |
| 35 | + |
| 36 | +**Configuration:** |
| 37 | +```ini |
| 38 | +# Enable DRUF functionality (default: false) |
| 39 | +ckanext.datapusher_plus.enable_druf = true |
| 40 | +``` |
| 41 | + |
| 42 | +**What it does:** |
| 43 | +- Adds a `/resource-first/new` endpoint |
| 44 | +- Creates a temporary dataset and redirects to resource upload |
| 45 | +- Useful for workflows where users want to upload data files first |
| 46 | +- **Overrides templates**: Modifies "Add Dataset" buttons and form stages to support resource-first workflow |
| 47 | + |
| 48 | +**Template Overrides:** |
| 49 | +When DRUF is enabled, the following templates are overridden: |
| 50 | +- `snippets/add_dataset.html`: Changes "Add Dataset" to redirect to resource upload |
| 51 | +- `package/snippets/package_form.html`: Modifies form stages to show "Add data" first |
| 52 | +- `scheming/package/snippets/package_form.html`: Modifies scheming form stages |
| 53 | + |
| 54 | +**Requirements:** |
| 55 | +- No special CKAN version requirements |
| 56 | +- Works with standard CKAN installations |
| 57 | +- Compatible with ckanext-scheming |
| 58 | + |
| 59 | +## Example Configuration |
| 60 | + |
| 61 | +Add these lines to your CKAN configuration file (e.g., `/etc/ckan/default/ckan.ini`): |
| 62 | + |
| 63 | +```ini |
| 64 | +# Enable DRUF (Dataset Resource Upload First) workflow |
| 65 | +ckanext.datapusher_plus.enable_druf = true |
| 66 | + |
| 67 | +# Enable IFormRedirect for better form redirects (recommended with DRUF) |
| 68 | +ckanext.datapusher_plus.enable_form_redirect = true |
| 69 | +``` |
| 70 | + |
| 71 | +**Recommended combinations:** |
| 72 | +- **Standard mode**: Both disabled (default) - maintains standard CKAN behavior |
| 73 | +- **Resource-first workflow**: Both enabled - complete resource-first experience |
| 74 | +- **DRUF only**: Only `enable_druf = true` - resource-first without custom redirects |
| 75 | + |
| 76 | +## Template Organization |
| 77 | + |
| 78 | +DataPusher Plus uses a conditional template loading system to avoid conflicts when optional features are disabled: |
| 79 | + |
| 80 | +- **Base templates** (`templates/`): Always loaded, provides standard DataPusher Plus functionality |
| 81 | +- **DRUF templates** (`templates/druf/`): Only loaded when `enable_druf = true`, overrides default dataset creation workflow |
| 82 | + |
| 83 | +This ensures that when DRUF is disabled, your CKAN installation maintains completely standard behavior without any template modifications. |
| 84 | + |
| 85 | +## Backwards Compatibility |
| 86 | + |
| 87 | +When these features are disabled (default), DataPusher Plus maintains full backwards compatibility with standard CKAN installations. The plugin will automatically detect if required interfaces are available and disable features gracefully if they are not supported. |
| 88 | + |
| 89 | +## Logging |
| 90 | + |
| 91 | +The plugin will log the status of these features: |
| 92 | +- Info messages when features are successfully enabled |
| 93 | +- Warning messages when features are configured but not available |
| 94 | +- Debug messages for DRUF blueprint registration |
| 95 | + |
| 96 | +Check your CKAN logs to verify the status of these optional features. |
0 commit comments