Zum Hauptinhalt gehen

Suche

Suche

Commander Saving New Templates

Kommentare

3 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    New templates can be added to Librarian using the .NET SDK via the Librarian class.  A BarTender file is added to the repository by calling the Library class' AddFile method. The following C# code demonstrates how to add a file to Librarian.

     
    Library library = new Library();
    
    LibrarianFile file = library.AddFile("lib://Formats/Address.btw", @"C:\Users\Administrator\Documents\Address.btw", "Added Address.btw to the library."); 
    The first parameter passed in the AddFile method is the path of the folder where you want to save your label format, along with the file name of the file. The second parameter specifies the path and filename of the file to add, and the third parameter is the comment that describes the addition of the file into the repository. The Library class provides an overload for the AddFile method to specify additional advanced options for adding a file.
     
    However, your approach is wrong.  What you should do is add the file to Librarian from the very beginning as the whole point of the application is versioning and control.  Depending on the current state of the file will set whether the file is a published or unpublished document.  Configure the workflow to determine which states are considered as published.  You can then use the Security Center to define which users and groups have the ability to print unpublished labels.  For example a print operator would be unable to print an unpublished document.  See the below white paper:
     
    0
  • Avatar
    Legacy Poster

    Thanks Ian. I have gone through the white paper and your recommendation is a good one - I'll discuss with my colleagues. One point of clarification though - we are running BTXML through Commander running as a service. When we print labels we will obviouly want to use only the most recently published revision of a label format. If I set the account that the service runs under to only have Print Published Label Formats will this ensure that only the latest published revision will be printed?

    0
  • Avatar
    Ian Cummings
    Moderator

    In the BarTender command handler setup in Commander, there is an option to specify how often it checks for newer document versions.  Note that a Commander service will always run under a nominated account, and you need to make sure that the account can only print published labels via Security Center.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.