Issue with slugs (generating description permalinks from reference code) in 2.4

70 views
Skip to first unread message

Jenny Mitcham

unread,
Apr 9, 2018, 10:53:44 AM4/9/18
to AtoM Users
Hi,

We are just looking at upgrading from AtoM 2.2 to AtoM 2.4 and we are testing out some of the functionality on a test instance.

We very much liked the idea of generating slugs from the unique reference codes in AtoM rather than the non-unique titles so were keen to get going with this. However in our testing just now we discovered this doesn't quite work in the way we would expect.

In our config settings we've got it so that the permalink is generated from reference code (repository identifier & country code included). 

I tried creating a new reference within the hierarchy of a much larger archive with the reference RET/8/11/13/1.

I would have expected that this would have produced the slug 'gb-193-ret-8-11-13-1' but actually it produces the slug 'gb-193-ret-ret-8-ret-8-11-ret-8-11-13-ret-8-11-13-1'.

This is unexpected and doesn't make for the nice tidy urls we were hoping for!

Note that we do not inherit the reference code - I don't know if this is a factor here?

Another thing we discovered in making test records was that if you don't add in your repository in your archival description in the first instance, then your repository identifier and country code will not be present, so the slug that is created won't fit with the pattern that we have specified in the config settings. I do think this could be a problem for us given that we encourage staff to save their Archival Descriptions regularly whilst they are creating them in order to avoid losing data. It is likely that not all fields will be completed when the record is first saved.

The reason we would like to change our slugs to use the reference code, repository identifier and country code was so that the urls to archival descriptions are short, consistent and predictable but I don't think the functionality meets our needs as it stands so I think we will stick with our slugs as they are in AtoM 2.4. 

I just thought it would be useful to report this issue to the group.

All the best,
Jen


Dan Gillean

unread,
Apr 9, 2018, 12:28:39 PM4/9/18
to ICA-AtoM Users
Hi Jen, 

Note that we do not inherit the reference code - I don't know if this is a factor here?

It is a factor. By AtoM's definition, a reference code is the accumulation of: 
  • The country code from the repository address
  • The repository code
  • each parent identifier for the description
  • the identifier of the current description



So when you use the option to generate your slugs from the reference code, it is grabbing all of the parent identifiers as well. 

If you have been manually adding identifiers at all levels, and this includes manually adding the parent ID as well (as it appears from your example with duplication that you are), then you should try the "identifier" setting. I think this will mostly give you what you are expecting. 

The one thing this setting will not include is the country code and repository code. The simplest workaround for this, if you are not using reference code inheritance, is to manually include this information in the top-level description's identifier. 


Another thing we discovered in making test records was that if you don't add in your repository in your archival description in the first instance, then your repository identifier and country code will not be present, so the slug that is created won't fit with the pattern that we have specified in the config settings. I do think this could be a problem for us given that we encourage staff to save their Archival Descriptions regularly whilst they are creating them in order to avoid losing data. It is likely that not all fields will be completed when the record is first saved.

Yes, if the information is not present, then AtoM can't add it. AtoM will not retroactively update slugs based on changes you make, since this could potentially break any links to your content you have on external sites. However, if you've made changes and you want to update all of your slugs, the generate slugs CLI task will respect the slug generation settings. So, for example, you could: 
  • Change the slug generation settings to "identifier"
  • Update your top-level description identifiers to include a country code and the repository code
  • Run the slug generation task, using the --delete option to update all slugs. 
Without the --delete option, AtoM will only replace missing slugs. To replace existing slugs, you either need to manually and individually delete them from the database, or use the --delete option. 
 If you want to make a few spot fixes, remember that you can edit the slug of an individual description via the user interface. See: 



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

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/4b597e57-46ea-49b4-8353-bf14da8bcda7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jenny Mitcham

unread,
Apr 10, 2018, 10:16:59 AM4/10/18
to ica-ato...@googlegroups.com
Ah thanks Dan - I see now. I think it is just a question of terminology - here, we consider the archival reference code to be what AtoM calls the identifier.
I think we may decide to go with just the identifier (with no country/repository identifier) in our slugs - though presumably this could lead to issues if we ever decide to host anyone else's archival descriptions and have a clash of identifiers - perhaps needs further internal discussion.

All the best,
Jen 

On Mon, Apr 9, 2018 at 10:53 AM, 'Jenny Mitcham' via AtoM Users <ica-atom-users@googlegroups.com> wrote:
Hi,

We are just looking at upgrading from AtoM 2.2 to AtoM 2.4 and we are testing out some of the functionality on a test instance.

We very much liked the idea of generating slugs from the unique reference codes in AtoM rather than the non-unique titles so were keen to get going with this. However in our testing just now we discovered this doesn't quite work in the way we would expect.

In our config settings we've got it so that the permalink is generated from reference code (repository identifier & country code included). 

I tried creating a new reference within the hierarchy of a much larger archive with the reference RET/8/11/13/1.

I would have expected that this would have produced the slug 'gb-193-ret-8-11-13-1' but actually it produces the slug 'gb-193-ret-ret-8-ret-8-11-ret-8-11-13-ret-8-11-13-1'.

This is unexpected and doesn't make for the nice tidy urls we were hoping for!

Note that we do not inherit the reference code - I don't know if this is a factor here?

Another thing we discovered in making test records was that if you don't add in your repository in your archival description in the first instance, then your repository identifier and country code will not be present, so the slug that is created won't fit with the pattern that we have specified in the config settings. I do think this could be a problem for us given that we encourage staff to save their Archival Descriptions regularly whilst they are creating them in order to avoid losing data. It is likely that not all fields will be completed when the record is first saved.

The reason we would like to change our slugs to use the reference code, repository identifier and country code was so that the urls to archival descriptions are short, consistent and predictable but I don't think the functionality meets our needs as it stands so I think we will stick with our slugs as they are in AtoM 2.4. 

I just thought it would be useful to report this issue to the group.

All the best,
Jen


--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

For more options, visit https://groups.google.com/d/optout.



--
Jenny Mitcham
Digital Archivist
Borthwick Institute for Archives
University of York
Heslington
York
YO10 5DD

Telephone: 01904 321170

Borthwick Institute website: http://www.york.ac.uk/borthwick/
Digital archiving blog: http://digital-archiving.blogspot.co.uk/
Twitter: @Jenny_Mitcham
Skype: jenny_mitcham

Reply all
Reply to author
Forward
0 new messages