Library | File

Class pfcServer

# include <pfcServer.h>

class pfcServer
 : public virtual pfcChild,
 : public virtual pfcServerLocation
{
    xaideclare(pfcServer)
    ...
};



Description

This class describes server



Method Summary

voidActivate ()
Sets the server to be active in session.
voidCheckinObjects (optional pfcModel_ptr Mdl, optional pfcCheckinOptions_ptr Options)
Checks in an object to the database.
xstringsequence_ptrCheckoutMultipleObjects (xstringsequence_ptr Files, xbool Checkout, optional pfcCheckoutOptions_ptr Options)
Checks out or downloads multiple objects to the workspace. Checkout rules are processed based on the Workspace config spec, unless the version is set using pfcCheckoutOptions::GetVersion(optional xrstring). If the config spec is LATEST, for example, the latest version of the indicated object(s) will be checked out. If an aliased URL path to a model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.
xstringCheckoutObjects (optional pfcModel_ptr Mdl, optional xrstring File, xbool Checkout, optional pfcCheckoutOptions_ptr Options)
Checks out or downloads an object to the workspace. Checkout rules are processed based on the Workspace config spec, unless the version is set using pfcCheckoutOptions::GetVersion(optional xrstring). If the config spec is LATEST, for example, the latest version of the indicated object(s) will be checked out. If an aliased URL path to the model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.
voidCreateWorkspace (pfcWorkspaceDefinition_ptr Definition)
Creates and activates a new workspace.
xstringGetActiveWorkspace ()
voidSetActiveWorkspace (xrstring value)
Specifies the name of active server.
xstringGetAlias ()
Specifies the alias of server.
xstringGetAliasedUrl (xrstring ModelName)
Gets aliased url for a given model name.
xstringGetContext ()
Specifies context of the server
xboolGetIsActive ()
Specifies whether server active or not.
xboolIsObjectCheckedOut (xrstring WorkspaceName, xrstring ObjectName)
Returns the checkout status for the given object in the workspace.
xboolIsObjectModified (xrstring WorkspaceName, xrstring ObjectName)
Returns the modification status for the given object in the workspace.
pfcServerObjectStatus_ptrIsServerObjectModified (xrstring WorkspaceName, xrstring ObjectName)
Checks if the given object is modified in workspace or modified locally.
voidRemoveObjects (optional xstringsequence_ptr ModelNames)
Removes a list of models from a workspace.
voidUndoCheckout (pfcModel_ptr Mdl)
Undoes the checkout of the given object.
voidUnregister ()
Unregisters a given server and cleans a local cache for the server.
voidUploadObjects (pfcModel_ptr Mdl)
Uploads an object to the database.
voidUploadObjectsWithOptions (optional pfcModel_ptr TopModel, pfcUploadOptions_ptr Options)
Uploads objects to the database with the specified options.


Methods Inherited from Class pfcChild:

GetDBParent, GetOId


Methods Inherited from Class pfcServerLocation:

GetLocation, GetVersion, GetClass, CollectWorkspaces, DeleteWorkspace, ListContexts



Method Detail

xstringGetAlias ()

Specifies the alias of server.
Manual References:
Windchill Connectivity APIs: Accessing Information From a Registered Server, Windchill Connectivity APIs: Accessing Information From a Registered Server




xstringGetActiveWorkspace ()
voidSetActiveWorkspace (xrstring value)

Specifies the name of active server.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.

pfcXToolkitInvalidDir - The workspace couldn't be found or created.

pfcXToolkitFound - The workspace is already set.


Manual References:
Windchill Connectivity APIs: Creating and Modifying the Workspace, Windchill Connectivity APIs: Creating and Modifying the Workspace, Windchill Connectivity APIs: Creating and Modifying the Workspace, Windchill Connectivity APIs: Creating and Modifying the Workspace




xboolGetIsActive ()

Specifies whether server active or not.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - There is no active aliased server (Local Dir is active).


Manual References:
Windchill Connectivity APIs: Accessing Information From a Registered Server, Windchill Connectivity APIs: Accessing Information From a Registered Server




xstringGetContext ()

Specifies context of the server

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.


Manual References:
Windchill Connectivity APIs: Accessing Information From a Registered Server




voidUnregister ()

Unregisters a given server and cleans a local cache for the server.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server is not registered.

