Interface ExtensionParameters

    • Method Detail

      • getParameter

        String getParameter​(String name)
        Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

        You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

        If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.

        If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via ExtensionPointHttpServletRequest.getInputStream() or ExtensionPointHttpServletRequest.getReader() can interfere with the execution of this method.

        Parameters:
        name - a String specifying the name of the parameter
        Returns:
        a String representing the single value of the parameter
        See Also:
        getParameterValues(java.lang.String)
      • getParameterNames

        RWIterable<String> getParameterNames()
        Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.
        Specified by:
        getParameterNames in interface ExtensionParametersComp
        Returns:
        an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters
      • getParameterValues

        String[] getParameterValues​(String name)
        Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

        If the parameter has a single value, the array has a length of 1.

        Parameters:
        name - a String containing the name of the parameter whose value is requested
        Returns:
        an array of String objects containing the parameter's values
        See Also:
        getParameter(java.lang.String)
      • getParameterMap

        Map<String,​String[]> getParameterMap()
        Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.
        Returns:
        an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
      • getContextSource

        String getContextSource()
        The source of the action. See SOURCE_XXX constants for possible values.
        Returns:
        the source
      • getContextRequestType

        String getContextRequestType()
        The type of this request. See REQUESTTYPE_XXX constants for possible values. For Extension Points that can have multiple calls for the same Extension (e.g. EditPage), it indicates what request type is being made.
        Returns:
        the type of the request
      • getContextURL

        String getContextURL()
        URL of the Cronacle system where the action comes from
        Returns:
        the url
      • getContextIsolationGroup

        String getContextIsolationGroup()
        Get the isolation group of the user executing the action
        Returns:
        the name of the isolation group
      • getContextSubjectFields

        Map<String,​String> getContextSubjectFields()
        Get the fields that were send over that identify the subject that executed the action. The keys contain the names of the fields, the values are the values of those fields
        Returns:
        a map that contain key value pairs that make up the subject
      • getExtensionName

        String getExtensionName()
        The name of the extension that got executed
        Returns:
        the name of the extension
      • getExtensionType

        String getExtensionType()
        What was the type of the extension the user executes. Only valid when ContextSource is ToolBar
        Returns:
        Basic for global toolbar Extension, Object for an object related Extension
      • getExtensionObjectType

        String getExtensionObjectType()
        What was the objecttype of the page where the user executed the Extension. Not set when ExtensionType == Basic
        Returns:
        the ObjectType
      • getInvocationFieldName

        String getInvocationFieldName()
        Since each invocation of the Extension Point stores its data separately from other invocations, this id must be added to the request made from the client back to the server to guarantee retrieving the same data. This is the field name that must be used
        Returns:
        the field name that must be used for sending the invocation ID
      • getInvocationID

        String getInvocationID()
        Since each invocation of the Extension Point stores its data separately from other invocations, this id must be added to the request made from the client back to the server to guarantee retrieving the same data.
        Returns:
        the invocation ID
      • getOutput

        String getOutput()
        Where is the output going to be rendered to.
        Returns:
        "popup" or "tabpage", or null when not set.
      • getObjectCount

        int getObjectCount()
        return the number of objects that are present in the parameters
        Returns:
        the number of objects present, or 0 if there are none.
      • getObjectType

        String getObjectType​(int index)
        Return the object type of the object at position index
        Parameters:
        index - of the object
        Returns:
        the object type
        Throws:
        IndexOutOfBoundsException
      • getObject

        Map<String,​String> getObject​(int index)
        Get a map of key value pairs for the object at index. The values send over is determined by the DeploymentDescriptor. UniqueId is always send over. The key contains a concatenation of field type and name. Use getObjectFieldType() and getObjectFieldName() to get the different parts.
        Parameters:
        index - of the object requested
        Returns:
        a map with key value pairs for the object
        Throws:
        IndexOutOfBoundsException
      • getObjectFieldType

        char getObjectFieldType​(String key)
        The keys returned by getObject() contain extra information. This method returns what the type of the field is.
        Parameters:
        key - to return the type for
        Returns:
        the type of the field
      • getObjectFieldName

        String getObjectFieldName​(String key)
        The keys returned by getObject() contain extra information. This method returns what the name of the field is.
        Parameters:
        key - to reutrn the name for
        Returns:
        the name of the field
      • getObjectFieldValue

        Object getObjectFieldValue​(int index,
                                   char type,
                                   String name,
                                   com.redwood.scheduler.api.model.SchedulerSession session)
        Return the value of a given field by name and type. The value will be converted to the type that it was originally
        Parameters:
        index - of the object
        type - of the field, must match original type when it was encoded
        name - of the field requested
        session - used to retrieve scheduler entities
        Returns:
        the value of the field as the type it originally was.
        Throws:
        IndexOutOfBoundsException
      • getConstantNames

        Set<String> getConstantNames()
        Get the names of the constants that are present in this request. Constants are defined in the deployment descriptor as parameters of type constant. They are part of the parameters for an object send over. however, if there are no objects available, then this method can be used to retrieve the constants.
        Returns:
        the Set of names for the defined constants, or an empty set when there are no constants present.
      • getConstantValue

        String getConstantValue​(String name)
        Get the value of the constant with the given name. Constants are defined in the deployment descriptor as parameters of type constant. They are part of the parameters for an object send over. however, if there are no objects available, then this method can be used to retrieve the constants.
        Parameters:
        name - of the constant to retrieve.
        Returns:
        the value for the given constant, or null of the constant is not present in the request.
      • isMultiPartRequest

        boolean isMultiPartRequest()
        Is the request that these parameters belong to a multipart/form-data request. Only when this method returns true can the methods getPart(String name) and getParts() be called.
        Returns:
        true when this is a multipart/from-data request, false otherwise
      • getPart

        Part getPart​(String name)
              throws IOException,
                     IllegalStateException
        Get the part for the given parameter name. It will return the part for both files and regular parameters.
        Parameters:
        name - of the part to return
        Returns:
        the part for the given name, or null when the part name could not be found
        Throws:
        IOException
        IllegalStateException - when this is not a multipart/form-data request