priint.

Version :
12.03.2024, 15:56 Uhr

priint. This module provides methods to communicate with a priint:comet Server.

static int checkout(
  char* documentId,
  char* path,
  char* masterdocumentID = 0)

Checkout a document. This method requires a connection to a priint:comet server, see Dokumente: Checkin / Checkout

Please note the different behaviour depending on the environment:

Name Type Default Description
Return int   0 or ErrorCode
documentId String or char* - the documents ID, see DocumentID
path String or char* - path (out).
masterdocumentID String or char* 0 optional, generate document from masterdocument if it does not yet exist.

Checkout a document (Panelstatement 111). In this context the global variables gDocumentStatus, gDocumentPath and tags for objects from the publication panel are available):

int main () 
{
    char 	* 	path 	= alloc (4096);
    int 		result 	= priint::checkout ("<Content_StringID>", path);
if (result == 0) { strcpy (gDocumentPath, path); } else { wlog ("", "checkout <Name> (<Content_StringID>) failed with result code %d\n", result); }
release (path); return result; }

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int checkin(
  char* documentId,
  char* path,
  char* options = 0,
  int env = 8)

Checkin a document. This method requires a connection to a priint:comet server, see Dokumente: Checkin / Checkout

Please note the different behaviour depending on the environment:

Name Type Default Description
Return int   0 or ErrorCode
documentId String or char* - the documents ID, see DocumentID
path String or char* - path, the recommended value is gDocumentPath
options String or char* 0 options for meta data, see here
env int 8 environment, one of kWithInDesignServer (8) or kNoInDesignServer (9)
#include "internal/types.h"

Checkin a document (Panelstatement 115) In this context the global variables gDocumentStatus, gDocumentPath and tags for objects from the publication panel are available):

int main () 
{
    int result = priint::checkin ("<Content_StringID>", gDocumentPath);
if (result != 0) { wlog ("", "checkin <Name> (<Content_StringID>) failed with result code %d\n", result); }
return result; }

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int revert(char* documentId, char* path)

Revert a document. This method requires a connection to a priint:comet server, see Dokumente: Checkin / Checkout When reverting a document the server status will be reset, but the document wont be uploaded, thus local chnages will be lost. For local documents a backup (if available) will be restored, see Dokumente: Checkin / Checkout

Name Type Default Description
Return int   0 or ErrorCode
documentId String or char* - the documents ID, see DocumentID
path String or char* - path, the recommended value is gDocumentPath

Note Depending on the context not all environment variables are available. When called in consequence of a failed checkout call gDocumentID is empty, bacause the association Record ID (ID1, ID2, ID3, StringID) to documentID has not yet been determined. If your checkout script looks like this:

(fragment, Panelstatement 111):

int main ()
{
    return priint::checkout ("", gDocumentPath);
}

... the corresponding revet script should look like this:

int main () 
{
    return priint:revert ("", gDocumentPath);
}

Revert a document (Panelstatement 117). In this context the global variables gDocumentStatus, gDocumentPath and tags for objects from the publication panel are available):

int main () 
{
    int result = priint::revert ("<Content_StringID>", gDocumentPath);
if (result != 0) { wlog ("", "reverting <Name> (<Content_StringID>) failed with result code %d\n", result); }
return result; }

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int document_status(char* documentId)

Get a documents state. This method requires a connection to a priint:comet server, see Dokumente: Checkin / Checkout

Name Type Default Description
Return int   Status. This value should be copied to the global variable gDocumentStatus
Valid states are sind:
  • kAvailable The document is available
  • kOpenedOnServer The document is opened on the server and cannot be used at the moment.
  • kOpenedOnClient The document is checked out on (another) client and cannot be used at the moment.
  • kOpenedByUser The document is checked out by the user, it is assumed that it can be used.
  • kOpenedInSession The document is checked out in the current session and can be used.
  • kNotExisting The document is registered but does not exist, it must be created from a document template before it can be used.
  • kNotRegistered The document is not registered, it cannot be used.
documentId String or char* - the documents ID, see DocumentID
#include "internal/types.h"

Retreive a documents state (Panelstatement 114). In this context the global variables gDocumentStatus, gDocumentPath and tags for objects from the publication panel are available):

int main () 
{
    int status = priint::document_status ("<Content_StringID>");
if (status < 0) { wlog ("", "Error: status for document <Name> (<Content_StringID>) could not be obtained: %d\n", status); return -1; } *gDocumentStatus = status;
return 0; }

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int call_checkin(char* documentId, char* path)

