/*  Copyright (c) 2000 by Oracle Corporation. All Rights Reserved. */

package oracle.portal.provider.v1.http;

/**
 * A class to store http specific provider related constants.
 */
class HttpProviderConstants extends Object {

    protected static final int ACTION_UNKNOWN = 0;
    protected static final int ACTION_REGISTER_PROVIDER = 1;
    protected static final int ACTION_DEREGISTER_PROVIDER = 2;
    protected static final int ACTION_GET_PORTLETS = 3;
    protected static final int ACTION_GET_PORTLET = 4;
    protected static final int ACTION_IS_PORTLET_RUNNABLE = 5;
    protected static final int ACTION_GET_API_VERSION = 6;
    protected static final int ACTION_REGISTER_PORTLET = 7;
    protected static final int ACTION_DEREGISTER_PORTLET = 8;
    protected static final int ACTION_COPY_PORTLET = 9;
    protected static final int ACTION_INIT_SESSION = 10;
    protected static final int ACTION_SHOW_PORTLET = 11;

    protected static final String ACTIONNAME_REGISTER_PROVIDER = "registerProvider";
    protected static final String ACTIONNAME_DEREGISTER_PROVIDER = "deregisterProvider";
    protected static final String ACTIONNAME_GET_PORTLETS = "getPortletList";
    protected static final String ACTIONNAME_GET_PORTLET = "getPortlet";
    protected static final String ACTIONNAME_IS_PORTLET_RUNNABLE = "isPortletRunnable";
    protected static final String ACTIONNAME_GET_API_VERSION = "getApiVersion";
    protected static final String ACTIONNAME_REGISTER_PORTLET = "registerPortlet";
    protected static final String ACTIONNAME_DEREGISTER_PORTLET = "deregisterPortlet";
    protected static final String ACTIONNAME_COPY_PORTLET = "copyPortlet";
    protected static final String ACTIONNAME_INIT_SESSION = "initSession";
    protected static final String ACTIONNAME_SHOW_PORTLET = "showPortlet";

    protected static final String SOAP_FAULT = "SOAP-ENV:SoapFault";
    protected static final String SOAP_FAULT_CODE = "faultcode";
    protected static final String SOAP_FAULT_STRING = "faultstring";
    protected static final String SOAP_FAULT_DETAIL = "detail";
    protected static final String PORTAL_FAULT_DETAIL = "portal:FaultDetail";
    protected static final String PORTAL_FAULT_MESSAGE = "message";
    protected static final String PORTAL_FAULT_TRACE = "stackTrace";
    protected static final String PORTAL_FAULT_EXT_APP_DETAIL = "externalAppFaultDetail";
    protected static final String PORTAL_FAULT_CALL_SHOW = "providerHandlesUI";

    protected static final int SOAP_FAULT_TYPE_VERSION_MISMATCH = 0;
    protected static final String SOAP_FAULT_VERSION_MISMATCH = "SOAP-ENV:VersionMismatch";
    protected static final String SOAP_FAULT_VERSION_MISMATCH_MSG = "Error: version mismatch";
    protected static final int SOAP_FAULT_TYPE_MUST_UNDERSTAND = 1;
    protected static final String SOAP_FAULT_MUST_UNDERSTAND = "SOAP-ENV:MustUnderstand";
    protected static final String SOAP_FAULT_MUST_UNDERSTAND_MSG = "Error: must understand";
    protected static final int SOAP_FAULT_TYPE_SERVER = 2;
    protected static final String SOAP_FAULT_SERVER = "SOAP-ENV:Server";
    protected static final String SOAP_FAULT_SERVER_MSG = "Error: server";
    protected static final int SOAP_FAULT_TYPE_CLIENT = 3;
    protected static final String SOAP_FAULT_CLIENT = "SOAP-ENV:Client";
    protected static final String SOAP_FAULT_CLIENT_MSG = "Error: client";
    protected static final int SOAP_FAULT_TYPE_AUTH_FAILURE = 4;
    protected static final String SOAP_FAULT_AUTH_FAILURE = "portal:AuthenticationFailure";
    protected static final String SOAP_FAULT_AUTH_FAILURE_MSG = "Error: Failed to authenticate user with external application";
    protected static final int SOAP_FAULT_TYPE_EXT_APP_MAPPING_NOT_FOUND = 5;
    protected static final String SOAP_FAULT_EXT_APP_MAPPING_NOT_FOUND = "portal:ExtAppMappingNotFound";
    protected static final String SOAP_FAULT_EXT_APP_MAPPING_NOT_FOUND_MSG = "Error: External application mapping not found";

