Commander Saving New Templates フォローする

0
Avatar
Legacy Poster

We have set up a BarTender system landscape where we have a
Test server and a Production server. All new or modified templates are done on
the Test server. Once they have been through user acceptance testing we then
need to migrate the template to the Production server.

 

I was wondering whether we could use a Commander task to scan for a template being put into a directory and on detection it copies it into Librarian automatically (either as a new
template or an overwrite of an existing one). Are there commands that will let
me do this?


 

3 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

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
コメントアクション Permalink

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
モデレータ
コメントアクション Permalink

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.

サインインしてコメントを残してください。