com.sage.orion.sdata.servlet.accpac
Class AccpacHelper

java.lang.Object
  extended by com.sage.orion.sdata.servlet.accpac.AccpacHelper

public final class AccpacHelper
extends java.lang.Object

Accpac-specific constants and helpers


Field Summary
static java.lang.String AME_ABBREVIATION
          the preferred namespace abbreviation for the Accpac Metadata Extensions
static java.lang.String AME_AUTOPOST_TAG
           
static java.lang.String AME_CUSTOM
           
static java.lang.String AME_DISABLED
          the disabled attribute
static java.lang.String AME_RECORD_NUMBER
          this is a special field that contains the system-generated record number for each entry
static java.lang.String AME_SET_INITIALLY
           
static int ERRNUM_SUCCESS
          Standard Accpac view return codes.
static int ERRNUM_WARNING
           
static java.lang.String METADATA_EXTENSIONS
          the namespace for the Accpac Metadata Extensions
static java.lang.String SCHEMA_NAMESPACE
          the namespace used for the accpac schemas
static java.lang.String SDATA_LANGUAGE_UPGRADE_SM_FIRST_FORMAT
           
static java.lang.String SDATA_LANGUAGE_VERSION
          The version passed to the LanguageResource methods for Accpac SData strings
static java.lang.String SDATA_LANGUAGE_WARN_TRUNCATED_FORMAT
          The id of the language resource that is the format to use to form a message about truncating input
static java.lang.String SDATA_MSG_CS_LICENSE_MISSING
           
static java.lang.String SDATA_RECORDNUMBER_TITLE
           
 
Method Summary
static java.lang.String convertMask(org.slf4j.Logger logger, java.lang.String accpacMask)
          method that receive the accpac mask as input and generates the xsd pattern as output for the input mask.
static boolean errnumIsSuccess(int errnum)
          Determine whether the return code from a view call was successful or not
static void logAndClearErrors(org.slf4j.Logger logger, com.sage.accpac.sm.Errors accpacErrors)
          log any errors on the Accpac error stack and then clean the error stack.
static java.util.List<SDataDiagnosis> logAndMoveErrors(org.slf4j.Logger logger, com.sage.accpac.sm.Errors accpacErrors)
          log and remove the Accpac errors from the given Accpac error stack and returns the errors messages (in the form of a list of SDataDiagnosis).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_NAMESPACE

public static final java.lang.String SCHEMA_NAMESPACE
the namespace used for the accpac schemas

See Also:
Constant Field Values

METADATA_EXTENSIONS

public static final java.lang.String METADATA_EXTENSIONS
the namespace for the Accpac Metadata Extensions

See Also:
Constant Field Values

AME_ABBREVIATION

public static final java.lang.String AME_ABBREVIATION
the preferred namespace abbreviation for the Accpac Metadata Extensions

See Also:
Constant Field Values

AME_DISABLED

public static final java.lang.String AME_DISABLED
the disabled attribute

See Also:
Constant Field Values

AME_CUSTOM

public static final java.lang.String AME_CUSTOM
See Also:
Constant Field Values

AME_AUTOPOST_TAG

public static final java.lang.String AME_AUTOPOST_TAG
See Also:
Constant Field Values

AME_SET_INITIALLY

public static final java.lang.String AME_SET_INITIALLY
See Also:
Constant Field Values

AME_RECORD_NUMBER

public static final java.lang.String AME_RECORD_NUMBER
this is a special field that contains the system-generated record number for each entry

See Also:
Constant Field Values

SDATA_LANGUAGE_VERSION

public static final java.lang.String SDATA_LANGUAGE_VERSION
The version passed to the LanguageResource methods for Accpac SData strings

See Also:
Constant Field Values

SDATA_LANGUAGE_WARN_TRUNCATED_FORMAT

public static final java.lang.String SDATA_LANGUAGE_WARN_TRUNCATED_FORMAT
The id of the language resource that is the format to use to form a message about truncating input

See Also:
Constant Field Values

SDATA_LANGUAGE_UPGRADE_SM_FIRST_FORMAT

public static final java.lang.String SDATA_LANGUAGE_UPGRADE_SM_FIRST_FORMAT
See Also:
Constant Field Values

SDATA_MSG_CS_LICENSE_MISSING

public static final java.lang.String SDATA_MSG_CS_LICENSE_MISSING
See Also:
Constant Field Values

SDATA_RECORDNUMBER_TITLE

public static final java.lang.String SDATA_RECORDNUMBER_TITLE
See Also:
Constant Field Values

ERRNUM_SUCCESS

public static final int ERRNUM_SUCCESS
Standard Accpac view return codes. This list is not complete. Please refer to view.h for a complete list of return codes.

See Also:
Constant Field Values

ERRNUM_WARNING

public static final int ERRNUM_WARNING
See Also:
Constant Field Values
Method Detail

logAndClearErrors

public static void logAndClearErrors(org.slf4j.Logger logger,
                                     com.sage.accpac.sm.Errors accpacErrors)
log any errors on the Accpac error stack and then clean the error stack.

Parameters:
logger - the logger
accpacErrors - the Accpac program's errors collection

logAndMoveErrors

public static java.util.List<SDataDiagnosis> logAndMoveErrors(org.slf4j.Logger logger,
                                                              com.sage.accpac.sm.Errors accpacErrors)
log and remove the Accpac errors from the given Accpac error stack and returns the errors messages (in the form of a list of SDataDiagnosis).

Parameters:
logger - the logger
accpacErrors - the Accpac program's errors collection
Returns:
The list of errors converted to an SDataDiagnosis object.

convertMask

public static java.lang.String convertMask(org.slf4j.Logger logger,
                                           java.lang.String accpacMask)
method that receive the accpac mask as input and generates the xsd pattern as output for the input mask.

The Accpac Mask is defined in the Accpac for Windows: Accpac Software Development Kit CA-Custom Controls.

Parameters:
logger - a logger that can be used to log messages that are for the administrators
accpacMask - the accpac format mask to convert
Returns:
xsdPattern for the input mask

errnumIsSuccess

public static boolean errnumIsSuccess(int errnum)
Determine whether the return code from a view call was successful or not

Parameters:
errnum - the return code of the view call
Returns:
true if view call succeeded, false otherwise


Copyright © 2011 Sage Software, Inc. All rights reserved.