ContentHub Class
Namespace
ContentHub Methods
Use ContentHub methods to work with Files Connect repositories.
addRepositoryItem(repositoryId, repositoryFolderId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
This example creates a file without binary content (metadata only) in a Google Drive repository folder. After the file is created, we show the file’s ID, name, description, external URL, and download URL.
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs';
final ConnectApi.ContentHubItemInput newItem = new ConnectApi.ContentHubItemInput();
newItem.itemTypeId = 'document'; //see getAllowedTypes for any file item types available for creation/update
newItem.fields = new List<ConnectApi.ContentHubFieldValueInput>();
//Metadata: name field
final ConnectApi.ContentHubFieldValueInput fieldValueInput = new ConnectApi.ContentHubFieldValueInput();
fieldValueInput.name = 'name';
fieldValueInput.value = 'new folder item name.txt';
newItem.fields.add(fieldValueInput);
//Metadata: description field
final ConnectApi.ContentHubFieldValueInput fieldValueInputDesc = new ConnectApi.ContentHubFieldValueInput();
fieldValueInputDesc.name = 'description';
fieldValueInputDesc.value = 'It does describe it';
newItem.fields.add(fieldValueInputDesc);
final ConnectApi.RepositoryFolderItem newFolderItem = ConnectApi.ContentHub.addRepositoryItem(gDriveRepositoryId, gDriveFolderId, newItem);
final ConnectApi.RepositoryFileSummary newFile = newFolderItem.file;
System.debug(String.format('New file - id: \'\'{0}\'\', name: \'\'{1}\'\', description: \'\'{2}\'\' \n external URL: \'\'{3}\'\', download URL: \'\'{4}\'\'', new String[]{ newFile.id, newFile.name, newFile.description, newFile.externalDocumentUrl, newFile.downloadUrl}));
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
addRepositoryItem(repositoryId, repositoryFolderId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs';
final ConnectApi.ContentHubItemInput newItem = new ConnectApi.ContentHubItemInput();
newItem.itemTypeId = 'document'; //see getAllowedTypes for any file item types available for creation/update
newItem.fields = new List<ConnectApi.ContentHubFieldValueInput>();
//Metadata: name field
Final String newFileName = 'new folder item name.txt';
final ConnectApi.ContentHubFieldValueInput fieldValueInput = new ConnectApi.ContentHubFieldValueInput();
fieldValueInput.name = 'name';
fieldValueInput.value = newFileName;
newItem.fields.add(fieldValueInput);
//Metadata: description field
final ConnectApi.ContentHubFieldValueInput fieldValueInputDesc = new ConnectApi.ContentHubFieldValueInput();
fieldValueInputDesc.name = 'description';
fieldValueInputDesc.value = 'It does describe it';
newItem.fields.add(fieldValueInputDesc);
//Binary content
final Blob newFileBlob = Blob.valueOf('awesome content for brand new file');
final String newFileMimeType = 'text/plain';
final ConnectApi.BinaryInput fileBinaryInput = new ConnectApi.BinaryInput(newFileBlob, newFileMimeType, newFileName);
final ConnectApi.RepositoryFolderItem newFolderItem = ConnectApi.ContentHub.addRepositoryItem(gDriveRepositoryId, gDriveFolderId, newItem, fileBinaryInput);
final ConnectApi.RepositoryFileSummary newFile = newFolderItem.file;
System.debug(String.format('New file - id: \'\'{0}\'\', name: \'\'{1}\'\', description: \'\'{2}\'\' \n external URL: \'\'{3}\'\', download URL: \'\'{4}\'\'', new String[]{ newFile.id, newFile.name, newFile.description, newFile.externalDocumentUrl, newFile.downloadUrl}));
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getAllowedItemTypes(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getAllowedItemTypes(repositoryId, repositoryFolderId, filter)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
This example calls getAllowedItemTypes(repositoryId, repositoryFolderId, ConnectApi.ContentHubItemType.FilesOnly) to get the first ConnectApi.ContentHubItemTypeSummary.id of a file. The context user can create allowed files in a repository folder in the external system.
final ConnectApi.ContentHubAllowedItemTypeCollection allowedItemTypesColl = ConnectApi.ContentHub.getAllowedItemTypes(repositoryId, repositoryFolderId, ConnectApi.ContentHubItemType.FilesOnly);
final List<ConnectApi.ContentHubItemTypeSummary> allowedItemTypes = allowedItemTypesColl.allowedItemTypes;
string allowedFileItemTypeId = null;
if(allowedItemTypes.size() > 0){
ConnectApi.ContentHubItemTypeSummary allowedItemTypeSummary = allowedItemTypes.get(0);
allowedFileItemTypeId = allowedItemTypeSummary.id;
}
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getFilePreview(repositoryId, repositoryFileId, formatType)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
-
Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
Return Value
Type: ConnectApi.FilePreview
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFileId =
'document:1-zcA1BaeoQbo2_yNFiHCcK6QJTPmOke-kHFC4TYg3rk';final ConnectApi.FilePreview filePreview =
ConnectApi.ContentHub.getFilePreview(gDriveRepositoryId, gDriveFileId,
ConnectApi.FilePreviewFormat.Thumbnail);System.debug(String.format('Preview - URL: \'\'{0}\'\', format: \'\'{1}\'\', nbr of
renditions for this format: {2}', new String[]{ filePreview.url,
filePreview.format.name(),String.valueOf(filePreview.previewUrls.size())}));for(ConnectApi.FilePreviewUrl filePreviewUrl : filePreview.previewUrls){
System.debug('-----> Rendition URL: ' + filePreviewUrl.previewUrl);
}
getFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
Return Value
Type: ConnectApi.FilePreview
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getFilePreview(communityId, repositoryId, repositoryFileId, formatType)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
Return Value
Type: ConnectApi.FilePreview
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
Return Value
Type: ConnectApi.FilePreview
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getItemType(repositoryId, repositoryItemTypeId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubItemTypeDetail getItemType(String repositoryId, String repositoryItemTypeId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getItemType(communityId, repositoryId, repositoryItemTypeId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubItemTypeDetail getItemType(String communityId, String repositoryId, String repositoryItemTypeId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getPreviews(repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreviewCollection getPreviews(String repositoryId, String repositoryFileId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFileId = 'document:1-zcA1BaeoQbo2_yNFiHCcK6QJTPmOke-kHFC4TYg3rk';
final ConnectApi.FilePreviewCollection previewsCollection = ConnectApi.ContentHub.getPreviews(gDriveRepositoryId, gDriveFileId);
for(ConnectApi.FilePreview filePreview : previewsCollection.previews){
System.debug(String.format('Preview - URL: \'\'{0}\'\', format: \'\'{1}\'\', nbr of renditions for this format: {2}', new String[]{ filePreview.url, filePreview.format.name(),String.valueOf(filePreview.previewUrls.size())}));
for(ConnectApi.FilePreviewUrl filePreviewUrl : filePreview.previewUrls){
System.debug('-----> Rendition URL: ' + filePreviewUrl.previewUrl);
}
}
getPreviews(communityId, repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreviewCollection getPreviews(String communityId, String repositoryId, String repositoryFileId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositories()
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories()
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
This example gets all repositories and gets the first SharePoint online repository found.
final string sharePointOnlineProviderType ='ContentHubSharepointOffice365';
final ConnectApi.ContentHubRepositoryCollection repositoryCollection = ConnectApi.ContentHub.getRepositories();
ConnectApi.ContentHubRepository sharePointOnlineRepository = null;
for(ConnectApi.ContentHubRepository repository : repositoryCollection.repositories){
if(sharePointOnlineProviderType.equalsIgnoreCase(repository.providerType.type)){
sharePointOnlineRepository = repository;
break;
}
}
getRepositories(communityId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositories(pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(Integer pageParam, Integer pageSize)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositories(communityId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepository(repositoryId)
API Version
369.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepository getRepository(String repositoryId)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final string repositoryId = '0XCxx0000000123GAA';
final ConnectApi.ContentHubRepository repository = ConnectApi.ContentHub.getRepository(repositoryId);
getRepository(communityId, repositoryId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepository getRepository(String communityId, String repositoryId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFile(repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFileId = 'file:0B0lTys1KmM3sTmxKNjVJbWZja00';
final ConnectApi.RepositoryFileDetail file = ConnectApi.ContentHub.getRepositoryFile(gDriveRepositoryId, gDriveFileId);
System.debug(String.format('File - name: \'\'{0}\'\', size: {1}, external URL: \'\'{2}\'\', download URL: \'\'{3}\'\'',
new String[]{ file.name, String.valueOf(file.contentSize), file.externalDocumentUrl, file.downloadUrl}));
getRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFileId = 'file:0B0lTys1KmM3sTmxKNjVJbWZja00';
final ConnectApi.RepositoryFileDetail file = ConnectApi.ContentHub.getRepositoryFile(gDriveRepositoryId, gDriveFileId, true);
System.debug(String.format('File - name: \'\'{0}\'\', size: {1}, external URL: \'\'{2}\'\', download URL: \'\'{3}\'\'', new String[]{ file.name, String.valueOf(file.contentSize), file.externalDocumentUrl, file.downloadUrl}));
final ConnectApi.ExternalFilePermissionInformation externalFilePermInfo = file.externalFilePermissionInformation;
//permission types
final List<ConnectApi.ContentHubPermissionType> permissionTypes = externalFilePermInfo.externalFilePermissionTypes;
for(ConnectApi.ContentHubPermissionType permissionType : permissionTypes){
System.debug(String.format('Permission type - id: \'\'{0}\'\', label: \'\'{1}\'\'', new String[]{ permissionType.id, permissionType.label}));
}
//permission groups
final List<ConnectApi.RepositoryGroupSummary> groups = externalFilePermInfo.repositoryPublicGroups;
for(ConnectApi.RepositoryGroupSummary ggroup : groups){
System.debug(String.format('Group - id: \'\'{0}\'\', name: \'\'{1}\'\', type: \'\'{2}\'\'', new String[]{ ggroup.id, ggroup.name, ggroup.type.name()}));
}
getRepositoryFile(communityId, repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFolder(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs';
final ConnectApi.RepositoryFolderDetail folder = ConnectApi.ContentHub.getRepositoryFolder(gDriveRepositoryId, gDriveFolderId);
System.debug(String.format('Folder - name: \'\'{0}\'\', description: \'\'{1}\'\', external URL: \'\'{2}\'\', folder items URL: \'\'{3}\'\'',
new String[]{ folder.name, folder.description, folder.externalFolderUrl, folder.folderItemsUrl}));
getRepositoryFolder(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFolderItems(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs';
final ConnectApi.RepositoryFolderItemsCollection folderItemsColl = ConnectApi.ContentHub.getRepositoryFolderItems(gDriveRepositoryId,gDriveFolderId);
final List<ConnectApi.RepositoryFolderItem> folderItems = folderItemsColl.items;
System.debug('Number of items in repository folder: ' + folderItems.size());
for(ConnectApi.RepositoryFolderItem item : folderItems){
ConnectApi.RepositoryFileSummary fileSummary = item.file;
if(fileSummary != null){
System.debug(String.format('File item - name: \'\'{0}\'\', size: {1}, external URL: \'\'{2}\'\', download URL: \'\'{3}\'\'', new String[]{ fileSummary.name, String.valueOf(fileSummary.contentSize), fileSummary.externalDocumentUrl, fileSummary.downloadUrl}));
}else{
ConnectApi.RepositoryFolderSummary folderSummary = item.folder;
System.debug(String.format('Folder item - name: \'\'{0}\'\', description: \'\'{1}\'\'', new String[]{ folderSummary.name, folderSummary.description}));
}
}
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
updateRepositoryFile(repositoryId, repositoryFileId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs', gDriveFileId = 'document:1q9OatVpcyYBK-JWzp_PhR75ulQghwFP15zhkamKrRcQ';
final ConnectApi.ContentHubItemInput updatedItem = new ConnectApi.ContentHubItemInput();
updatedItem.itemTypeId = 'document'; //see getAllowedTypes for any file item types available for creation/update
updatedItem.fields = new List<ConnectApi.ContentHubFieldValueInput>();
//Metadata: name field
final ConnectApi.ContentHubFieldValueInput fieldValueInputName = new ConnectApi.ContentHubFieldValueInput();
fieldValueInputName.name = 'name';
fieldValueInputName.value = 'updated file name.txt';
updatedItem.fields.add(fieldValueInputName);
final ConnectApi.RepositoryFileDetail updatedFile = ConnectApi.ContentHub.updateRepositoryFile(gDriveRepositoryId, gDriveFileId, updatedItem);
System.debug(String.format('Updated file - id: \'\'{0}\'\', name: \'\'{1}\'\', description: \'\'{2}\'\',\n external URL: \'\'{3}\'\', download URL: \'\'{4}\'\'', new String[]{ updatedFile.id, updatedFile.name, updatedFile.description, updatedFile.externalDocumentUrl, updatedFile.downloadUrl}));
updateRepositoryFile(repositoryId, repositoryFileId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
Example
This example updates the content and name of a file in a Google Drive repository. After the file is updated, we show the file’s ID, name, description, external URL, and download URL.
final String gDriveRepositoryId = '0XCxx00000000ODGAY', gDriveFolderId = 'folder:0B0lTys1KmM3sSVJ2bjIzTGFqSWs', gDriveFileId = 'document:1q9OatVpcyYBK-JWzp_PhR75ulQghwFP15zhkamKrRcQ';
final ConnectApi.ContentHubItemInput updatedItem = new ConnectApi.ContentHubItemInput();
updatedItem.itemTypeId = 'document'; //see getAllowedTypes for any file item types available for creation/update
updatedItem.fields = new List<ConnectApi.ContentHubFieldValueInput>();
//Metadata: name field
final ConnectApi.ContentHubFieldValueInput fieldValueInputName = new ConnectApi.ContentHubFieldValueInput();
fieldValueInputName.name = 'name';
fieldValueInputName.value = 'updated file name.txt';
updatedItem.fields.add(fieldValueInputName);
//Binary content
final Blob updatedFileBlob = Blob.valueOf('even more awesome content for updated file');
final String updatedFileMimeType = 'text/plain';
final ConnectApi.BinaryInput fileBinaryInput = new ConnectApi.BinaryInput(updatedFileBlob, updatedFileMimeType, updatedFileName);
final ConnectApi.RepositoryFileDetail updatedFile = ConnectApi.ContentHub.updateRepositoryFile(gDriveRepositoryId, gDriveFileId, updatedItem);
System.debug(String.format('Updated file - id: \'\'{0}\'\', name: \'\'{1}\'\', description: \'\'{2}\'\',\n external URL: \'\'{3}\'\', download URL: \'\'{4}\'\'', new String[]{ updatedFile.id, updatedFile.name, updatedFile.description, updatedFile.externalDocumentUrl, updatedFile.downloadUrl}));
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Usage
To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.
ContentHub Test Methods
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
setTestAddRepositoryItem(repositoryId, repositoryFolderId, file, result)
API Version
40.0
Signature
public static Void setTestAddRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFolderItem result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- result
- Type: ConnectApi.RepositoryFolderItem
- Object containing test data.
Return Value
Type: Void
setTestAddRepositoryItem(communityId, repositoryId, repositoryFolderId, file, result)
API Version
40.0
Signature
public static Void setTestAddRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFolderItem result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- result
- Type: ConnectApi.RepositoryFolderItem
- Object containing test data.
Return Value
Type: Void
setTestAddRepositoryItem(repositoryId, repositoryFolderId, file, fileData, result)
API Version
40.0
Signature
public static Void setTestAddRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFolderItem result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
- result
- Type: ConnectApi.RepositoryFolderItem
- Object containing test data.
Return Value
Type: Void
setTestAddRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData, result)
API Version
40.0
Signature
public static Void setTestAddRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFolderItem result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
- result
- Type: ConnectApi.RepositoryFolderItem
- Object containing test data.
Return Value
Type: Void
setTestGetAllowedItemTypes(repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubAllowedItemTypeCollection result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.ContentHubAllowedItemTypeCollection
- Object containing test data.
Return Value
Type: Void
setTestGetAllowedItemTypes(repositoryId, repositoryFolderId, filter, result)
API Version
40.0
Signature
public static Void setTestGetAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemType filter, ConnectApi.ContentHubAllowedItemTypeCollection result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
- result
- Type: ConnectApi.ContentHubAllowedItemTypeCollection
- Object containing test data.
Return Value
Type: Void
setTestGetAllowedItemTypes(communityId, repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubAllowedItemTypeCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.ContentHubAllowedItemTypeCollection
- Object containing test data.
Return Value
Type: Void
setTestGetAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter, result)
API Version
40.0
Signature
public static Void setTestGetAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemType filter, ConnectApi.ContentHubAllowedItemTypeCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
- result
- Type: ConnectApi.ContentHubAllowedItemTypeCollection
- Object containing test data.
Return Value
Type: Void
setTestGetFilePreview(repositoryId, repositoryFileId, formatType, result)
API Version
40.0
Signature
public static Void setTestGetFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, ConnectApi.FilePreview result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- result
- Type: ConnectApi.FilePreview
- Object containing test data.
Return Value
Type: Void
setTestGetFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber, result)
API Version
40.0
Signature
public static Void setTestGetFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber, ConnectApi.FilePreview result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
- result
- Type: ConnectApi.FilePreview
- Object containing test data.
Return Value
Type: Void
setTestGetFilePreview(communityId, repositoryId, repositoryFileId, formatType, result)
API Version
40.0
Signature
public static Void setTestGetFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, ConnectApi.FilePreview result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- result
- Type: ConnectApi.FilePreview
- Object containing test data.
Return Value
Type: Void
setTestGetFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber, result)
API Version
40.0
Signature
public static Void setTestGetFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber, ConnectApi.FilePreview result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Jpg—Preview format is JPG.
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig���Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
If you’re concerned that feature-rich SVG previews don’t work in your org, choose alternative file previews. To use JPG file previews, enter general in the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
- result
- Type: ConnectApi.FilePreview
- Object containing test data.
Return Value
Type: Void
setTestGetItemType(repositoryId, repositoryItemTypeId, result)
API Version
40.0
Signature
public static Void setTestGetItemType(String repositoryId, String repositoryItemTypeId, ConnectApi.ContentHubItemTypeDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryItemTypeId
- Type: String
- The ID of the repository item type.
- result
- Type: ConnectApi.ContentHubItemTypeDetail
- Object containing test data.
Return Value
Type: Void
setTestGetItemType(communityId, repositoryId, repositoryItemTypeId, result)
API Version
40.0
Signature
public static Void setTestGetItemType(String communityId, String repositoryId, String repositoryItemTypeId, ConnectApi.ContentHubItemTypeDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryItemTypeId
- Type: String
- The ID of the repository item type.
- result
- Type: ConnectApi.ContentHubItemTypeDetail
- Object containing test data.
Return Value
Type: Void
setTestGetPreviews(repositoryId, repositoryFileId, result)
API Version
40.0
Signature
public static Void setTestGetPreviews(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewCollection result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- result
- Type: ConnectApi.FilePreviewCollection
- Object containing test data.
Return Value
Type: Void
setTestGetPreviews(communityId, repositoryId, repositoryFileId, result)
API Version
40.0
Signature
public static Void setTestGetPreviews(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- result
- Type: ConnectApi.FilePreviewCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositories(result)
API Version
40.0
Signature
public static Void setTestGetRepositories(ConnectApi.ContentHubRepositoryCollection result)
Parameters
- result
- Type: ConnectApi.ContentHubRepositoryCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositories(communityId, result)
API Version
40.0
Signature
public static Void setTestGetRepositories(String communityId, ConnectApi.ContentHubRepositoryCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- result
- Type: ConnectApi.ContentHubRepositoryCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositories(pageParam, pageSize, result)
API Version
40.0
Signature
public static Void setTestGetRepositories(Integer pageParam, Integer pageSize, ConnectApi.ContentHubRepositoryCollection result)
Parameters
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
- result
- Type: ConnectApi.ContentHubRepositoryCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositories(communityId, pageParam, pageSize, result)
API Version
40.0
Signature
public static Void setTestGetRepositories(String communityId, Integer pageParam, Integer pageSize, ConnectApi.ContentHubRepositoryCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
- result
- Type: ConnectApi.ContentHubRepositoryCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepository(repositoryId, result)
API Version
40.0
Signature
public static Void setTestGetRepository(String repositoryId, ConnectApi.ContentHubRepository result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- result
- Type: ConnectApi.ContentHubRepository
- Object containing test data.
Return Value
Type: Void
setTestGetRepository(communityId, repositoryId, result)
API Version
40.0
Signature
public static Void setTestGetRepository(String communityId, String repositoryId, ConnectApi.ContentHubRepository result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- result
- Type: ConnectApi.ContentHubRepository
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFile(repositoryId, repositoryFileId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.RepositoryFileDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFile(String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo, ConnectApi.RepositoryFileDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFile(communityId, repositoryId, repositoryFileId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.RepositoryFileDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFile(String communityId, String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo, ConnectApi.RepositoryFileDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolder(repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolder(String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.RepositoryFolderDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolder(communityId, repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolder(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.RepositoryFolderDetail
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolderItems(repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolderItems(String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderItemsCollection result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.RepositoryFolderItemsCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderItemsCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- result
- Type: ConnectApi.RepositoryFolderItemsCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolderItems(String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize, ConnectApi.RepositoryFolderItemsCollection result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
- result
- Type: ConnectApi.RepositoryFolderItemsCollection
- Object containing test data.
Return Value
Type: Void
setTestGetRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize, result)
API Version
40.0
Signature
public static Void setTestGetRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize, ConnectApi.RepositoryFolderItemsCollection result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
- result
- Type: ConnectApi.RepositoryFolderItemsCollection
- Object containing test data.
Return Value
Type: Void
setTestUpdateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData, result)
API Version
40.0
Signature
public static Void setTestUpdateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFileDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestUpdateRepositoryFile(repositoryId, repositoryFileId, file, result)
API Version
40.0
Signature
public static Void setTestUpdateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFileDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestUpdateRepositoryFile(repositoryId, repositoryFileId, file, fileData, result)
API Version
40.0
Signature
public static Void setTestUpdateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFileDetail result)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void
setTestUpdateRepositoryFile(communityId, repositoryId, repositoryFileId, file, result)
API Version
40.0
Signature
public static Void setTestUpdateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFileDetail result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- result
- Type: ConnectApi.RepositoryFileDetail
- Object containing test data.
Return Value
Type: Void