Class AbstractDescribableScriptPlugin

  • All Implemented Interfaces:
    Describable
    Direct Known Subclasses:
    BaseScriptPlugin, ScriptPluginResourceModelSourceFactory

    public abstract class AbstractDescribableScriptPlugin
    extends java.lang.Object
    implements Describable
    AbstractDescribableScriptPlugin is a base ScriptPlugin provider implementation that can be used to provide a describable interface for a script plugin. The description provided by the base implementation is configured by the ScriptPluginProvider's metadata:
         title = Title of the Plugin
         description = Description of the plugin
     
         config.X.PROPERTY_TYPE = Type name of the property, from Property.Type
         config.X.name = Name of the property (key string)
         config.X.title = Title of the property
         config.X.description = description of the property
         config.X.required = true/false, if the property is required.
         config.X.default = default string of the property
         config.X.values = comma-separated values list for Select or FreeSelect properties
         config.X.scope = scope of the property, from PropertyScope
     
    • Method Detail

      • createPluginData

        public java.util.Map<java.lang.String,​java.lang.String> createPluginData()
        Returns:
        data with exported plugin details
      • loadInstanceDataFromNodeAttributes

        protected java.util.Map<java.lang.String,​java.lang.Object> loadInstanceDataFromNodeAttributes​(INodeEntry node,
                                                                                                            Description description)
        Map node attributes as instance configuration values based on property descriptions. If a property has a rendering option key of StringRenderingConstants.INSTANCE_SCOPE_NODE_ATTRIBUTE_KEY then use the value of that option as the node attribute name to use.
        Parameters:
        node - node
        description - plugin description
        Returns:
        instance config data
      • loadConfigData

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> loadConfigData​(ExecutionContext context,
                                                                                                                              java.util.Map<java.lang.String,​java.lang.Object> instanceData,
                                                                                                                              java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> localDataContext,
                                                                                                                              Description description,
                                                                                                                              java.lang.String serviceName)
                                                                                                                       throws ConfigurationException
        Loads the plugin configuration values stored in project or framework properties, also
        Parameters:
        context - execution context
        localDataContext - current context data
        description - plugin description
        instanceData - instance data
        serviceName - service name
        Returns:
        context data with a new "config" entry containing the loaded plugin config properties.
        Throws:
        ConfigurationException - configuration error
      • loadContentConversionPropertyValues

        protected void loadContentConversionPropertyValues​(java.util.Map<java.lang.String,​java.lang.String> data,
                                                           ExecutionContext context,
                                                           java.util.List<Property> pluginProperties)
                                                    throws ConfigurationException
        Looks for properties with content conversion, and converts the values
        Parameters:
        data - map of values for config properties
        context - execution context
        pluginProperties - definition of plugin properties
        Throws:
        ConfigurationException
      • isAllowCustomProperties

        public abstract boolean isAllowCustomProperties()
        Returns:
        true if the script-plugin allows custom configuration properties defined in plugin metadata.
      • isUseConventionalPropertiesMapping

        public boolean isUseConventionalPropertiesMapping()
        Returns:
        true to provide conventional mapping from config properties to framework/project properties.
      • getFramework

        public Framework getFramework()