Avoiding subtypes ID collison when creating a new Volume

Options
Victor Foo
edited December 18, 2020 in CSIDE and OScript #1
Hi Folks,

I am trying to create a new volume in Content Server, and it looks like what we need is just:

Object	llNode	= $LLIAPI.LLNodeSubsystem.GetItem( TheIDOfTheVolume )
llnode.NodeAlloc( session, TheNameOfTheVolume)
But this is assuming that we already know the ID of the volume.

The thing about this ID, is that 0 to 2000 is reserved internally, and anything beyond 2000 may or may not be taken by other Subtypes/Volumes or nodes..

Is it possible to dynamically generate the ID of the Volume? instead of pre-determining its ID

Thanks!!
Tagged:

Comments

  • Ian_Whitfield
    edited September 9, 2020 #2
    Options
    There is a registry of IDs that are already in use here: https://knowledge.opentext.com/knowledge/llisapi.dll/fetch/2001/744073/2120338/3755714/4192734/customview.html?func=ll&objId=4192734&objAction=browse&sort=name. You need to choose a static value that isn't already in use. There isn't a way to dynamically generate these numbers.

     The code you have there is to get the volume after it has already been created. I'm not sure if there is any documentation on the steps to create a new volume. The Oscript development course should go through creating a new node type and creating a new volume is a variation of that process. Here is a rough description of the steps:

    - Create an orphaned LLNode object from LLIAPI::LLIApiRoot::LLNode:LLVolume into your ospace. Set base features like fEnabled, fSubType and fName. Check other volumes to see which features need to be set. Check LLIAPI::LLIApiRoot::LLNode for some documentation on the various features. 
    - Create an orphaned WebNode object from WEBDOC::DocNode:DocVolume into your ospace using a similar approach.
    - Create a util to create the volume node once. See LLIAPI::LLIApiRoot::FacetUtil::FacetCreationUtil.CreateFacetsVolume as an example. This can be called on install or upgrade, for example, you could call it from Configure or from a DB upgrade script if you have schema in your module and create the volume in the UpdateLibrary.

    Regards
    Ian


  • I see, thank you so much Ian!