ContentHub Class
Access Files Connect repositories and their files and folders.
These methods are for ContentHub. All methods are static.
Use ContentHub methods to work with Files Connect repositories.
-
addRepositoryItem(repositoryId, repositoryFolderId, file)
Add a repository item.
-
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file)
Add a repository item in an Experience Cloud site.
-
addRepositoryItem(repositoryId, repositoryFolderId, file, fileData)
Add a repository item, including the binary file.
-
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData)
Add a repository item, including the binary file, in an Experience Cloud site.
-
getAllowedItemTypes(repositoryId, repositoryFolderId)
Get the item types that the context user is allowed to create in the repository folder.
-
getAllowedItemTypes(repositoryId, repositoryFolderId, filter)
Get the item types, filtered by type, that the context user is allowed to create in the repository folder.
-
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId)
Get the item types that the context user is allowed to create in the repository folder in an Experience Cloud site.
-
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter)
Get the item types, filtered by type, that the context user is allowed to create in the repository folder in an Experience Cloud site.
-
getFilePreview(repositoryId, repositoryFileId, formatType)
Get a repository file preview.
-
getFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
Get a page or page range of a repository file preview.
-
getFilePreview(communityId, repositoryId, repositoryFileId, formatType)
Get a repository file preview in an Experience Cloud site.
-
Get a page or page range of a repository file preview in an Experience Cloud site.
-
getItemType(repositoryId, repositoryItemTypeId)
Get information about an item type associated with a repository.
-
getItemType(communityId, repositoryId, repositoryItemTypeId)
Get information about an item type associated with a repository in an Experience Cloud site.
-
getPreviews(repositoryId, repositoryFileId)
Get information about a repository file’s supported previews.
-
getPreviews(communityId, repositoryId, repositoryFileId)
Get information about a repository file’s supported previews in an Experience Cloud site.
-
Get a list of repositories.
-
Get a list of repositories in an Experience Cloud site.
-
getRepositories(pageParam, pageSize)
Get a page of repositories.
-
getRepositories(communityId, pageParam, pageSize)
Get a page of repositories in an Experience Cloud site.
-
Get a repository.
-
getRepository(communityId, repositoryId)
Get a repository in an Experience Cloud site.
-
getRepositoryFile(repositoryId, repositoryFileId)
Get a repository file.
-
getRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
Get a repository file with or without permissions information.
-
getRepositoryFile(communityId, repositoryId, repositoryFileId)
Get a repository file in an Experience Cloud site.
-
getRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
Get a repository file with or without permissions information in an Experience Cloud site.
-
getRepositoryFolder(repositoryId, repositoryFolderId)
Get a repository folder.
-
getRepositoryFolder(communityId, repositoryId, repositoryFolderId)
Get a repository folder in an Experience Cloud site.
-
getRepositoryFolderItems(repositoryId, repositoryFolderId)
Get repository folder items.
-
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId)
Get repository folder items in an Experience Cloud site.
-
getRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize)
Get a page of repository folder items.
-
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize)
Get a page of repository folder items in an Experience Cloud site.
-
updateRepositoryFile(repositoryId, repositoryFileId, file)
Update the name of a repository file.
-
updateRepositoryFile(repositoryId, repositoryFileId, file, fileData)
Update the content of a repository file.
-
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file)
Update the name of a repository file in an Experience Cloud site.
-
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData)
Update the content of a repository file in an Experience Cloud site.
Add a repository item.
39.0
No
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
Type: ConnectApi.RepositoryFolderItem
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.
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.
See Also
- setTestAddRepositoryItem(repositoryId, repositoryFolderId, file, result)
- Apex Developer Guide: Testing ConnectApi Code
Add a repository item in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
Type: ConnectApi.RepositoryFolderItem
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.
See Also
- setTestAddRepositoryItem(communityId, repositoryId, repositoryFolderId, file, result)
- Apex Developer Guide: Testing ConnectApi Code
Add a repository item, including the binary file.
39.0
No
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
Type: ConnectApi.RepositoryFolderItem
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.
This example creates a file with binary content and metadata in a Google Drive repository folder. After the file is created, we show the file’s ID, name, description, external URL, and download URL.
See Also
- setTestAddRepositoryItem(repositoryId, repositoryFolderId, file, fileData, result)
- Apex Developer Guide: Testing ConnectApi Code
Add a repository item, including the binary file, in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
Type: ConnectApi.RepositoryFolderItem
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.
See Also
- setTestAddRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the item types that the context user is allowed to create in the repository folder.
39.0
No
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.ContentHubAllowedItemTypeCollection
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.
See Also
- setTestGetAllowedItemTypes(repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the item types, filtered by type, that the context user is allowed to create in the repository folder.
39.0
No
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
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.
Type: ConnectApi.ContentHubAllowedItemTypeCollection
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.
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.
See Also
- setTestGetAllowedItemTypes(repositoryId, repositoryFolderId, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the item types that the context user is allowed to create in the repository folder in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.ContentHubAllowedItemTypeCollection
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.
See Also
- setTestGetAllowedItemTypes(communityId, repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the item types, filtered by type, that the context user is allowed to create in the repository folder in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
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.
Type: ConnectApi.ContentHubAllowedItemTypeCollection
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.
See Also
- setTestGetAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file preview.
39.0
No
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
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:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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.
Type: ConnectApi.FilePreview
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.
This example calls getFilePreview(repositoryId, repositoryFileId, ConnectApi.FilePreviewFormat.Thumbnail) to get the thumbnail format preview along with its respective URL and number of thumbnail renditions. For each thumbnail format, we show every rendition URL available.
See Also
- setTestGetFilePreview(repositoryId, repositoryFileId, formatType, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page or page range of a repository file preview.
39.0
No
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin 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.
Type: ConnectApi.FilePreview
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.
See Also
- setTestGetFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file preview in an Experience Cloud site.
39.0
No
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.
Type: ConnectApi.FilePreview
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.
See Also
- setTestGetFilePreview(communityId, repositoryId, repositoryFileId, formatType, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page or page range of a repository file preview in an Experience Cloud site.
39.0
No
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin 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.
Type: ConnectApi.FilePreview
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.
See Also
- setTestGetFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber, result)
- Apex Developer Guide: Testing ConnectApi Code
Get information about an item type associated with a repository.
39.0
No
public static ConnectApi.ContentHubItemTypeDetail getItemType(String repositoryId, String repositoryItemTypeId)
- repositoryId
Type: String
The ID of the repository.
- repositoryItemTypeId
Type: String
The ID of the repository item type.
Type: ConnectApi.ContentHubItemTypeDetail
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.
See Also
- setTestGetItemType(repositoryId, repositoryItemTypeId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get information about an item type associated with a repository in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubItemTypeDetail getItemType(String communityId, String repositoryId, String repositoryItemTypeId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryItemTypeId
Type: String
The ID of the repository item type.
Type: ConnectApi.ContentHubItemTypeDetail
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.
See Also
- setTestGetItemType(communityId, repositoryId, repositoryItemTypeId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get information about a repository file’s supported previews.
39.0
No
public static ConnectApi.FilePreviewCollection getPreviews(String repositoryId, String repositoryFileId)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
Type: ConnectApi.FilePreviewCollection
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.
This example gets all supported preview formats and their respective URLs and number of renditions. For each supported preview format, we show every rendition URL available.
See Also
- setTestGetPreviews(repositoryId, repositoryFileId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get information about a repository file’s supported previews in an Experience Cloud site.
39.0
No
public static ConnectApi.FilePreviewCollection getPreviews(String communityId, String repositoryId, String repositoryFileId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
Type: ConnectApi.FilePreviewCollection
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.
See Also
- setTestGetPreviews(communityId, repositoryId, repositoryFileId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a list of repositories.
39.0
No
public static ConnectApi.ContentHubRepositoryCollection getRepositories()
Type: ConnectApi.ContentHubRepositoryCollection
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.
This example gets all repositories and gets the first SharePoint online repository found.
See Also
Get a list of repositories in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.
Type: ConnectApi.ContentHubRepositoryCollection
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.
See Also
Get a page of repositories.
39.0
No
public static ConnectApi.ContentHubRepositoryCollection getRepositories(Integer pageParam, Integer pageSize)
- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.
Type: ConnectApi.ContentHubRepositoryCollection
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.
See Also
Get a page of repositories in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.
Type: ConnectApi.ContentHubRepositoryCollection
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.
See Also
- setTestGetRepositories(communityId, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository.
369.0
No
public static ConnectApi.ContentHubRepository getRepository(String repositoryId)
- repositoryId
Type: String
The ID of the repository.
Type: ConnectApi.ContentHubRepository
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.
See Also
Get a repository in an Experience Cloud site.
39.0
No
public static ConnectApi.ContentHubRepository getRepository(String communityId, String repositoryId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
Type: ConnectApi.ContentHubRepository
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.
See Also
- setTestGetRepository(communityId, repositoryId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file.
39.0
No
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestGetRepositoryFile(repositoryId, repositoryFileId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file with or without permissions information.
39.0
No
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
- 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.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestGetRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestGetRepositoryFile(communityId, repositoryId, repositoryFileId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository file with or without permissions information in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestGetRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository folder.
39.0
No
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String repositoryId, String repositoryFolderId)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.RepositoryFolderDetail
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.
See Also
- setTestGetRepositoryFolder(repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a repository folder in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String communityId, String repositoryId, String repositoryFolderId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.RepositoryFolderDetail
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.
See Also
- setTestGetRepositoryFolder(communityId, repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get repository folder items.
39.0
No
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.RepositoryFolderItemsCollection
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.
This example gets the collection of items in a repository folder. For files, we show the file’s name, size, external URL, and download URL. For folders, we show the folder’s name, description, and external URL.
See Also
- setTestGetRepositoryFolderItems(repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get repository folder items in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
Type: ConnectApi.RepositoryFolderItemsCollection
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.
See Also
- setTestGetRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of repository folder items.
39.0
No
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
- 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
nullor 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.
Type: ConnectApi.RepositoryFolderItemsCollection
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.
See Also
- setTestGetRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of repository folder items in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 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.
Type: ConnectApi.RepositoryFolderItemsCollection
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.
See Also
- setTestGetRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Update the name of a repository file.
39.0
No
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
Type: ConnectApi.RepositoryFileDetail
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.
This example updates the name of a file in a Google Drive repository. After the file is updated, we show the file’s ID, name, description, external URL, download URL.
See Also
- setTestUpdateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData, result)
- Apex Developer Guide: Testing ConnectApi Code
Update the content of a repository file.
39.0
No
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe 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.BinaryInputThe binary file.
Type: ConnectApi.RepositoryFileDetail
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.
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.
See Also
- setTestUpdateRepositoryFile(repositoryId, repositoryFileId, file, result)
- Apex Developer Guide: Testing ConnectApi Code
Update the name of a repository file in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
When updating the metadata of a repository file, only the name field can be updated.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestUpdateRepositoryFile(repositoryId, repositoryFileId, file, fileData, result)
- Apex Developer Guide: Testing ConnectApi Code
Update the content of a repository file in an Experience Cloud site.
39.0
No
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe 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.BinaryInputThe binary file.
Type: ConnectApi.RepositoryFileDetail
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.
See Also
- setTestUpdateRepositoryFile(communityId, repositoryId, repositoryFileId, file, result)
- Apex Developer Guide: Testing ConnectApi Code
These test methods are for ContentHub. All methods are static.
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
Register a ConnectApi.RepositoryFolderItem object to be returned when the matching addRepositoryItem(repositoryId, repositoryFolderId, file) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestAddRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFolderItem result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- result
Type:
ConnectApi.RepositoryFolderItemObject containing test data.
Type: Void
See Also
- addRepositoryItem(repositoryId, repositoryFolderId, file)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItem object to be returned when the matching addRepositoryItem(communityId, repositoryId, repositoryFolderId, file) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestAddRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFolderItem result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- result
Type:
ConnectApi.RepositoryFolderItemObject containing test data.
Type: Void
See Also
- addRepositoryItem(communityId, repositoryId, repositoryFolderId, file)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItem object to be returned when the matching addRepositoryItem(repositoryId, repositoryFolderId, file, fileData) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestAddRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFolderItem result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
- result
Type:
ConnectApi.RepositoryFolderItemObject containing test data.
Type: Void
See Also
- addRepositoryItem(repositoryId, repositoryFolderId, file, fileData)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItem object to be returned when the matching addRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestAddRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFolderItem result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
- result
Type:
ConnectApi.RepositoryFolderItemObject containing test data.
Type: Void
See Also
- addRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ContentHubAllowedItemTypeCollection object to be returned when the matching getAllowedItemTypes(repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubAllowedItemTypeCollection result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.ContentHubAllowedItemTypeCollectionObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubAllowedItemTypeCollection object to be returned when the matching getAllowedItemTypes(repositoryId, repositoryFolderId, filter) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemType filter, ConnectApi.ContentHubAllowedItemTypeCollection result)
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.
Type: Void
See Also
- getAllowedItemTypes(repositoryId, repositoryFolderId, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ContentHubAllowedItemTypeCollection object to be returned when the matching getAllowedItemTypes(communityId, repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubAllowedItemTypeCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.ContentHubAllowedItemTypeCollectionObject containing test data.
Type: Void
See Also
- getAllowedItemTypes(communityId, repositoryId, repositoryFolderId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ContentHubAllowedItemTypeCollection object to be returned when the matching getAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemType filter, ConnectApi.ContentHubAllowedItemTypeCollection result)
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.
Type: Void
See Also
- getAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FilePreview object to be returned when the matching getFilePreview(repositoryId, repositoryFileId, formatType) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, ConnectApi.FilePreview result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.- result
Type:
ConnectApi.FilePreviewObject containing test data.
Type: Void
See Also
- getFilePreview(repositoryId, repositoryFileId, formatType)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FilePreview object to be returned when the matching getFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber, ConnectApi.FilePreview result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin 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.FilePreviewObject containing test data.
Type: Void
See Also
- getFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FilePreview object to be returned when the matching getFilePreview(communityId, repositoryId, repositoryFileId, formatType) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, ConnectApi.FilePreview result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin the Quick Find box in Setup. Select General Settings, and then select Display alternative file previews.- result
Type:
ConnectApi.FilePreviewObject containing test data.
Type: Void
See Also
- getFilePreview(communityId, repositoryId, repositoryFileId, formatType)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FilePreview object to be returned when the matching getFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber, ConnectApi.FilePreview result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- formatType
Type:
ConnectApi.FilePreviewFormatSpecifies the format of the file preview. Values are:
Audio—Preview format is MP3.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.Video—Preview format is MP4.
PDF previews are available for files of type DOC, DOCX, PPT, PPTX, TEXT, XLS, and XLSX. SVG files are generated on demand.
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
generalin 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.FilePreviewObject containing test data.
Type: Void
See Also
- getFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ContentHubItemTypeDetail object to be returned when the matching getItemType(repositoryId, repositoryItemTypeId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetItemType(String repositoryId, String repositoryItemTypeId, ConnectApi.ContentHubItemTypeDetail result)
- repositoryId
Type: String
The ID of the repository.
- repositoryItemTypeId
Type: String
The ID of the repository item type.
- result
Type:
ConnectApi.ContentHubItemTypeDetailObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubItemTypeDetail object to be returned when the matching getItemType(communityId, repositoryId, repositoryItemTypeId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetItemType(String communityId, String repositoryId, String repositoryItemTypeId, ConnectApi.ContentHubItemTypeDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryItemTypeId
Type: String
The ID of the repository item type.
- result
Type:
ConnectApi.ContentHubItemTypeDetailObject containing test data.
Type: Void
See Also
- getItemType(communityId, repositoryId, repositoryItemTypeId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FilePreviewCollection object to be returned when the matching getPreviews(repositoryId, repositoryFileId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetPreviews(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewCollection result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- result
Type:
ConnectApi.FilePreviewCollectionObject containing test data.
Type: Void
See Also
Register a ConnectApi.FilePreviewCollection object to be returned when the matching getPreviews(communityId, repositoryId, repositoryFileId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetPreviews(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- result
Type:
ConnectApi.FilePreviewCollectionObject containing test data.
Type: Void
See Also
- getPreviews(communityId, repositoryId, repositoryFileId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ContentHubRepositoryCollection object to be returned when the matching getRepositories() method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositories(ConnectApi.ContentHubRepositoryCollection result)
- result
Type:
ConnectApi.ContentHubRepositoryCollectionObject containing test data.
Type: Void
See Also
Register a getRepositories(communityId) object to be returned when the matching ConnectApi.ContentHubRepositoryCollection method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositories(String communityId, ConnectApi.ContentHubRepositoryCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- result
Type:
ConnectApi.ContentHubRepositoryCollectionObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubRepositoryCollection object to be returned when the matching getRepositories(pageParam, pageSize) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositories(Integer pageParam, Integer pageSize, ConnectApi.ContentHubRepositoryCollection result)
- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.ContentHubRepositoryCollectionObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubRepositoryCollection object to be returned when the matching getRepositories(communityId, pageParam, pageSize) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositories(String communityId, Integer pageParam, Integer pageSize, ConnectApi.ContentHubRepositoryCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.ContentHubRepositoryCollectionObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubRepository object to be returned when the matching getRepository(repositoryId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepository(String repositoryId, ConnectApi.ContentHubRepository result)
- repositoryId
Type: String
The ID of the repository.
- result
Type:
ConnectApi.ContentHubRepositoryObject containing test data.
Type: Void
See Also
Register a ConnectApi.ContentHubRepository object to be returned when the matching getRepository(communityId, repositoryId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepository(String communityId, String repositoryId, ConnectApi.ContentHubRepository result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- result
Type:
ConnectApi.ContentHubRepositoryObject containing test data.
Type: Void
See Also
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching getRepositoryFile(repositoryId, repositoryFileId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.RepositoryFileDetail result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching getRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFile(String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo, ConnectApi.RepositoryFileDetail result)
- 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.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- getRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching getRepositoryFile(communityId, repositoryId, repositoryFileId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.RepositoryFileDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- getRepositoryFile(communityId, repositoryId, repositoryFileId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching getRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFile(String communityId, String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo, ConnectApi.RepositoryFileDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- getRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderDetail object to be returned when the matching getRepositoryFolder(repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolder(String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderDetail result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.RepositoryFolderDetailObject containing test data.
Type: Void
See Also
Register a ConnectApi.RepositoryFolderDetail object to be returned when the matching getRepositoryFolder(communityId, repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolder(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.RepositoryFolderDetailObject containing test data.
Type: Void
See Also
- getRepositoryFolder(communityId, repositoryId, repositoryFolderId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItemsCollection object to be returned when the matching getRepositoryFolderItems(repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolderItems(String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderItemsCollection result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.RepositoryFolderItemsCollectionObject containing test data.
Type: Void
See Also
- getRepositoryFolderItems(repositoryId, repositoryFolderId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItemsCollection object to be returned when the matching getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.RepositoryFolderItemsCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFolderId
Type: String
The ID of the repository folder.
- result
Type:
ConnectApi.RepositoryFolderItemsCollectionObject containing test data.
Type: Void
See Also
- getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItemsCollection object to be returned when the matching getRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolderItems(String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize, ConnectApi.RepositoryFolderItemsCollection result)
- 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
nullor 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.RepositoryFolderItemsCollectionObject containing test data.
Type: Void
See Also
- getRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFolderItemsCollection object to be returned when the matching getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestGetRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize, ConnectApi.RepositoryFolderItemsCollection result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 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.RepositoryFolderItemsCollectionObject containing test data.
Type: Void
See Also
- getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching updateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestUpdateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFileDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- updateRepositoryFile(repositoryId, repositoryFileId, file)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching updateRepositoryFile(repositoryId, repositoryFileId, file) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestUpdateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFileDetail result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- updateRepositoryFile(repositoryId, repositoryFileId, file, fileData)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching updateRepositoryFile(repositoryId, repositoryFileId, file, fileData) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestUpdateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData, ConnectApi.RepositoryFileDetail result)
- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- fileData
Type:
ConnectApi.BinaryInputThe binary file.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also
- updateRepositoryFile(communityId, repositoryId, repositoryFileId, file)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RepositoryFileDetail object to be returned when the matching updateRepositoryFile(communityId, repositoryId, repositoryFileId, file) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestUpdateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.RepositoryFileDetail result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- repositoryId
Type: String
The ID of the repository.
- repositoryFileId
Type: String
The ID of the repository file.
- file
Type:
ConnectApi.ContentHubItemInputThe item type ID and fields of the item type.
- result
Type:
ConnectApi.RepositoryFileDetailObject containing test data.
Type: Void
See Also