    protected static final String ACTION_PARAMETER = "_action";
    protected static final String PROVIDER_PARAMETER = "_provider_id";
    protected static final String PORTLET_PARAMETER = "_portlet_id";
    protected static final String PORTLET_INSTANCE_PARAMETER = "_instance_name";

    // deprecated as of release 3.0.9
    protected static final String USER_PARAMETER = "_user";

    // replaces USER_PARAMETER as of release 3.0.9 onwards
    protected static final String USERNAME_PARAMETER = "_username";

    protected static final String MAPPED_USER_PARAMETER = "_mapped_user";
    protected static final String LOGINTIME_PARAMETER = "_logintime";
    protected static final String SESSIONID_PARAMETER = "_sessionid";
    protected static final String PAGEURL_PARAMETER = "_page_url";
    protected static final String DESIGNURL_PARAMETER = "_design_url";
    protected static final String BACKURL_PARAMETER = "_back_url";
    protected static final String PAGEURL_PARAMETER_OLD = "_back_url";
    protected static final String CUSTOMIZEURL_PARAMETER_OLD = "_current_url";
    protected static final String LOGINURL_PARAMETER = "_login_url";
    protected static final String HAS_TITLE_PARAMETER = "_has_title";
    protected static final String RENDER_MODE_PARAMETER = "_render_mode";
    protected static final String HAS_BORDER_PARAMETER = "_border";
    protected static final String AUTHENTICATION_LEVEL_PARAMETER = "_auth_level";

    protected static final String SUBSCRIBER_ID_PARAMETER = "_subscriber_id";
    protected static final String COMPANY_NAME_PARAMETER = "_company_name";

    protected static final String PORTALCFG_FLAG_PARAMETER = "_portal_config";
    protected static final String PORTAL_VERSION_PARAMETER = "_portal_version";

    // Passed on from the PPE in a show request and used to pass logging 
    // information back to the user.
    protected static final String DEBUG_PARAMETER = "_debug";
    // The following may be sent as headers as well as or instead of parameters
    // in the request url.  x-oracle-cache-user and x-oracle-cache-auth will
    // be used as part of a user specific cache key for middle tier caching as of
    // portal 9.0.3.
    // x-oracle-cache-mapped-user  will be sent as a header since it is user
    // specific, but not used as a cache key.
    protected static final String USER_HEADER = "x-oracle-cache-user";
    protected static final String MAPPED_USER_HEADER = "x-oracle-cache-mapped-user";
    protected static final String AUTH_LEVEL_HEADER = "x-oracle-cache-auth";

    protected static final String PROVIDER_ID_ELEMENT = "providerId";
    protected static final String PORTLET_ID_ELEMENT = "portletId";
    protected static final String PORTLET_COPYFROM_INSTANCE_ELEMENT = "portletFrom";
    protected static final String PORTLET_COPYTO_INSTANCE_ELEMENT = "portletTo";
    protected static final String PORTLET_INSTANCE_ELEMENT = "portletInstance";
    protected static final String PORTLET_INSTANCE_NAME_ELEMENT = "instanceName";
    protected static final String PORTLET_LANGUAGE_ELEMENT = "language";

    protected static final String PROVIDER_USER_ELEMENT = "user";

    // deprecated as of release 3.0.9
    protected static final String PROVIDER_USER_NAME_ELEMENT = "name";

    // replaces PROVIDER_USER_NAME_ELEMENT in release 3.0.9 onwards
    protected static final String PROVIDER_USERID_ELEMENT = "username";
    
    protected static final String PROVIDER_USER_MAPPED_NAME_ELEMENT = "mappedName";
    protected static final String PROVIDER_LOGIN_TIME_ELEMENT = "loginTime";
    protected static final String PROVIDER_SESSION_ID_ELEMENT = "sessionId";
    protected static final String PROVIDER_AUTHENTICATION_LEVEL_ELEMENT = "authLevel";

    protected static final String SUBSCRIBER_ID_ELEMENT = "subscriberId";
    protected static final String COMPANY_NAME_ELEMENT = "companyName";
    protected static final String PORTAL_VERSION_ELEMENT = "portalVersion";