pfcXToolkitCantWrite - Cannot delete this workspace.

pfcXToolkitCheckoutConflict - The workspace cannot be deleted due to checked out objects in its contents.


Manual References:
Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: Creating and Modifying the Workspace
Returns:



voidActivate ()

Sets the server to be active in session.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.


Manual References:
Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: To Register a Server with an Existing Workspace
Returns:



voidCreateWorkspace (pfcWorkspaceDefinition_ptr Definition)

Creates and activates a new workspace.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server is not registered.

pfcXToolkitFound - The workspace already exists.

pfcXToolkitCantWrite - Cannot create a workspace on this server.


Manual References:
Windchill Connectivity APIs: Accessing Workspaces, Windchill Connectivity APIs: Creating and Modifying the Workspace, Windchill Connectivity APIs: Creating and Modifying the Workspace, Windchill Connectivity APIs: To Register a Server with a New Workspace
Parameters:
Definition
Object of pfcWorkspaceDefinitions.
Returns:



voidUploadObjects (pfcModel_ptr Mdl)

Uploads an object to the database.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The top level object was not found.

pfcXToolkitBadContext - The primary server is not set.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.

pfcXToolkitNotValid - Upload called for an unsaved object. Please save and then Upload.


See Also:
pfcXToolkitCheckoutConflict
Manual References:
Windchill Connectivity APIs: Upload, Windchill Connectivity APIs: Upload, Windchill Connectivity APIs: Conflicts During Server Operations
Parameters:
Mdl
The model to upload.
Returns:



voidUploadObjectsWithOptions (optional pfcModel_ptr TopModel, pfcUploadOptions_ptr Options)

Uploads objects to the database with the specified options.

The model should be saved using pfcModel::Save() before it can be uploaded. This function does not save the model by default. The model can also be imported using pfcBaseSession::ImportToCurrentWS(xstringsequence_ptr, pfcRelCriterion) before it can be uploaded.

Exceptions thrown (but not limited to):

pfcXToolkitBadContext - The primary server is not set and/or Design Test Mode is active - the function is not available in this mode.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.


Manual References:
Windchill Connectivity APIs: Upload, Windchill Connectivity APIs: Upload
Parameters:
TopModel
The model to upload. Pass null to upload the entire workspace
Options
Upload options object of type pfcUploadOptions.
Returns:



voidCheckinObjects (optional pfcModel_ptr Mdl, optional pfcCheckinOptions_ptr Options)

Checks in an object to the database.

The model must be saved using pfcModel::Save() before it can be checked in. This function does not save the model by default.

Exceptions thrown (but not limited to):

pfcXToolkitBadContext - The primary server is not set and/or Design Test Mode is active - the function is not available in this mode.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.