Run the checkin routines just like clicking the checkin button in the panel (even if the corresponding object isnt actually shown). This methods allows binding checkin to other events (like save or close)

Name Type Default Description
Return int   0 or ErrorCode
documentId String or char* - ID of the destination document, siehe DocumentID
path String or char* - path, the recommended value is gDocumentPath

Call the checkin routines on close (Panelstatement 113). In this context the global variables gDocumentStatus, gDocumentPath and tags for objects from the publication panel are available):

int main () 
{
    return priint::call_checkin ("<Content_StringID>", gDocumentPath);
}

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static DBC connection()

Get the current priint:comet server connection. The connection may never be deleted by means of a script command.

Name Type Default Description
Return DBC   Current priint:comet server connection of InDesign® or 0

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_prefs_editable(int editable)

Enable or disable the priint preferences panel.

Name Type Default Description
editable int - 0: disable prefs panel
1: enable prefs panel.

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_pref(int prefID, int value)

Enable or disable the priint preferences panel. For more information about parameter keys and values see Preferences

Name Type Default Description
prefID int - one of

kPriintDownloadPolicy
kPriintOfflinePolicy
kPriintLocalBackup
kPriintShowProgress.

internal/types.h must be included to use these constants
value int - depending on prefID

kPriintDownloadPolicy : kPriintAutoDownload, kPriintAlwaysDownload, kPriintNeverDownload

kPriintOfflinePolicy: kPriintLimitedOfflineOP, kPriintNoOfflineOP, kPriintFullOfflineOP

kPriintLocalBackup : 0 | 1

kPriintShowProgress: 0 | 1
#include "internal/types.h"

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int get_pref(int prefID)

Enable or disable the priint preferences panel. For more information about parameter keys and values see Preferences

Name Type Default Description
Return int   depending on prefID kPriintDownloadPolicy : kPriintAutoDownload, kPriintAlwaysDownload, kPriintNeverDownload

kPriintOfflinePolicy: kPriintLimitedOfflineOP, kPriintNoOfflineOP, kPriintFullOfflineOP

kPriintLocalBackup : 0 | 1

kPriintShowProgress: 0 | 1
prefID int - one of kPriintDownloadPolicy
kPriintOfflinePolicy
kPriintLocalBackup
kPriintShowProgress

internal/types.h must be included to use these constants
#include "internal/types.h"

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int create_metadata(
  ItemRef docRef,
  char* destPath,
  char* options = 0,
  int type = 7)

Create priint:comet meta data of a given document.

Name Type Default Description
Return int   0 or ErrorCode
docRef itemRef - Document

0 : Current document
destPath String or char* - Complete path of meta data zip

0 : Document path and name with postfix ".meta.zip". For non-new documents only!
options String or char* 0 Export options, see here
type int span[keyword]{kUseServerSettings} Which settings should be used?

kUseServerSettings
kWithInDesignServer
kNoInDesignServer

Version 3.1

priint:comet InDesign® Plug-Ins, comet_pdf

static int create_cometgroup_previews(
  ItemRef docRef = 0,
  char* destPath = 0,
  int resolution = 120,
  char* options = 0,
  char* ext = 0,
  int rmvExisting = 0)

Create a preview of each Comet Group of a document.

Name Type Default Description
Return int   0 or ErrorCode
docRef itemRef 0 Document

0 : Current document
destPath String oder char* 0 Complete destination path for the preview files folder. If the folder does not exist, it will be created.

0 : Use document path and name (without the indd extension). Only for non-new documents!
resolution int 120 Image resolution in dpi
options String oder char* 0 Image options for the previews, see here
ext String oder char* 0 FFile extension matching the format (e.g. "jpg" or "png") or empty
rmvExisting int 0 Should an existing folder be deleted beforehand?

0 : No, do not delete
1 : Yes, an old folder can be deleted

Create 360 dpi PNG previews of all Comet Groups in the current document.

int main ()
{
    int 			r
r = priint::create_cometgroup_previews (0, 0, 360, "format:png;", "png", 1); showmessage ("Result : %d", r);
return 0; }

v4.2 R31950, 29. Nov 2022

priint:comet InDesign® Plug-Ins, comet_pdf

Author
Christoph Soergel
Version
12.03.2024, 15:56 Uhr
Since
Plugin Version 3.1

Alphabetic index HTML hierarchy of classes or Java