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

Add batch management docs; update readme #118

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 12 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# open-oni_nebraska_theme
This is the new nebraska child theme for open-oni
# Open ONI Nebraska Theme
This is the Nebraska child theme for Open ONI

## Including in the Open ONI App

Clone the Open ONI repository's latest v1.0.x tag and add the Nebraska theme to the `themes` directory.
If you are upgrading from v0.1.x, you will need to remove
`sass_processor` from `onisite/settings_local.py`.
Clone Open ONI repository and add Nebraska theme to the `themes` directory

```
git clone [email protected]:open-oni/open-oni.git open-oni
```bash
git clone [email protected]:open-oni/open-oni.git
cd open-oni
git checkout tags/v0.10.0
git clone [email protected]:CDRH/open-oni_nebraska_theme.git themes/nebraska
```

Expand All @@ -22,16 +19,15 @@ The Nebraska theme depends upon several plugins:

You will need to clone and configure these as well or else the theme's navigation will not work as intended. Follow instructions in those repositories for customizing the contents of the map and the featured content using the files in this theme's `conf/plugins` directory.

```
```bash
git clone [email protected]:open-oni/plugin_calendar.git onisite/plugins/calendar
git clone [email protected]:open-oni/plugin_featured_content.git onisite/plugins/featured_content
git clone [email protected]:open-oni/plugin_map.git onisite/plugins/map
```

Copy in Nebraska configuration for the calendar plugin (these may differ if the plugin has been changed and our theme has not yet been updated):

```
# calendar
```bash
cp themes/nebraska/conf/plugins/calendar/config.py onisite/plugins/calendar/config.py
```

Expand Down Expand Up @@ -87,14 +83,6 @@ The JS file containing the map locations does not need to be moved into the plug
TODO
- consider adding lat / lng to titles in the database, otherwise update the existing list `themes/nebraska/static/js/cities_list.js` as needed

## Load Plattsmouth Papers

Until such time as the LoC updates their Marc records from OCLC, you need to include this line in your `settings_local.py` file before you can load any of the Plattsmouth batches. All other batches will not load while this line is in your settings, so remember to comment it or remove it after loading Plattsmouth:

```
MARC_RETRIEVAL_URLFORMAT = "https://raw.githubusercontent.com/CDRH/open-oni_nebraska_theme/master/marc/%s/marc.xml"
```

## Compile Assets

Compile `main.scss` to `main.css` with [Sass command line
Expand All @@ -104,36 +92,10 @@ tool](https://sass-lang.com/install):
sass static/css/main.scss static/css/main.css
```

[See nebraska oni docs](docs/openoni.md#compile-static-assets)
For production, one must run additional commands to
[Compile Static Assets](docs/openoni.md#compile-static-assets)

## Load Batch Quick Reference
## Batch Management

Upload your batch files to `/var/local/newspapers/(batch_name)`. Then run:

```bash
sudo chmod -R g+rwX /var/local/newspapers/(batch_name)
sudo chmod -R o+rX /var/local/newspapers/(batch_name)
```

Then run the following commands from the base of the Nebraska open-oni install as a regular user, NOT as root.

```bash
source ENV/bin/activate

./manage.py load_batch /var/local/newspapers/(batch_name)/

# For batches to be visible in /batches page, must be released
# Add --reset flag to clear release dates and recalculate them
# Release date and time come from:
# 1. bag-info.txt, if found in the batch source
# 2. Tab-delimited CSV file if provided in format: batch_name \t batch_date
# 3. http://chroniclingamerica.loc.gov/batches.xml
# 4. Current server datetime
./manage.py release
```

If you want to chain together multiple batches, or you want to prevent scripts from exiting if the terminal shell is closed / session disconnects, run `nohup` with a command or script.

```bash
nohup (command) >> nohup.out
```
For loading newspaper data into the Open ONI see
[Batch Management documentation](docs/batch-management.md)
Loading