1 Reply Latest reply on Jul 23, 2010 8:08 PM by areohbee

    Publish Service and Collection Names

    Allen Gambrell Level 1

      I am creating a publish service and need some information on the naming of publish collections.

       

      I want to prevent the user from naming the collections anything but the name that is on the server. This needs to happen even on creation.

       

      I know I can prevent the renaming by setting disableRenamePublishedCollection = false, but that does not help on the creation.

       

      The best way to do this would to prevent the user from entering a name when they are creating a collection, I have yet to see a way to do this.

       

      If not then need to set the name of the collection to the name that is on the server. I have tried this with no luck. http://forums.adobe.com/thread/662683?tstart=60

      I cannot get the name of the collection to change right after it is created. It may change for a second then goes right back.

       

      Anyone have any suggestions?

       

      I thought of maybe making a thread that would wait a time then rename the collection, but I am lost on how to do that.

        • 1. Re: Publish Service and Collection Names
          areohbee Level 5

          I don't know if this will help, but:

           

          the catalog:withWriteAccessDo function creates an SQL transaction, and if any error occurs before that function returns the catalog changes are rolled back. Also, no changes take place until that function returns successfully. So try code like:

           

          local sts = LrTasks.pcall( cat.withWriteAccessDo, cat, ..., function()

           

               change name

           

          end )

           

          then check the status...

           

          If the status is good, but the name isn't sticking, then I don't have a clue...

           

          Rob