Add the tag "<pf-booking >" to html to use this component. Create Booking Component is used specifically for the booking use case. When using the Booking use case, external metadata (booking detail ) can be passed as input into Booking Component, then a placeholder item is created with metadata specified in the Booking Component layout. External metadata will also be included in the created placeholder item. In this component, the save button and reset buttons are removed from the layout. Saving and resetting layout is done via an actionEvent sent as an input into Booking Component. Below are inputs and outputs of this component.
|
Input |
Description |
Sample Input |
|
auth-service-url |
The url to the identity server authentication service. |
|
|
auth-redirect-url |
When the authentication service authenticated the user, the auth service will redirect to this url. Note: this url must be configured as "redirect url" of auth service. |
http:// localhost:19081/MetadataEditor/ |
|
auth-logout-url |
Logout redirect url of auth service. |
http:// localhost:19081 /MetadataEditor/ |
|
auth-silent-refresh-url |
The silent refresh html that oidc client use to refresh the auth token. |
http:// localhost:19081/silent-refresh.html |
|
metadata-editor-uri |
Currently, the metadata editor does not directly access Vidispine or ConfigPortal api. Instead, requests are made to a proxy "metadata editor host" installed with VidiFlow which then routed to Vidispine or ConfigPortal api. So this is the url of that proxy service. |
http://localhost:19081/Platform.Clients/MetadataEditor/ (backslash needed.) |
|
expected-media-type |
The expected media type when creating placeholder item. Same with the query param "expectedMediaType" when accessing it via iframe. |
video image |
|
header-text |
Text shown in header of MetadataEditor |
Metadata
|
|
hide-search |
Not yet implemented. Can be ignored. |
|
|
object-id |
Item id of the metadata to be edited. Needed when updating metadata. If this value is provided, it will be using update mode. If this value is not provided, the layout will be change to create mode. |
pf://systemname/item/VX-237 |
|
Output |
Description |
Sample |
|
saveClicked |
Triggered when the save button is clicked. |
|
|
placeholderCreated |
When creating item placeholder, this will emit the result whether successful or failed. The structure of the emitted event look like this
|
{ success:: true } { success: false errorMessage: "some error"
|
Sending External Metadata and actionEvent Input
External metadata and actionEvent must be provided via web component property instead of attribute because any input provided via attribute will be converted to string. Below an example of how to provide External Metadata and actionEvent into Booking Component. Note: If a metadata field exists in the Booking Component's Layout but also exists in the external metadata input, external metadata will take precedence and overwrite the value defined in the layout
In template or .html
<pf-booking #editor
[attr.auth-service-url]="authServiceUrl"
[attr.auth-redirect-url]="authRedirectUrl"
[attr.auth-logout-url]="authLogoutUrl"
[attr.auth-silent-refresh-url]="authSilentRefreshUrl"
[attr.metadata-editor-uri]="metadataEditorUri"
...
></pf-booking>
In .ts file
// reference the booking component
@ViewChild('editor') editor: ElementRef;
...
// to provide metadata and create the placeholder item
// provide external metadata to externalMetadata property
this.editor.nativeElement.externalMetadata = [
{
name: 'V3_bookingType',
value: [{
value: 'type1',
}],
}
];
// insert save event for actionEvent to trigger saving
this.editor.nativeElement.actionEvent = {
name: 'save',
};
// insert reset event for actionEvent to reset value in booking component layout
this.editor.nativeElement.actionEvent = {
name: 'resetMetadata',
};