See Also:
pfcXToolkitCheckoutConflict
Manual References:
Windchill Connectivity APIs: CheckIn, Windchill Connectivity APIs: CheckIn, Windchill Connectivity APIs: Conflicts During Server Operations
Parameters:
Mdl
The model to checkin. Pass null to check in the entire workspace
Options
Checkin options object of type pfcCheckinOptions. Pass null for a default checkin (as per Creo Parametric's Checkin button in the File menu).
Returns:



xstringCheckoutObjects (optional pfcModel_ptr Mdl, optional xrstring File, xbool Checkout, optional pfcCheckoutOptions_ptr Options)

Checks out or downloads an object to the workspace. Checkout rules are processed based on the Workspace config spec, unless the version is set using pfcCheckoutOptions::GetVersion(optional xrstring). If the config spec is LATEST, for example, the latest version of the indicated object(s) will be checked out. If an aliased URL path to the model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.

One of Mdl and File must not be null.This can be either an aliased URL to a given object or the object name.If an aliased URL path to the model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The top level object was not found.

pfcXToolkitBadContext - The primary server is not set when mdl is passed.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.


See Also:
pfcXToolkitCheckoutConflict
Manual References:
Windchill Connectivity APIs: Checkout and Download, Windchill Connectivity APIs: Checkout and Download, Windchill Connectivity APIs: Conflicts During Server Operations
Parameters:
Mdl
The top level object to checkout.Can be null
File
The top level object to checkout or download.Can be null.
Checkout
Checkout flag .true to checkout and download, false to download without checking out.
Options
Checkout options object of type pfcCheckoutOptions. Pass null for a default checkout (as per Creo Parametric's Checkout button in the File menu).
Returns:
The url to the top level object in its downloaded/checked out location



xstringsequence_ptrCheckoutMultipleObjects (xstringsequence_ptr Files, xbool Checkout, optional pfcCheckoutOptions_ptr Options)

Checks out or downloads multiple objects to the workspace. Checkout rules are processed based on the Workspace config spec, unless the version is set using pfcCheckoutOptions::GetVersion(optional xrstring). If the config spec is LATEST, for example, the latest version of the indicated object(s) will be checked out. If an aliased URL path to a model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The top level object was not found.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.


Manual References:
Windchill Connectivity APIs: Checkout and Download, Windchill Connectivity APIs: Checkout and Download
Parameters:
Files
Sequence of top level objects to checkout or download. This can contain either aliased URLs to a given object or the object name. If an aliased URL path to the model is supplied, and more than one revision of the model is in the path, Creo Parametric will apply the workspace config spec rules against the objects which reside in that folder.
Checkout
Checkout flag .true to checkout and download, false to download without checking out.
Options
Checkout options object of type pfcCheckoutOptions. Pass null for a default checkout (as per Creo Parametric's Checkout button in the File menu).
Returns:
Sequence of urls to the top level objects in their downloaded/checked out location.



voidUndoCheckout (pfcModel_ptr Mdl)

Undoes the checkout of the given object.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The top level object was not found.

pfcXToolkitBadContext - The primary server is not set.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts return.


See Also:
pfcXToolkitCheckoutConflict
Manual References:
Windchill Connectivity APIs: Undo Checkout, Windchill Connectivity APIs: Conflicts During Server Operations
Parameters:
Mdl
The top level model that was checked out.
Returns:



voidRemoveObjects (optional xstringsequence_ptr ModelNames)

Removes a list of models from a workspace.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - One or more documents are not found. Check the conflicts return.

pfcXToolkitBadContext - The primary server is not set.

pfcXToolkitCheckoutConflict - Conflicts occurred. Check the details in the conflicts output.


See Also:
pfcXToolkitCheckoutConflict
Manual References:
Windchill Connectivity APIs: Delete Objects, Windchill Connectivity APIs: Conflicts During Server Operations
Parameters:
ModelNames
Returns:



xboolIsObjectCheckedOut (xrstring WorkspaceName, xrstring ObjectName)

Returns the checkout status for the given object in the workspace.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The given object is not in the workspace.

pfcXToolkitBadContext - The server was not registered or the workspace couldn't be found on the server.


Manual References:
Windchill Connectivity APIs: Server Object Status, Windchill Connectivity APIs: Server Object Status
Parameters:
WorkspaceName
The workspace name.
ObjectName
The object name
Returns:
true if the object is currently checked out to active workspace. false for one of the following cases:
  • The object is not checked out.
  • The object is only uploaded to workspace, but was never checked in.
  • The object is only saved to local workspace cache, but was never uploaded.



xboolIsObjectModified (xrstring WorkspaceName, xrstring ObjectName)

Returns the modification status for the given object in the workspace.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The given object is not in the workspace.

pfcXToolkitBadContext - The server was not registered or the workspace couldn't be found on the server.


Manual References:
Windchill Connectivity APIs: Server Object Status, Windchill Connectivity APIs: Server Object Status
Parameters:
WorkspaceName
The workspace name.
ObjectName
The object name
Returns:
Object modification status. true if the object was modified locally.



xstringGetAliasedUrl (xrstring ModelName)

Gets aliased url for a given model name.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The object was not found.


Manual References:
Windchill Connectivity APIs: Utility APIs, Windchill Connectivity APIs: Utility APIs
Parameters:
ModelName
The model name.
Returns:
The aliased url to the model.



pfcServerObjectStatus_ptrIsServerObjectModified (xrstring WorkspaceName, xrstring ObjectName)

Checks if the given object is modified in workspace or modified locally.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The given object is not in the workspace.

pfcXToolkitBadContext - The server was not registered or the workspace couldn't be found on the server.


Manual References:
Windchill Connectivity APIs: Server Object Status, Windchill Connectivity APIs: Server Object Status
Parameters:
WorkspaceName
The workspace name.
ObjectName
The object name.
Returns:
The server object status.