|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.accpac.sm.Program
@ThreadSafe public class Program
Represents an authenticated program with the Sage Accpac System Manager.
The caller must call the dispose
method when finished with
the object so that all its resources can be released. The caller must not
call any other method on the object after calling dispose.
getErrors()
the errors will be a mix from the two
threads.Field Summary | |
---|---|
java.lang.Object |
userData
A single hook where the application can hook data in. |
Constructor Summary | |
---|---|
Program(Session session,
java.lang.String appID,
java.lang.String programName,
java.lang.String appVersion)
Complete constructor. |
Method Summary | |
---|---|
void |
dispose()
Closes and releases all resources used by the object. |
protected void |
finalize()
overrides the finalize method of object so that the dispose gets called if it hasn't already |
ActiveApplications |
getActiveApplications()
Gets the list of active applications on the program The list contains the applications active at the time of the call; changes (e.g. |
java.lang.String |
getAppID()
Gets the application ID of the current application. |
java.lang.String |
getAppVersion()
Gets the version of the current application. |
Company |
getCompany()
Gets a Company object that stores details of the company profile as set up in Common Services |
java.io.File |
getCompanyDirectory(java.lang.String area)
returns a File that is the location where the given area can store
its company-specific files. |
java.util.List<java.lang.String> |
getDisplayableIcons(java.lang.String appID,
java.lang.String appVersion,
java.util.List<Icon> iconsToCheckDisplay)
get a non-null list of icons that are displayable based on the given application's icon display logic. |
Errors |
getErrors()
Gets a reference to the program's errors collection. |
FiscalCalendar |
getFiscalCalendar()
Gets a FiscalCalendar object that provides methods to access the fiscal calendar set up in the company. |
java.lang.String[] |
getInstalledReports(java.lang.String appID)
Retrieves a list of reports installed in the system for the supplied application ID. |
Meter |
getMeter()
Gets any meter anonymously attached to the Program |
Multiuser |
getMultiuser()
Gets the Multiuser object that contains methods for controlling multi-user access. |
java.io.File |
getProgramFilesDirectory(java.lang.String area)
returns a File that is the location where the given area has
stored its resource files. |
java.lang.String |
getProgramName()
gets the program name (Roto ID) of the current application. |
PropertyBag |
getPropertyBag()
Returns a new PropertyBag for the program's inherited menu |
PropertyBag |
getPropertyBag(java.lang.String menuID)
Returns a new PropertyBag for the specified menu of the program |
java.lang.String |
getRscString(java.lang.String pgmID,
int strID)
Gets the given string resource for the specified application. |
Session |
getSession()
Gets the Program's session |
java.io.File |
getUserCompanyDirectory(java.lang.String area)
returns a File that is the location where the given area can store
its files that are specific to both a user and a company. |
java.io.File |
getUserDirectory(java.lang.String area)
returns a File that is the location where the given area can store
its user-specific files. |
boolean |
isPermitted(java.lang.String resource)
returns whether or not the user is permitted to access the given security recource. |
DBLink |
openDBLink(DBLink.LinkType type,
DBLink.LinkFlags flags)
Creates a database link to the specified database. |
View |
openView(java.lang.String viewID)
opens a view. |
View |
openView(java.lang.String viewID,
int modes,
int prefetch,
int directives)
opens a view. |
java.lang.Object[] |
paramGet(java.lang.String viewID,
int... fieldIDs)
Retrieves a list of parameters stored in a view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.Object userData
Constructor Detail |
---|
public Program(Session session, java.lang.String appID, java.lang.String programName, java.lang.String appVersion)
session
- the session under which this program is openedappID
- the application id of this ProgramprogramName
- the name by which this program is to be knownappVersion
- the version of this applicationMethod Detail |
---|
public void dispose()
public ActiveApplications getActiveApplications()
public java.lang.String getAppID()
public java.lang.String getAppVersion()
public Company getCompany()
public java.io.File getCompanyDirectory(java.lang.String area)
File
that is the location where the given area can store
its company-specific files.
The File returned is a directory that exists and is both readable and writable.
The caller may lay out the directory any way that it chooses.
For consistency if the caller has files that are specific to both a user
and a company then use the getUserCompanyDirectory(String)
.
area
- the area whose files are wanted. Remember to use consistent case
for the area name since different operating systems may be
case-sensitive.
File
that is the location where the given area may store
its company-specific files.getUserCompanyDirectory(String)
,
getUserDirectory(String)
,
getProgramFilesDirectory(String)
public final java.util.List<java.lang.String> getDisplayableIcons(java.lang.String appID, java.lang.String appVersion, java.util.List<Icon> iconsToCheckDisplay)
appID
- the application IDappVersion
- the application versioniconsToCheckDisplay
- the list of icons to be checked whether they are displayable.
public Errors getErrors()
errors
collection. Note
that this returns a shared reference; the Errors collection can change in
the background. It does not return the current list of errors.
public FiscalCalendar getFiscalCalendar()
public java.lang.String[] getInstalledReports(java.lang.String appID)
appID
- Application ID.
public Meter getMeter()
public Multiuser getMultiuser()
public PropertyBag getPropertyBag()
public PropertyBag getPropertyBag(java.lang.String menuID)
menuID
- See the
PropertyBag constructor
.public java.io.File getProgramFilesDirectory(java.lang.String area)
File
that is the location where the given area has
stored its resource files.
The File returned is a directory that exists and is at least readable.
area
- the area whose files are wanted. Remember to use consistent case
for the area name since different operating systems may be
case-sensitive.
File
that is the location where the given area has
stored its resource files.getCompanyDirectory(String)
,
getUserDirectory(String)
,
getUserCompanyDirectory(String)
public java.lang.String getProgramName()
public java.lang.String getRscString(java.lang.String pgmID, int strID)
pgmID
- String containing the two-character application prefix of the
application. The application prefix can be in lower or upper
case.strID
- Numeric identifier of the particular text resource to fetch
public Session getSession()
public java.io.File getUserCompanyDirectory(java.lang.String area)
File
that is the location where the given area can store
its files that are specific to both a user and a company.
The File returned is a directory that exists and is both readable and writable.
The caller may lay out the directory any way that it chooses.
area
- the area whose files are wanted. Remember to use consistent case
for the area name since different operating systems may be
case-sensitive.
File
that is the location where the given area may store
its user-company-specific files.getCompanyDirectory(String)
,
getUserDirectory(String)
,
getProgramFilesDirectory(String)
public java.io.File getUserDirectory(java.lang.String area)
File
that is the location where the given area can store
its user-specific files.
The File returned is a directory that exists and is both readable and writable.
The caller may lay out the directory any way that it chooses.
For consistency if the caller has files that are specific to both a user
and a company then use the getUserCompanyDirectory(String)
.
area
- the area whose files are wanted. Remember to use consistent case
for the area name since different operating systems may be
case-sensitive.
File
that is the location where the given area may store
its company-specific files.getCompanyDirectory(String)
,
getUserCompanyDirectory(String)
,
getProgramFilesDirectory(String)
public boolean isPermitted(java.lang.String resource)
resource
- the name of the resource to be checked. This must consist of
only ASCII printable characters and may be at most 10 characters
long.
public DBLink openDBLink(DBLink.LinkType type, DBLink.LinkFlags flags)
dispose
on the link when finished
with it.
type
- specifies the type of database link to create.flags
- specified the type of access intended on the database link.
public View openView(java.lang.String viewID, int modes, int prefetch, int directives)
If the view is not one of the standard Sage Accpac views and is a view on
the system database then use DBLink's
openView(...)
viewID
- the rotoid (e.g. BK0001) of the view. This must be six
characters long once trimmed.modes
- an integer value containing a set of flags that control
behaviour. See View.OpenModes
.prefetch
- the number of records to pre-fetch when the view is opened (0 to
63)directives
- specifies how the view should be used. See
View.OpenDirectives
. public View openView(java.lang.String viewID)
If the view is not one of the standard Sage Accpac views and is a view on
the system database then use DBLink's
openView(...)
viewID
- Roto ID of the view to open. The Roto ID is defined by the
application.
public java.lang.Object[] paramGet(java.lang.String viewID, int... fieldIDs)
This method is applicable only to views that are designed to store parameters of an application. These views typically have one and only one record. Internally, this method opens the specified view, fetches the first record, and returns the values of the specified field IDs.
In a networked environment, this method is more efficient than manually opening a view, fetching and obtaining field values, since this method only takes one network call and all processing is done on the server.
viewID
- Roto ID of the view to retrieve the parametersfieldIDs
- An array of field IDs where the parameters should be retrieved
protected void finalize()
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |