How to use @scion/workbench-application-platform - 10 common examples

To help you get started, we’ve selected a few @scion/workbench-application-platform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / spec / manifest-registry.spec.ts View on Github external
it('should unregister capability and its implicit intent, but not the implicit intents of wildcard (*) capabilities', fakeAsync(inject([ManifestRegistry], (manifestRegistry: ManifestRegistry) => {
      const type = PlatformCapabilityTypes.View;
      const qualifier1: Qualifier = {entity: 'entity', id: 1};
      const qualifier2: Qualifier = {entity: '*', id: '*'};  // implicit intent of this capability should not be unregistered
      manifestRegistry.registerCapability('app-1', [{type, qualifier: qualifier1, private: false}]);
      manifestRegistry.registerCapability('app-1', [{type, qualifier: qualifier2, private: false}]);

      manifestRegistry.unregisterCapability('app-1', type, qualifier1);
      expect(manifestRegistry.getCapabilitiesByApplication('app-1').length).toBe(1);
      expect(manifestRegistry.getCapabilitiesByType(type).length).toBe(1);
      expect(manifestRegistry.getIntentsByApplication('app-1').length).toBe(1);
      expect(manifestRegistry.getIntentsByApplication('app-1')[0].qualifier).toEqual(qualifier2);
    })));
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / view-capability / view-intent-dispatcher.service.ts View on Github external
private onIntent(envelope: MessageEnvelope): void {
    this._manifestRegistry.getCapabilities(PlatformCapabilityTypes.View, envelope.message.qualifier)
      .filter(capability => this._manifestRegistry.isVisibleForApplication(capability, envelope.sender))
      .forEach((viewCapability: ViewCapability) => {
        const intentMessage: ViewIntentMessage = envelope.message;
        const view = envelope._injector.get(WorkbenchView as Type, null); // TODO [Angular 9]: remove type cast for abstract symbols once 'angular/issues/29905' and 'angular/issues/23611' are fixed

        const matrixParamObject = Url.writeMatrixParamObject({
          matrixParams: Url.substituteParamVariables({...viewCapability.properties.matrixParams, ...intentMessage.payload.matrixParams}, envelope.message.qualifier),
          queryParams: Url.substituteParamVariables({...viewCapability.properties.queryParams, ...intentMessage.payload.queryParams}, envelope.message.qualifier),
        });

        const extras: WbNavigationExtras = {
          activateIfPresent: intentMessage.payload.activateIfPresent,
          closeIfPresent: intentMessage.payload.closeIfPresent,
          selfViewRef: view && view.viewRef,
          blankViewPartRef: view && this._workbench.resolveViewPart(view.viewRef),
          blankInsertionIndex: intentMessage.payload.blankInsertionIndex,
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / activity-capability / view-open-action / view-open-activity-action.component.ts View on Github external
public onClick(event: Event): void {
    event.preventDefault(); // prevent UA to follow 'href'

    const viewIntentMessage: ViewIntentMessage = {
      type: PlatformCapabilityTypes.View,
      qualifier: this.action.properties.qualifier,
      payload: {
        queryParams: this.action.properties.queryParams,
        matrixParams: this.action.properties.matrixParams,
        activateIfPresent: this.action.properties.activateIfPresent,
        closeIfPresent: this.action.properties.closeIfPresent,
      },
    };

    this._messageBus.publishMessageIfQualified({channel: 'intent', message: viewIntentMessage}, this.action.metadata.symbolicAppName, {injector: this._injector});
  }
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application.core / src / lib / popup.service.ts View on Github external
public open(popup: Popup, qualifier: Qualifier): Promise {
    const {top, right, bottom, left, width, height} = popup.anchor.getBoundingClientRect();

    const popupIntentMessage: PopupIntentMessage = {
      type: PlatformCapabilityTypes.Popup,
      qualifier: qualifier,
      payload: {
        queryParams: popup.queryParams,
        matrixParams: popup.matrixParams,
        anchor: {top, right, bottom, left, width, height},
        position: popup.position,
        closeStrategy: popup.closeStrategy,
      },
    };

    return Platform.getService(MessageBus).requestReply({channel: 'intent', message: popupIntentMessage})
      .then(replyEnvelope => replyEnvelope && replyEnvelope.message); // replyEnvelope is 'undefined' on shutdown
  }
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / activity-capability / popup-open-action / popup-open-activity-action.component.ts View on Github external
public onClick(event: Event): void {
    event.preventDefault(); // prevent UA to follow 'href'

    const closeStrategy = this.action.properties.closeStrategy;
    const popupIntentMessage: PopupIntentMessage = {
      type: PlatformCapabilityTypes.Popup,
      qualifier: this.action.properties.qualifier,
      payload: {
        queryParams: this.action.properties.queryParams,
        matrixParams: this.action.properties.matrixParams,
        anchor: (event.target as Element).getBoundingClientRect(),
        position: 'south',
        closeStrategy: {
          onFocusLost: closeStrategy && closeStrategy.onFocusLost,
          onEscape: closeStrategy && closeStrategy.onEscape,
          onGridLayoutChange: closeStrategy && closeStrategy.onGridLayoutChange,
        },
      },
    };

    this._messageBus.requestReply({channel: 'intent', message: popupIntentMessage}, this.action.metadata.symbolicAppName, {injector: this._injector}).then(noop);
  }
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application.core / src / lib / activity.service.ts View on Github external
public getProperties(): Promise {
    return Platform.getService(MessageBus).requestReply({
      channel: 'host',
      message: {type: ActivityHostMessageTypes.PropertiesRead} as HostMessage,
    }).then(envelope => envelope && envelope.message as ActivityProperties || {}); // envelope is 'undefined' on shutdown
  }
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-registry-intent-handler.service.ts View on Github external
// provide fallback for the former 'query' property of manifest commands
    const command = envelope.message.payload.command || envelope.message.payload.query;
    switch (command) {
      case ManifestCommands.FindManifests: {
        this.queryManifests(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindManifest: {
        this.queryManifest(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityProviders: {
        this.queryCapabilityProviders(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityConsumers: {
        this.queryCapabilityConsumers(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapability: {
        this.queryCapability(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilities: {
        this.queryCapabilities(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.RegisterCapability: {
        this.registerCapability(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.UnregisterCapability: {
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-registry-intent-handler.service.ts View on Github external
public onIntent(envelope: MessageEnvelope): void {
    // provide fallback for the former 'query' property of manifest commands
    const command = envelope.message.payload.command || envelope.message.payload.query;
    switch (command) {
      case ManifestCommands.FindManifests: {
        this.queryManifests(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindManifest: {
        this.queryManifest(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityProviders: {
        this.queryCapabilityProviders(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityConsumers: {
        this.queryCapabilityConsumers(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapability: {
        this.queryCapability(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilities: {
        this.queryCapabilities(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.RegisterCapability: {
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-registry-intent-handler.service.ts View on Github external
public onIntent(envelope: MessageEnvelope): void {
    // provide fallback for the former 'query' property of manifest commands
    const command = envelope.message.payload.command || envelope.message.payload.query;
    switch (command) {
      case ManifestCommands.FindManifests: {
        this.queryManifests(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindManifest: {
        this.queryManifest(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityProviders: {
        this.queryCapabilityProviders(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityConsumers: {
        this.queryCapabilityConsumers(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapability: {
        this.queryCapability(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilities: {
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-registry-intent-handler.service.ts View on Github external
public onIntent(envelope: MessageEnvelope): void {
    // provide fallback for the former 'query' property of manifest commands
    const command = envelope.message.payload.command || envelope.message.payload.query;
    switch (command) {
      case ManifestCommands.FindManifests: {
        this.queryManifests(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindManifest: {
        this.queryManifest(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityProviders: {
        this.queryCapabilityProviders(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapabilityConsumers: {
        this.queryCapabilityConsumers(envelope as MessageEnvelope);
        break;
      }
      case ManifestCommands.FindCapability: {

@scion/workbench-application-platform

SCION Workbench Application Platform is an extension of SCION Workbench to integrate content from multiple web applications in a coherent way, thus enabling a micro frontend architecture for allowing different front-end frameworks to co-exist and independ

EPL-2.0
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular @scion/workbench-application-platform functions