MeridianQueue Object

The Publisher queue can be managed using the MeridianQueue object methods that are described below.

MeridianQueue Object Methods

The MeridianQueue object provides the methods that are described below.

ClosedBeginBatch Method

Begins collection of a batch of documents to register in the Publisher queue.

Syntax

Function BeginBatch (vaultId, commitSize)
Parameters
Name Description

vaultId

A string that uniquely identifies the vault in which the document resides. Specify Nothing or an empty string to work in the same vault where the VBScript runs. The vault identifier has the syntax \\server\vault, where server is the name of the server computer and vault is the internal name of the vault or datastore. The vault identifier may consist of only a vault name, in which case the vault's default server, if set, will be assumed.

commitSize

The number of documents to send to the server as a single transaction. The default is 0, all documents in the batch are sent as one transaction.

Remarks

This method must be called in the _Initialize event procedure of a custom command, similar to the following examples. If this is not done, then the RegisterDocument method registers documents in the queue individually.

If any document is registered more than once, the Publisher configuration options described in Configure a Vault For Publisher will determine the disposition of the batch.

Example

The following examples demonstrate how to do batch publishing either in a server-side process (better performance and recommended) or a client-side process (if a client context is required).

Note:

The server-side example relies on the account under which the EDM Server service is running to have access to the Meridian Enterprise Server web service.

Sub Publish_Batch_Execute(Batch)
	AddToBatch Batch, Document
End Sub

Sub Publish_Batch_Initialize(Batch)  
    BeginBatch(Batch)
End Sub

Sub Publish_Batch_Terminate(Batch)
  CommitBatch(Batch)	
  If Err.Number = 0 Then
	WinMsgBox ("Documents have been registered for publishing")
  End If    
  If Err.Number <> 0 Then  
	  WinMsgBox Err.Description
      Err.Clear       
  End If  
  
End Sub

Public Sub BeginBatch(Batch)   
  Dim QueueObject
  ' Server side batch. For client side batch, pass False instead
  Set QueueObject = AMCreateObject("BCPublisher.MeridianQueue", True)
  Batch.Argument("PublisherBatch") = QueueObject    
  QueueObject.BeginBatch  
End Sub
  
Public Sub CommitBatch(Batch)  
  On Error Resume Next
  Dim QueueObject
  Set QueueObject = Batch.Argument("PublisherBatch")
  Batch.Argument("PublisherBatch") = Nothing
  If Not (QueueObject Is Nothing) Then
    QueueObject.CommitBatch		
    QueueObject.Dispose()      
  End If
  
  If Err.Number <> 0 Then
    Err.Raise Err.Number, Err.Source, _
      "Failed to publish batch of documents: " + Err.Description
  End If 
End Sub 
  
Public Sub AddToBatch(Batch, Document)
  Dim QueueObject      
  Set QueueObject = Batch.Argument("PublisherBatch")
  If Not (QueueObject Is Nothing) Then    
    Call QueueObject.RegisterDocument("", "1B4423", Document.ID, , , , , ,"")    
  End If
End Sub 

ClosedCommitBatch Method

Commits as one batch all documents that have been registered in the Publisher queue since the calling of the BeginBatch method.

Syntax

Function CommitBatch (vaultId)
Parameters
Name Description

vaultId

A string that uniquely identifies the vault in which the document resides. Specify Nothing or an empty string to work in the same vault where the VBScript runs. The vault identifier has the syntax \\server\vault, where server is the name of the server computer and vault is the internal name of the vault or datastore. The vault identifier may consist of only a vault name, in which case the vault's default server, if set, will be assumed.

Remarks

This method must be called in the _Terminate event procedure of a custom command, similar to the example shown in BeginBatch method. If this is not done, then the RegisterDocument method registers documents in the queue individually.

ClosedRegisterDocument Method

Registers a Meridian Enterprise document in the Publisher queue.

Syntax

Function RegisterDocument(vaultId, jobId, documentId, _
                          revisionId, publishOptions, renderOptions, _
                          userName, preventDuplicate, feedbackProperty,
                          customColumns)
Parameters
Name Description

vaultId

A string that uniquely identifies the vault in which the document resides. Specify Nothing or an empty string to work in the same vault where the VBScript operates. The vault identifier has the syntax \\server\vault, where server is the name of the server computer and vault is the internal name of the vault or datastore. The vault identifier may consist of only a vault name, in which case the vault's default server, if set, will be assumed.

jobId

A string that uniquely identifies the publishing job name. If the job has multiple destination systems configured and the document should be published to only one of the systems, this string must specify the destination system display name. Use the syntax jobId}systemDisplayName (for example, MyJob}MySystem). If the document should be published to all of the destination systems, the system name should be omitted.

documentId

A string that uniquely identifies the document to publish.

This parameter accepts either a document ID, path, or Global ID value. However, because the document's Global ID and path can change, we do not recommend using values other than the document ID except under the direction of Accruent Technical Support.

revisionId

A string that uniquely identifies the revision of the document. The default is Nothing.

publishOptions

A string that specifies the options for the system links. The default is Nothing. For information about the options that can be specified, see Publishing And Rendering Options.

renderOptions

A string that specifies the options for the rendering modules. The default is Nothing. For information about the options that can be specified, see Publishing And Rendering Options.

userName

The name of the user who initiated the task. The user account must exist in the Meridian Enterprise Server account database as described in Create And Edit User Accounts. If this parameter is Nothing or an empty string, the name of the current user is used.

preventDuplicate

A Boolean value indicating whether to check for duplicate items before adding a new one. If any duplicates are found, the item will not be created. If Nothing, then the option set for the publishing job is used.

feedbackProperty

The name of the property where to store the result of the registration.

customColumns

A 2D array of values (<columnName>, <columnValue>) that represent custom columns in the Publisher Queue database.

Return Value

An integer value that uniquely identifies the registered document in the queue.

Remarks

Before calling a RegisterDocument from VBScript, you should create it with the AMCreateObject function and specify the ProgId of the object as described in AMCreateObject Function. To explicitly delete and release the object, call the Dispose method.

Instantiating a MeridianQueue object to publish documents can take longer than publishing the same document with the PowerUser extension.

ClosedRevokeBatch Method

Revokes all documents that have been registered in the Publisher queue since the calling of the BeginBatch method.

Syntax

Function RevokeBatch (vaultId)
Parameters
Name Description

vaultId

A string that uniquely identifies the vault in which the document resides. Specify Nothing or an empty string to work in the same vault where the VBScript runs. The vault identifier has the syntax \\server\vault, where server is the name of the server computer and vault is the internal name of the vault or datastore. The vault identifier may consist of only a vault name, in which case the vault's default server, if set, will be assumed.

Remarks

This method must be called in the _Terminate event procedure of a custom command, similar to the example shown in BeginBatch method. If this is not done, then the RegisterDocument method revokes documents in the queue individually.

2022 R2