    // ExternalApp tags passed in initSession
    protected static final String PROVIDER_EXTERNAL_APP_ELEMENT = "externalApp";
    protected static final String PROVIDER_EXTERNAL_APP_USERNAME_ELEMENT = "name";
    protected static final String PROVIDER_EXTERNAL_APP_PASSWORD_ELEMENT = "password";
    protected static final String PROVIDER_EXTERNAL_APP_USER_FIELD = "authUserField";
    protected static final String PROVIDER_EXTERNAL_APP_PASS_FIELD = "authPassField";
    protected static final String PROVIDER_EXTERNAL_APP_AUTH_URL = "authURL";
    protected static final String PROVIDER_EXTERNAL_APP_AUTH_METHOD = "authMethod";
    protected static final String PROVIDER_EXTERNAL_APP_FIELD_ARRAY_ELEMENT = "applicationFields";
    protected static final String PROVIDER_EXTERNAL_APP_FIELD_ELEMENT = "applicationField";
    protected static final String PROVIDER_EXTERNAL_APP_FIELD_NAME_ELEMENT = "name";
    protected static final String PROVIDER_EXTERNAL_APP_FIELD_VALUE_ELEMENT = "value";

    protected static final String PORTLET_RANGE_ELEMENT = "range";
    protected static final String PORTLET_RANGE_START_ELEMENT = "start";
    protected static final String PORTLET_RANGE_COUNT_ELEMENT = "count";
    protected static final String PORTLET_BY_USER_ELEMENT = "byUser";


    protected static final String HTTP_GET_METHOD = "GET";
    protected static final String HTTP_POST_METHOD = "POST";
    protected static final String HTTP_ACCEPT_LANGUAGE = "Accept-Language";
    protected static final String HTTP_ACCEPT_CHARSET = "Accept-Charset";
    protected static final String HTTP_DEFAULT_CHARSET = "iso8859-1";
    protected static final String HTTP_ACCEPT_CONTENT_TYPE = "Accept";
    protected static final String HTTP_CONTENT_TYPE = "Content-Type";
    protected static final String HTTP_CONTENT_LANGUAGE = "Content-Language";
    protected static final String HTTP_PORTAL_CONTENT_CHARSET = "x-oracle-portal-content-charset";
    protected static final String HTTP_FORM_DATA_CONTENT_TYPE = "application/x-www-form-urlencoded";

    // Initialisation parameters
    protected static final String PROVIDER_DEBUG_LEVEL = "debuglevel";
    protected static final String SERVLET_SESSION_TIMEOUT = "sessiontimeout";
    protected static final String INIT_PORTLET_TIMEOUT = "portletTimeout";
    protected static final String INIT_PORTLET_KILL_TIMEOUT = "portletKillTimeout";

    protected static final String PROVIDER_API_VERSION = "1.0";

    protected static final String PORTLET_INFOLIST_TAG = "portletInfoList";
    protected static final String PORTLET_INFO_TAG = "portletInfo";
    protected static final String PORTLET_ID_TAG = "id";
    protected static final String PROVIDER_ID_TAG = "providerId";
    protected static final String PORTLET_NAME_TAG = "name";
    protected static final String PORTLET_TITLE_TAG = "title";
    protected static final String PORTLET_DESCRIPTION_TAG = "description";
    protected static final String PORTLET_IMAGEURL_TAG = "imageUrl";
    protected static final String PORTLET_THUMBNAILURL_TAG = "thumbnailUrl";
    protected static final String PORTLET_HELPURL_TAG = "helpUrl";
    protected static final String PORTLET_TIMEOUT_TAG = "timeout";
    protected static final String PORTLET_TIMEOUT_MSG_TAG = "timeoutMsg";
    protected static final String PORTLET_HAS_SHOW_EDIT_TAG = "showEdit";
    protected static final String PORTLET_HAS_SHOW_EDIT_PUBLIC_TAG = "showEditToPublic";
    protected static final String PORTLET_HAS_SHOW_EDIT_DEFAULT_TAG = "showEditDefault";
    protected static final String PORTLET_HAS_SHOW_PREVIEW_TAG = "showPreview";
    protected static final String PORTLET_HAS_SHOW_DETAILS_TAG = "showDetails";
    protected static final String PORTLET_HAS_HELP_TAG = "hasHelp";
    protected static final String PORTLET_HAS_ABOUT_TAG = "hasAbout";
    protected static final String PORTLET_CREATE_DATE_TAG = "createdOn";
    protected static final String PORTLET_CREATE_BY_TAG = "createdBy";
    protected static final String PORTLET_UPDATE_DATE_TAG = "updatedOn";
    protected static final String PORTLET_UPDATE_BY_TAG = "updatedBy";
    protected static final String PORTLET_DEFAULT_LOCALE_TAG = "defaultLocale";
    //Added for mobile support.  Portlet interface extension 1
    protected static final String PORTLET_HAS_SHOW_LINK_TAG = "showLinkMode";
    protected static final String PORTLET_CALL_IS_RUNNABLE_TAG = "callIsRunnable";
    protected static final String PORTLET_CALL_GET_PORTLET_TAG = "callGetPortlet";
    //Added for PortletXtra2
    protected static final String PORTLET_MOBILE_FLAGS_TAG = "mobileFlags";
    protected static final String PORTLET_SHORT_TITLE_TAG = "shortTitle";


