com.objectplanet.survey.plugin
Class PluginConstants

java.lang.Object
  extended by com.objectplanet.survey.plugin.PluginConstants

public class PluginConstants
extends java.lang.Object

Constants for plugins

Author:
Irina Brun

Field Summary
static java.lang.String PARAM_CLASS_NAME
          Parameter name: plugin class name
static java.lang.String PARAM_FUNCTION_NO
          Parameter name: function number
static java.lang.String PARAM_ORIGINAL_QUERY_STRING
          Parameter name: original query string, used internal in Opinio to produce the correct default plugin url.
static java.lang.String PARAM_UPLOAD_FILE_NAME
          File name of the first file to upload
static java.lang.String PARAM_UPLOAD_FILE_NAME_1
          File name of the first file to upload
static java.lang.String PARAM_UPLOAD_FILE_NAME_2
          File name of the second file to upload
static java.lang.String PARAM_UPLOAD_FILE_NAME_3
          File name of the third file to upload
static java.lang.String PARAM_UPLOAD_FILE_NAME_4
          File name of the fourth file to upload
static java.lang.String PARAM_UPLOAD_FILE_NAME_BASE
          Name base for files to upload.
static java.lang.String PROPERTIES_PREFIX
          Plugin properties prefix (all properties in the property file start with "plugin"
static java.lang.String PROPERTY_BUILD
          Constant for plugin property: plugin build (property plugin.#PluginClassName#.build from the property file)
static java.lang.String PROPERTY_DOCS
          Constant for plugin property: plugin docs (property plugin.#PluginClassName#.docs from the property file)
static java.lang.String PROPERTY_NAME
          Constant for plugin property: plugin name (property plugin.#PluginClassName#.name from the property file)
static java.lang.String PROPRETY_AUTHOR
          Constant for plugin property: plugin author (property plugin.#PluginClassName#.author from the property file)
static java.lang.String PROPRETY_VERSION
          Constant for plugin property: plugin version (property plugin.#PluginClassName#.version from the property file)
static java.lang.String RESOURCE_HTTP_REQUEST
          Key for the resource of type HttpRequest in the resource map
static java.lang.String RESOURCE_HTTP_RESPONCE
          Deprecated. Use RESOURCE_HTTP_RESPONSE.
static java.lang.String RESOURCE_HTTP_RESPONSE
          Key for the resource of type HttpResponse in the resource map
static java.lang.String RESOURCE_UPLOAD_FILE
          If only a single upload file is needed, you can use this (in conjunction with the form file input element name plugin_uploadFile.
static java.lang.String RESOURCE_UPLOAD_FILES
          Key for the resource of type upload files in the resource map.
static java.lang.String SESSION_ATTRIBUTE_USER_ID
          Constant for session attribute User id.
 
Constructor Summary
PluginConstants()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_HTTP_REQUEST

public static final java.lang.String RESOURCE_HTTP_REQUEST
Key for the resource of type HttpRequest in the resource map

See Also:
Constant Field Values

RESOURCE_HTTP_RESPONSE

public static final java.lang.String RESOURCE_HTTP_RESPONSE
Key for the resource of type HttpResponse in the resource map

See Also:
Constant Field Values

RESOURCE_HTTP_RESPONCE

public static final java.lang.String RESOURCE_HTTP_RESPONCE
Deprecated. Use RESOURCE_HTTP_RESPONSE.
Key for the resource of type HttpResponse in the resource map

See Also:
Constant Field Values

RESOURCE_UPLOAD_FILES

public static final java.lang.String RESOURCE_UPLOAD_FILES
Key for the resource of type upload files in the resource map. The value returned is ArrayList of org.apache.struts.upload.FormFile Usage:
 public ProcessResult processFunctionHTML(int functionNo, HashMap resources) {
        ArrayList uploadFiles = (ArrayList) resources.get(PluginConstants.RESOURCE_UPLOAD_FILES);

        if (uploadFiles.size() > 0) {
                FormFile firstUploadFile = uploadFiles.get(0);
        }
 }

 
IMPORTANT - when creating html for upload files, make sure that files are named as PARAM_UPLOAD_FILE_NAME_1, PARAM_UPLOAD_FILE_NAME_2, .. WARNING: Using multiple upload files does not work with Java 1.8 (and perhaps later). The problem occurs in a third-party library (Struts). Use single-file upload.

See Also:
Constant Field Values

RESOURCE_UPLOAD_FILE

public static final java.lang.String RESOURCE_UPLOAD_FILE
If only a single upload file is needed, you can use this (in conjunction with the form file input element name plugin_uploadFile. Usage:
 public ProcessResult processFunctionHTML(int functionNo, HashMap resources) {
        ArrayList uploadFiles = (ArrayList) resources.get(PluginConstants.RESOURCE_UPLOAD_FILE);

        FormFile formFile = (FormFile) resources.get(PluginConstants.RESOURCE_UPLOAD_FILE);
                        if (formFile != null) {
                                uploadInputStream = formFile.getInputStream();
                        }

 
IMPORTANT - when creating html for upload files, and you only need to upload one file, make sure that the file is named PARAM_UPLOAD_FILE_NAME

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME_BASE

public static final java.lang.String PARAM_UPLOAD_FILE_NAME_BASE
Name base for files to upload. Use PARAM_UPLOAD_FILE_NAME_** if possible.

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME

public static final java.lang.String PARAM_UPLOAD_FILE_NAME
File name of the first file to upload

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME_1

public static final java.lang.String PARAM_UPLOAD_FILE_NAME_1
File name of the first file to upload

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME_2

public static final java.lang.String PARAM_UPLOAD_FILE_NAME_2
File name of the second file to upload

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME_3

public static final java.lang.String PARAM_UPLOAD_FILE_NAME_3
File name of the third file to upload

See Also:
Constant Field Values

PARAM_UPLOAD_FILE_NAME_4

public static final java.lang.String PARAM_UPLOAD_FILE_NAME_4
File name of the fourth file to upload

See Also:
Constant Field Values

PARAM_FUNCTION_NO

public static final java.lang.String PARAM_FUNCTION_NO
Parameter name: function number

See Also:
Constant Field Values

PARAM_CLASS_NAME

public static final java.lang.String PARAM_CLASS_NAME
Parameter name: plugin class name

See Also:
Constant Field Values

PARAM_ORIGINAL_QUERY_STRING

public static final java.lang.String PARAM_ORIGINAL_QUERY_STRING
Parameter name: original query string, used internal in Opinio to produce the correct default plugin url.

See Also:
Constant Field Values

PROPERTIES_PREFIX

public static final java.lang.String PROPERTIES_PREFIX
Plugin properties prefix (all properties in the property file start with "plugin"

See Also:
Constant Field Values

PROPERTY_NAME

public static final java.lang.String PROPERTY_NAME
Constant for plugin property: plugin name (property plugin.#PluginClassName#.name from the property file)

See Also:
Constant Field Values

PROPRETY_VERSION

public static final java.lang.String PROPRETY_VERSION
Constant for plugin property: plugin version (property plugin.#PluginClassName#.version from the property file)

See Also:
Constant Field Values

PROPRETY_AUTHOR

public static final java.lang.String PROPRETY_AUTHOR
Constant for plugin property: plugin author (property plugin.#PluginClassName#.author from the property file)

See Also:
Constant Field Values

PROPERTY_BUILD

public static final java.lang.String PROPERTY_BUILD
Constant for plugin property: plugin build (property plugin.#PluginClassName#.build from the property file)

See Also:
Constant Field Values

PROPERTY_DOCS

public static final java.lang.String PROPERTY_DOCS
Constant for plugin property: plugin docs (property plugin.#PluginClassName#.docs from the property file)

See Also:
Constant Field Values

SESSION_ATTRIBUTE_USER_ID

public static final java.lang.String SESSION_ATTRIBUTE_USER_ID
Constant for session attribute User id. Attribute is set if user is logged in.

See Also:
Constant Field Values
Constructor Detail

PluginConstants

public PluginConstants()

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016