ShareAttachment function

Syntax

ShareAttachment(URLID, DirAndFilePrefix, ShareURL, ShareMode, ShareRole, ExpirationDateTime, AccessToken, UsernameArray)

Description

Use the ShareAttachment function to share files in Oracle Content and Experience Cloud (CEC).

Parameters

Parameter Description

URLID

Specifies an Oracle Content Cloud.

DirAndFilePrefix

A directory and file name prefix. This is appended to the URLID parameter to get the actual file for sharing.

Note: Because the DirAndFilePrefix parameter is appended to the URL, it requires forward slashes (“/”). Backward slashes (“\”) are not supported for this parameter.

ShareURL

Specifies the URL to access the file that is being shared.

ShareMode

Specifies the sharing mode assigned to a user.

The following modes of sharing are supported:

  • %ShareMode_Member - Use this sharing mode to allow access as a member to the folder, which contains the specified file. The link to access the file is updated in the ShareURL parameter.

  • %ShareMode_PublicRegisteredUsers - Use this sharing mode to allow access as a public registered user, who can access the file if the user has a cloud account. The link to access the file is updated in the ShareURL parameter.

  • %ShareMode_PublicAnyone - Use this sharing mode to allow anyone having access to the Web. The link to access the file is updated in the ShareURL parameter.

If no value is passed for this parameter, %ShareMode_PublicRegisteredUsers access is assumed.

This is an optional parameter.

ShareRole

Specifies the role assigned to a user that allows user to view a file, download a file, and modify a file.

The following roles are supported:

  • %ShareRole_Viewer - allowed to view a file online.

  • %ShareRole_Downloader - allowed to download a file.

  • %ShareRole_Contributor - allowed to modify a file.

If no value is passed for this parameter, %ShareRole_Viewer role is assumed.

This is an optional parameter.

ExpirationDateTime

This parameter is used only when the sharing mode is %ShareMode_PublicAnyone or %ShareMode_PublicRegisteredUsers.

If a valid date and time are not passed, a public link URL that never expires is created.

This is an optional parameter.

AccessToken

AccessKey is set in the public link that is generated.

This parameter is used only when the sharing mode is %ShareMode_PublicAnyone or %ShareMode_PublicRegisteredUsers.

If the GENERATEACCESSKEY property is set to Y and

  • if you don't pass a string variable, the API fails.

  • if you pass an empty string variable, the API generates a random access key and sets it in this variable.

  • if you pass a non-empty string variable, the API uses that as the access key.

This is an optional parameter.

UsernameArray

Specifies users who are added as members to the folder, which contains the specified file.

This parameter is used only when the sharing mode is %ShareMode_Member.

If no value is passed in this parameter, an empty string array is assumed.

This is an optional parameter.

Returns

An integer value (0) irrespective of whether the function is successful or not.

Note:

It is reserved for future use.

Example

Local array of string &user = CreateArrayRept("XYZ", 1);
Local string &url;
ShareAttachment(URLID.PAYSLIP, "PaySlips_XYZ", &url, %ShareMode_Member, %ShareRole_Downloader, , &dt, "", &user);