    protected static final String PORTLET_ACCEPT_CONTENT_TYPES_TAG = "acceptContentTypes";
    protected static final String PORTLET_CTYPES_ITEM_TAG = "item";

    protected static final String PORTLET_PARAMETERS_TAG = "inputParameters";
    protected static final String PORTLET_PARAMETER_TAG = "parameter";
    protected static final String PORTLET_PARAMETER_NAME_TAG = "name";
    protected static final String PORTLET_PARAMETER_TYPE_TAG = "type";
    protected static final String PORTLET_PARAMETER_DESCRIPTION_TAG = "description";

    protected static final String IS_RUNNABLE_TAG = "isRunnable";
    protected static final String VERSION_TAG = "version";
    protected static final String TIMEOUT_TAG = "sessionTimeout";

    protected static final String SUBSCRIBER_ID_TAG = "subscriberId";
    protected static final String SUBSCRIBER_KEY_TAG = "encryptionKey";

    protected static final String ARRAY_TYPE_PORTLET_INFOS = "portletInfo";
    protected static final String ARRAY_TYPE_STRING = "string";
    protected static final String ARRAY_TYPE_PARAMETERS = "inputParameter";

    // String constants particular to iAS Wireless request data
    // iAS Wireless overwrites the accept header and places the original in another
    protected static final String IASWIRELESS_ORIGINAL_ACCEPT_HEADER = "X-Oracle-Orig-Accept";
    protected static final String IASWIRELESS_ORIGINAL_USERAGENT_HEADER = "X-Oracle-Orig-User-Agent";

    // iAS Wireless sends basic device characteristics in these header fields.
    protected static final String DEVICE_CLASS_HEADER = "X-Oracle-Device.Class";

    protected static final String DEVICE_ORIENTATION_HEADER = "X-Oracle-Device.Orientation";

    // maximum size of response? Spec says value in bytes?  Should this be unicode characters?
    protected static final String DEVICE_MAXDOCSIZE_HEADER = "X-Oracle-Device.MaxDocSize";

    // Indicates (as boolean value) whether the connection from the client device is secure
    protected static final String DEVICE_SECURE_HEADER = "X-Oracle-Device.Secure";

    // IASWireless location information passed in mobile request headers.
    protected static final String IASWIRELESS_USER_LOCATION_COMPANY_HEADER = "X-Oracle-User.Location.Companyname";
    protected static final String IASWIRELESS_USER_LOCATION_ADDRESSLINE1_HEADER = "X-Oracle-User.Location.AddressLine1";
    protected static final String IASWIRELESS_USER_LOCATION_ADDRESSLINE2_HEADER = "X-Oracle-User.Location.AddressLine2";
    protected static final String IASWIRELESS_USER_LOCATION_ADDRESSLASTLINE_HEADER = "X-Oracle-User.Location.AddressLastLine";
    protected static final String IASWIRELESS_USER_LOCATION_BLOCK_HEADER = "X-Oracle-User.Location.Block";
    protected static final String IASWIRELESS_USER_LOCATION_CITY_HEADER = "X-Oracle-User.Location.City";
    protected static final String IASWIRELESS_USER_LOCATION_COUNTY_HEADER = "X-Oracle-User.Location.County";
    protected static final String IASWIRELESS_USER_LOCATION_STATE_HEADER = "X-Oracle-User.Location.State";
    protected static final String IASWIRELESS_USER_LOCATION_POSTALCODE_HEADER = "X-Oracle-User.Location.PostalCode";
    protected static final String IASWIRELESS_USER_LOCATION_POSTALCODEEXT_HEADER = "X-Oracle-User.Location.PostalCodeExt";
    protected static final String IASWIRELESS_USER_LOCATION_COUNTRY_HEADER = "X-Oracle-User.Location.Country";
    protected static final String IASWIRELESS_USER_LOCATION_TIME_HEADER = "X-Oracle-User.Location.Time";
    protected static final String IASWIRELESS_USER_LOCATION_TYPE_HEADER = "X-Oracle-User.Location.Type";
    protected static final String IASWIRELESS_USER_LOCATION_TIMESINCE_HEADER = "X-Oracle-User.Location.TimeSinceLastUpdate";
    protected static final String IASWIRELESS_USER_LOCATION_X_HEADER = "X-Oracle-User.Location.X";
    protected static final String IASWIRELESS_USER_LOCATION_Y_HEADER = "X-Oracle-User.Location.Y";





}
