...
The explanation above only describes how to create a Monitoring Dashboard plugin but does not cover how to develop your own indicator set(s). That is done entirely in Java. See the wmaxmfindicators
bundle for an example of how to create your own custom indicators. As a starting point you should implement an XMFIndicatorProvider
that enables the registration of your custom indicators. See the file DefaultIndicatorsServiceImpl.java
in wmaxmfindicators
. Refer to the Javadoc for wmaxmfapi
in the wm-addon-monitoring
package for the interfaces offered by the framework.
...
Developing Custom Bulk Actions
...
Code Block | ||
---|---|---|
| ||
private ServiceComponentDefinitionImpl getExportToExcelFactoryComponent() { ServiceComponentDefinitionImpl definition = new ServiceComponentDefinitionImpl(false); definition.setId(WCBConstants.EXPORT_TO_EXCEL_FACTORY_COMPONENT_ID); definition.setName(WCBConstants.EXPORT_TO_EXCEL_FACTORY_COMPONENT_NAME); definition.setDescription(WCBConstants.EXPORT_TO_EXCEL_FACTORY_COMPONENT_DESCRIPTION); definition.setTypeId(ServiceComponentType.class.getName()); definition.setProperties(new Hashtable<>()); definition.setImplementationClassName(ExportToExcelBulkActionFactoryImpl.class.getName()); definition.setInterfaceClassNames(new String[]{ExportToExcelFactory.class.getName()}); setRequiredDependencies(definition, ExcelService.class, BulkActionService.class); return definition; } |
...
Custom Media Items and the Is Used in Widget
Anchor | ||||
---|---|---|---|---|
|
...
Panel | ||||
---|---|---|---|---|
| ||||
The following applies to XperienCentral versions R29 and higher. |
Panel | ||||
---|---|---|---|---|
| ||||
The following applies to XperienCentral versions 10.22.0 and higher. |
The Is Used In widget shows an overview of content items that are using the currently selected content item. Before XperienCentral 10.22.0, the usage of content items referring to a custom content type was not detected for content items from a custom content type, The widget would only show a count of 0 used content items. The API of several content items in XperienCentral has been extended with a method for implementing this used-in relationship for custom content types. This functionality is available via the new abstract method:
...
Code Block | ||
---|---|---|
| ||
package com.gxwebmanager.helloworld.helloworldpagemetadata.pagemetadata; import java.util.Collections; import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; import nl.gx.webmanager.cms.core.RelatedDownloadLink; import nl.gx.webmanager.cms.core.RelatedInternalLink; import nl.gx.webmanager.cms.core.RelatedLink; import nl.gx.webmanager.cms.core.RelatedMediaItemLink; import nl.gx.webmanager.cms.core.RelatedResourceLink; import nl.gx.webmanager.cms.mediarepository.MediaItemDownloadVersion; import nl.gx.webmanager.services.contentdomain.api.ContentDomainException; import nl.gx.webmanager.services.contentdomain.api.ContentDomainResolver; import nl.gx.webmanager.services.contentindex.adapter.FieldAdapter; import nl.gx.webmanager.services.framework.spi.FrameworkException; import nl.gx.webmanager.services.framework.spi.FrameworkFactory; /** * Adapter that takes a content item, and returns a String-reference to it, e.g. page-32423. Logs * a warning and returns null if the given item could not be resolved. * * @see ContentDomainResolver */ public class ContentReferenceFieldAdapter implements FieldAdapter<Object> { private static final Logger LOG = Logger.getLogger(ContentReferenceFieldAdapter.class.getName()); @Override public boolean isLanguageSpecific() { return false; } @Override public Object adapt(Object item, Locale forLocale) { if (item == null) { return null; } if (item instanceof RelatedLink) { return adaptLinkReference(item, forLocale); } return getItemId(item); } private String getItemId(Object item) { try { ContentDomainResolver resolver = (ContentDomainResolver) FrameworkFactory.getInstance().getFramework().getService(ContentDomainResolver.class.getName()); return resolver.entityToId(item); } catch (FrameworkException | ContentDomainException e) { LOG.log(Level.WARNING, "Failed to retrieve content reference for " + item, e); } return null; } private Object adaptLinkReference(Object link, Locale forLocale) { if (link instanceof RelatedInternalLink) { return adapt(((RelatedInternalLink) link).getPage(), forLocale); } else if (link instanceof RelatedMediaItemLink) { return adapt(((RelatedMediaItemLink) link).getMediaItem(), forLocale); } else if (link instanceof RelatedDownloadLink) { MediaItemDownloadVersion downloadVersion = ((RelatedDownloadLink) link).getInContextDownloadMediaItemDownloadVersion(); if (downloadVersion != null) { String itemId = getItemId(downloadVersion.getContentItem()); if (itemId != null) { return Collections.singletonMap("download", itemId); } } } else if (link instanceof RelatedResourceLink) { return adapt(((RelatedResourceLink) link).getResourceInstance(), forLocale); } return null; } } |
...
Credentials Service Provider
...