putting standardised wording in an entry

32 views
Skip to first unread message

Alison Scott

unread,
Aug 23, 2019, 5:06:55 AM8/23/19
to AtoM Users
Hello - sorry if this is really obvious but I want to put standardised wording in entries retrospectively eg in the rules and conventions field. is this possible? and if so how? looking at templates these seem to relate to the whole entry rather than wording for fields. thanks!

Dan Gillean

unread,
Aug 26, 2019, 10:35:49 AM8/26/19
to ICA-AtoM Users
Hi Alison, 

There's not any global way via the user interface to add the same default content to the Rules and conventions field. One solution we could look at in the future would be managing this field as a taxonomy, rather than a free text field, so user-input strings could be saved as terms in the taxonomy and reused. This wouldn't automatically populate the field for existing descriptions (or new ones), but it would allow you to select a saved value from a drop-down. 

In the meantime, I've managed to work out a SQL query that you could use to add the same text to ALL "Rules and conventions" fields across all descriptions. In the query below, it will add a note about ISAD(G) to every English description. You could change the wording of the input text as needed. 

I've tested this query locally in my Vagrant box (against a 2.5 installation), but as always with scripts and queries shared in the user forum, this is shared as-is, and you should use it at your own risk. Please be sure to back up your data first, in case anything goes wrong

To use the query, we will first need to access the MySQL command line. To do that, we will need to know the MySQL username, password, and database name used during installation. If you can't recall for certain what credentials you used, you can always check in config/config.php - for example, to see this file you could run the following from the root AtoM installation directory, which should be /usr/share/nginx/atom if you have followed our recommended installation instructions: 
  • sudo nano config/config.php
You should see the database name and credentials listed near the top of the file. You can also check your database username and password in /root/.my.cnf like so:
  • sudo cat  /root/.my.cnf
Once you have the database name, MySQL user name, and password, we can use these to access the MySQL command prompt. Assuming in the following example that your database name is atom and your user and password are root, you can access the prompt like so: 
  • mysql -u root -proot atom;
Notice that there is a space between the -u and root, but NOT between the -p and the root password. Alternatively, you can leave no password following the -p, and you will be prompted to enter it by the command prompt before proceeding. 

At this point, we shoudl have access to the MySQL command prompt, which should look like this: 

mysql>

We can now use the following query to add the text "ISAD(G): General International Standard Archival Description, Second Edition, Ottawa, 2000." to every Rules and Conditions field on English descriptions. You can also edit the text example I've used inside the double quotations as needed. If your descriptions are in a different culture, you can also change en in the last WHERE clause to the language code of your target descriptions. 

UPDATE information_object_i18n io18
LEFT JOIN information_object io ON io18.id=io.id
SET io18.rules="ISAD(G): General International Standard Archival Description, Second Edition, Ottawa, 2000."
WHERE io18.culture='en' AND io.parent_id IS NOT NULL;


After running the query, enter exit to leave the MySQL command prompt. I would recommend re-indexing, clearing the application cache, and restarting PHP-FPM after. 

To repopulate the search index and clear the application cache, run the following from AtoM's root installation directory: 
  • php symfony search:populate
  • php symfony cc
Restarting PHP-FPM varies depending on the version of Ubuntu and the version of PHP you have installed:
  • Ubuntu 18.04 with PHP 7.2: sudo systemctl restart php7.2-fpm 
  • Ubuntu 16.04 with PHP 7.0: sudo systemctl restart php7.0-fpm
  • Ubuntu 14.04 with PHP5: sudo service php5-fpm restart
Good luck, and let us know how it goes!

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


On Fri, Aug 23, 2019 at 5:06 AM Alison Scott <alison...@gmail.com> wrote:
Hello - sorry if this is really obvious but I want to put standardised wording in entries retrospectively eg in the rules and conventions field. is this possible? and if so how? looking at templates these seem to relate to the whole entry rather than wording for fields. thanks!

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/13115f3e-92c2-4409-9e4b-32af4a6bde39%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages