# EssPutObject

Description

EssPutObject() copies an object from a local file to the server or client object system, and optionally unlocks it.

Syntax

    ESS_FUNC_M  EssPutObject (hCtx, ObjType, AppName, DbName, ObjName, LocalName, Unlock);

ESS_HCTX_T | hCtx
ESS_OBJTYPE_T | ObjType
ESS_STR_T | AppName
ESS_STR_T | DbName
ESS_STR_T | ObjName
ESS_STR_T | LocalName
ESS_BOOL_T | Unlock

Parameters

hCtx | Essbase API context handle. Can be local context handle returned by EssCreateLocalContext().
ObjType | Object type (must be single type). Refer to Bitmask Data Types for a list of possible values.
AppName | Application name.
DbName | Database name. If NULL, uses the application subdirectory.
ObjName | Name of object to put.
LocalName | Full path name of local source file on client.
Unlock | Flag to control object unlocking. If TRUE, the server object is unlocked to allow updates by other users.

Return Value

If successful, the object is copied to the server from the local file specified by LocalName.

Notes

- In order to put an object which already exists on the server, it must have previously been locked by the caller. If the object does not already exist on the server, it will be created.

Access

This function requires the caller to have the appropriate level of access to the specified application and/or database to contain the object (depending on the object type). To unlock the object (unlock flag is TRUE), the caller must have Application or Database Design privilege (ESS_PRIV_APPDESIGN or ESS_PRIV_DBDESIGN) for the specified application or database containing the object.

Example

    ESS_FUNC_M
    ESS_PutObject (ESS_HCTX_T hCtx)
    {
       ESS_FUNC_M         sts = ESS_STS_NOERR;
       ESS_STR_T         AppName;
       ESS_STR_T         DbName;
       ESS_STR_T         ObjName;
       ESS_OBJTYPE_T     ObjType;
       ESS_STR_T         LocalName;
       ESS_BOOL_T        UnLock;

       AppName   = "Sample";
       DbName    = "Basic";
       ObjName   = "Basic1";
       ObjType   = ESS_OBJTYPE_OUTLINE;
       LocalName = "c:\\essbase\\client\\Test.otl";
       UnLock    = ESS_TRUE;

       sts = EssPutObject (hCtx, ObjType, AppName,
             DbName, ObjName, LocalName, UnLock);
       return (sts);
    }

See Also

EssGetObject()
EssLockObject()
EssUnlockObject()