Un utilitaire qui aplatit l’arborescence du registre des portlets dans un tableau
# installer avecnpm
npm install @uportal/portlet-registry-to-array
# installer avec yarn
yarn add @uportal/portlet-registry-to-array
installer avec maven
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>uportal__portlet-registry-to-array</artifactId>
<version>{version number goes here}</version>
</dependency>
installer avec gradle
compile 'org.webjars.npm:uportal__portlet-registry-to-array:{version number goes here}'
import { portletRegistryToArray } from '@uportal/portlet-registry-to-array';
// In production this would come over the network
const exampleRegistry = {
registry: {
categories: [
{
name: 'All categories',
description: 'All channel categories',
id: 'local.1',
portlets: [
{
fname: 'courses',
keywords: [],
averageRating: 0,
name: 'Courses',
description: 'Course links and announcements.',
ratingsCount: 0,
typeId: 8,
id: 52,
state: 'PUBLISHED',
title: 'Courses',
parameters: {
mobileIconUrl: {
name: 'mobileIconUrl',
description: '',
value: '/uPortal/media/skins/icons/mobile/courses_alt.png',
},
iconUrl: {
name: 'iconUrl',
description: '',
value:
'/ResourceServingWebapp/rs/tango/0.8.90/32x32/apps/accessories-text-editor.png',
},
configurable: {
name: 'configurable',
description: '',
value: 'true',
},
},
},
],
subcategories: [],
},
],
},
};
const portletList = portletRegistryToArray(exampleRegistry);
console.log(portletList);