* fix after rebase * new release strategy for ng next Signed-off-by: eromano <eugenioromano16@gmail.com> * peer dep Signed-off-by: eromano <eugenioromano16@gmail.com> * Angular 14 fix unit test and storybook Signed-off-by: eromano <eugenioromano16@gmail.com> fix after rebase Signed-off-by: eromano <eugenioromano16@gmail.com> update pkg.json Signed-off-by: eromano <eugenioromano16@gmail.com> missing dep Signed-off-by: eromano <eugenioromano16@gmail.com> Fix mistake and missing code Dream....build only affected libs Add utility run commands * Use nx command to run affected tests * Fix nx test core fix content tests Run unit with watch false core test fixes reduce test warnings Fix process cloud unit Fix adf unit test Fix lint process cloud Disable lint next line Use right core path Fix insights unit fix linting insights Fix process-services unit fix the extensions test report fix test warnings Fix content unit Fix bunch of content unit * Produce an adf alpha of 14 * hopefully fixing the content * Push back the npm publish * Remove flaky unit * Fix linting * Make the branch as root * Get rid of angualar13 * Remove the travis depth * Fixing version for npm * Enabling cache for unit and build * Fix scss for core and paths Copy i18 and asset by using ng-packager Export the theming alias and fix path Use ng-package to copy assets process-services-cloud Use ng-package to copy assets process-services Use ng-package to copy assets content-services Use ng-package to copy assets insights * feat: fix api secondary entry point * fix storybook rebase * Move dist under dist/libs from lib/dist * Fix the webstyle * Use only necessary nrwl deps and improve lint * Fix unit for libs * Convert lint.sh to targets - improve performance * Use latest of angular * Align alfresco-js-api Signed-off-by: eromano <eugenioromano16@gmail.com> Co-authored-by: eromano <eugenioromano16@gmail.com> Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com> Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
7.1 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Content service | v2.0.0 | Active | 2019-03-13 |
Content service
Accesses app-generated data objects via URLs and file downloads.
Class members
Methods
- createTrustedUrl(blob:
Blob
):string
Creates a trusted object URL from the Blob. WARNING: calling this method with untrusted user data exposes your application to XSS security risks!- blob:
Blob
- Data to wrap into object URL - Returns
string
- URL string
- blob:
- downloadBlob(blob:
Blob
, fileName:string
)
(Deprecated: in 3.2.0, use DownloadService instead. Invokes content download for a Blob with a file name.)- blob:
Blob
- Content to download. - fileName:
string
- Name of the resulting file.
- blob:
- getContentUrl(node:
NodeEntry
|string
, attachment?:boolean
, ticket?:string
):string
Gets a content URL for the given node.- node:
NodeEntry
|string
- Node or Node ID to get URL for. - attachment:
boolean
- (Optional) Toggles whether to retrieve content as an attachment for download - ticket:
string
- (Optional) Custom ticket to use for authentication - Returns
string
- URL string ornull
- node:
- getDocumentThumbnailUrl(node:
NodeEntry
|string
, attachment?:boolean
, ticket?:string
):string
(Deprecated: in 3.2.0, use ThumbnailService instead. Gets a thumbnail URL for the given document node.)- node:
NodeEntry
|string
- Node or Node ID to get URL for. - attachment:
boolean
- (Optional) Toggles whether to retrieve content as an attachment for download - ticket:
string
- (Optional) Custom ticket to use for authentication - Returns
string
- URL string
- node:
- getNode(nodeId:
string
, opts?:any
):Observable
<
NodeEntry
>
Gets a Node via its node ID.- nodeId:
string
- ID of the target node - opts:
any
- (Optional) Options supported by JS-API - Returns
Observable
<
NodeEntry
>
- Details of the folder
- nodeId:
- getNodeContent(nodeId:
string
):Observable
<any>
Gets content for the given node.- nodeId:
string
- ID of the target node - Returns
Observable
<any>
- Content data
- nodeId:
- hasAllowableOperations(node:
Node
, allowableOperation:AllowableOperationsEnum
|string
):boolean
Checks if the user has permissions on that node- node:
Node
- Node to check allowableOperations - allowableOperation:
AllowableOperationsEnum
|string
- Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions - Returns
boolean
- True if the user has the required permissions, false otherwise
- node:
- hasPermissions(node:
Node
, permission:PermissionsEnum
|string
, userId?:string
):boolean
Checks if the user has permission on that node- node:
Node
- Node to check permissions - permission:
PermissionsEnum
|string
- Required permission type - userId:
string
- (Optional) Optional current user id will be taken by default - Returns
boolean
- True if the user has the required permissions, false otherwise
- node:
Details
Use the Content service to deliver data to the user from Blob
objects.
The Blob
class
(implemented in the browser, not ADF) represents an array of bytes that you can
use to construct and store data in any binary format you choose.
The user can access a Blob
either by downloading the byte array as a file or in
some cases by viewing it directly in the browser via a special URL that references
the Blob
. For example, you could use the Blob
interface to construct an image in the
PNG format. Since
PNG is a format the browser can display, you could use the Blob's URL in an
<img> element to view the image within the page. Alternatively, you could let
the user download it as a PNG file.
The downloadBlob
method starts a download of the Blob
data to the filename
within the user's downloads folder. The other downloadXXX
methods do the same
but first convert the supplied data to a Blob
before downloading; see the
Blob reference page
for details of how a Blob's contents are assembled from the constructor arguments.
Use createdTrustedUrl
to generate a URL string for a Blob
. The URL refers to
the Blob
as though it were a file but it is actually an object stored in memory,
so it does not persist across browser sessions. This URL can be used much like any
other, so you could use it for the src
attribute of an <img> element or the
href
of a download link. Note that while the URL is 'trusted', the data it contains
is not necessarily trustworthy unless you can vouch for it yourself; be careful that
the data doesn't expose your app to
Cross Site Scripting
attacks.