- Whip up some quick CSS to make the button in the submission workflow use the XMLUI theme's brand colors ([#154](https://github.com/ilri/DSpace/issues/154))
- We should install it in /opt/letsencrypt and then script the renewal script, but first we have to wire up some variables and template stuff based on the script here: https://letsencrypt.org/howitworks/
- I had to export some CIAT items that were being cleaned up on the test server and I noticed their `dc.contributor.author` fields have DSpace 5 authority index UUIDs...
- To clean those up in OpenRefine I used this GREL expression: `value.replace(/::\w{8}-\w{4}-\w{4}-\w{4}-\w{12}::600/,"")`
- Getting more and more hangs on DSpace Test, seemingly random but also during CSV import
- Logs don't always show anything right when it fails, but eventually one of these appears:
```
org.dspace.discovery.SearchServiceException: Error while processing facet fields: java.lang.OutOfMemoryError: Java heap space
```
- or
```
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
```
- Right now DSpace Test's Tomcat heap is set to 1536m and we have quite a bit of free RAM:
```
# free -m
total used free shared buffers cached
Mem: 3950 3902 48 9 37 1311
-/+ buffers/cache: 2552 1397
Swap: 255 57 198
```
- So I'll bump up the Tomcat heap to 2048 (CGSpace production server is using 3GB)
- There are 1200 records that have PDFs, and will need to be imported into CGSpace
- I created a `filename` column based on the `dc.identifier.url` column using the following transform:
```
value.split('/')[-1]
```
- Then I wrote a tool called [`generate-thumbnails.py`](https://gist.github.com/alanorth/2206f24483fe5f0454fc) to download the PDFs and generate thumbnails for them, for example:
```
$ ./generate-thumbnails.py ciat-reports.csv
Processing 64661.pdf
> Downloading 64661.pdf
> Creating thumbnail for 64661.pdf
Processing 64195.pdf
> Downloading 64195.pdf
> Creating thumbnail for 64195.pdf
```
## 2016-02-12
- Looking at CIAT's records again, there are some problems with a dozen or so files (out of 1200)
- A few items are using the same exact PDF
- A few items are using HTM or DOC files
- A few items link to PDFs on IFPRI's e-Library or Research Gate
- Looking at CIAT's records again, there are some files linking to PDFs on Slide Share, Embrapa, UEA UK, and Condesan, so I'm not sure if we can use those
- 265 items have dirty, URL-encoded filenames:
```
$ ls | grep -c -E "%"
265
```
- I suggest that we import ~850 or so of the clean ones first, then do the rest after I can find a clean/reliable way to decode the filenames
- Merge pull requests for submission form theming ([#178](https://github.com/ilri/DSpace/pull/178)) and missing center subjects in XMLUI item views ([#176](https://github.com/ilri/DSpace/pull/176))
- They will be deployed on CGSpace the next time I re-deploy
- This turns the URLs into human-readable versions that we can use as proper filenames
- Run web server and system updates on DSpace Test and reboot
- To merge `dc.identifier.url` and `dc.identifier.url[]`, rename the second column so it doesn't have the brackets, like `dc.identifier.url2`
- Then you create a facet for blank values on each column, show the rows that have values for one and not the other, then transform each independently to have the contents of the other, with "||" in between
- Work on Python script for parsing and downloading PDF records from `dc.identifier.url`
- To get filenames from `dc.identifier.url`, create a new column based on this transform: `forEach(value.split('||'), v, v.split('/')[-1]).join('||')`
- This also works for records that have multiple URLs (separated by "||")
## 2016-02-17
- Re-deploy CGSpace, run all system updates, and reboot
- More work on CIAT data, cleaning and doing a last metadata-only import into DSpace Test
- SAFBuilder has a bug preventing it from processing filenames containing more than one underscore
- Need to re-process the filename column to replace multiple underscores with one: `value.replace(/_{2,}/, "_")`
## 2016-02-20
- Turns out the "bug" in SAFBuilder isn't a bug, it's a feature that allows you to encode extra information like the destintion bundle in the filename
- Also, it seems DSpace's SAF import tool doesn't like importing filenames that have accents in them:
```
java.io.FileNotFoundException: /usr/share/tomcat7/SimpleArchiveFormat/item_1021/CIAT_COLOMBIA_000075_Medición_de_palatabilidad_en_forrajes.pdf (No such file or directory)
```
- Need to rename files to have no accents or umlauts, etc...
- Useful custom text facet for URLs ending with ".pdf": `value.endsWith(".pdf")`
- But actually, the accents might not be an issue, as I can successfully import files containing Spanish accents on my Mac
- On closer inspection, I can import files with the following names on Linux (DSpace Test):
```
Bitstream: tést.pdf
Bitstream: tést señora.pdf
Bitstream: tést señora alimentación.pdf
```
- Seems it could be something with the HFS+ filesystem actually, as it's not UTF-8 ([it's something like UCS-2](http://www.cio.com/article/2868393/linus-torvalds-apples-hfs-is-probably-the-worst-file-system-ever.html))
- HFS+ stores filenames as a string, and filenames with accents get stored as [character+accent](https://blog.vrypan.net/2012/11/13/hfsplus-unicode-and-accented-chars/) whereas Linux's ext4 stores them as an array of bytes
- Running the SAFBuilder on Mac OS X works if you're going to import the resulting bundle on Mac OS X, but if your DSpace is running on Linux you need to run the SAFBuilder there where the filesystem's encoding matches
- Got notified by some CIFOR colleagues that the Google Scholar team had contacted them about CGSpace's incorrect ordering of authors in Google Scholar metadata
- Turns out there is a patch, and it was merged in DSpace 5.4: https://jira.duraspace.org/browse/DS-2679
- I've merged it into our `5_x-prod` branch that is currently based on DSpace 5.1
- We found a bug when a user searches from the homepage, sorts the results, and then tries to click "View More" in a sidebar facet
- I am not sure what causes it yet, but I opened an issue for it: https://github.com/ilri/DSpace/issues/179
- Trying to test Atmire's series of stats and CUA fixes from January and February, but their branch history is really messy and it's hard to see what's going on
- Rebasing their branch on top of our production branch results in a broken Tomcat, so I'm going to tell them to fix their history and make a proper pull request
- Looking at the filenames for the CIAT Reports, some have some really ugly characters, like: `'` or `,` or `=` or `[` or `]` or `(` or `)` or `_.pdf` or `._` etc
- It's tricky to parse those things in some programming languages so I'd rather just get rid of the weird stuff now in OpenRefine: