Author Topic: Stable permanent DocId links  (Read 802 times)

Lars Bencze

  • Full Member
  • ***
  • Posts: 116
  • CMOD Expert at Skandia
    • View Profile
    • INACTIVE - Bezland Consulting
Stable permanent DocId links
« on: December 22, 2023, 07:04:26 AM »
So, I have read existing threads here that touch upon the usage of the CMOD Unique DocID feature .


I'd like to catch up with the community here as what can be done to create permanent document links. As far as I understand, even if we activate unique docids in CMOD, we are still required to use odfolder.recreateHit in combination with either getOpenDocid or getDocid - which IBM warns produces non-persistent links (in case of reloads etc).

IBM also states (in the same ODApi docs):
Quote
The docid format is subject to change. If your application requires a unique document identifier to persist, consider using the Application Group field option "Unique ID".

What for, mate? How would that help? I can find no retrieve doc function that exclusively uses the unique docid (and perhaps a folder name or its Application Group or AGID) to retrieve a document.

So what's the use then, if we cannot create persistent doc links? (like the ones they have in that not-as-nice system "FileNet". This is a big commercial issue as the lack of links will entice companies into using or migrating to that system, instead of CMOD.)

Here is my current idea on how unique docids might be used to create persistent/permanent links.

1. Make sure the field you use for the Unique DocId has the same name in all Application Groups.
2. Search using a combination of folder name, application group name and the unique docid. For example:
URL Link = ODServer/search/folder_name/agcode+unique_docid
(such as www.mycomp.com/ODWEKServer/search/generalfolder/B6EA49-2ff02876-ffa5-4564-b0fb-966361dcf4f0 where "B6EA49" is an encoded Application Group Name and the rest is the actual, CMOD-generated Unique ID)
Code: [Select]
appgrpname = decodeAGname(agcode); // decodes "B6EA49" from the URL into some existing Application Group name
ODFolder odf = ods.openFolder(foldername); // "generalfolder" from the URL
odf.setApplGroupForSearchWithSQL(appgrpname);
ODHit uniqueHit = odf.search("WHERE $uniqidfieldname = $unique_docid); // get the unique hit
uniqueHit.retrieve('',C:\Temp\uniquefile);  // retrieve the unique file
//...Do something with the file...
(Note: this is untested code with the syntax of no real programming language - it is merely an idea)

Depending on how the rest of the web app is built, the user with the link will somehow need to be authenticated and have authorization to view the file.

Do you have any better ideas? Please share!
Or insights from IBM workshops etc? Sorry if I am currently not up to date.
Or improvements or helpful thoughts on the matter.
« Last Edit: January 02, 2024, 04:43:06 AM by Lars Bencze »
OnDemand for MP expert. #Multiplatforms #Admin #Scripts #Performance #Support #Architecture #PDFIndexing #TSM/SP #DB2 #CustomSolutions #Integration #UserExits #Migrations #Workflow #ECM #Cloud #ODApi

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2230
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Stable permanent DocId links
« Reply #1 on: December 25, 2023, 06:58:19 PM »
Use Globally Unique IDentifiers (GUIDs) or SHA-256 hashes.

I've had this discussion with the developers/L3 many times, on behalf of many customers - DocIDs are only to be used inside a single, specific session, not for persistence.

I'm helping migrate a customer away from using the old (v7126) DocID's, and it's a nightmare, please please please, never use them like this.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR