portal-preferences
TypeScript icon, indicating that this package has built-in type declarations

0.0.18 • Public • Published

This is an angular component which enables configuration of an IBM WebSphere Portal scripting portlet by using its preferences REST service.

Display Edit Interface

This will display a text area where the configuration JSON can be modified when the page is in edit mode:

<lib-portlet-preferences class="hide_in_view_mode"></lib-portlet-preferences>

Add this to your component CSS:

.hide_in_view_mode {
  display: none;
}

.edit-mode .hide_in_view_mode {
  display: block;
}

and then ensure your @Component includes encapsulation: ViewEncapsulation.None

Retrieve Values

Inject a service into your component then invoke method to retieve configuration object:

import { PortalPreferencesService } from 'portal-preferences';

...

  constructor(private preferencesService: PortalPreferencesService ) { }

  ngOnInit() {
    // Retrieve portlet preferences
    this.preferencesService.getPreferences().subscribe(
      (prefs: any) => { this.myConfiguration = prefs.someValue; },
      (err) => { console.log(err); }
    );
  }

Package Sidebar

Install

npm i portal-preferences

Weekly Downloads

1

Version

0.0.18

License

none

Unpacked Size

130 kB

Total Files

27

Last publish

Collaborators

  • dsixe