|
||||||||||
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
Deprecated. |
Constructor Summary | |
---|---|
Program(Session session,
java.lang.String appID,
java.lang.String programName,
java.lang.String appVersion)
Complete constructor. |
Method Summary | |
---|---|
void |
dispose()
call this when the instance is no longer required, to free up resources. |
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 for the current company; this value is cached so 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. |
IPropertyBag |
getIPropertyBag()
Returns an IPropertyBag for the program's inherited menu |
IPropertyBag |
getIPropertyBag(java.lang.String menuID)
Returns an IPropertyBag for the specified menu of the program |
ISession |
getISession()
Gets the Program's session |
Licenses |
getLicenses()
Get the list of licenses on the program The list contains the licenses presented at the time of the call; changes after this call are not reflected in the returned collection. |
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.lang.Object |
getParam(java.lang.String viewID,
int field)
Retrieves a parameter stored in a view. |
GettableByField |
getParams(java.lang.String viewID)
gets a GettableByField that exposes the parameters of the given
view. |
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 an PropertyBag for the program's inherited menu |
PropertyBag |
getPropertyBag(java.lang.String menuID)
Returns an IPropertyBag 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()
returns 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 resource. |
DBLink |
openDBLink(DBLink.LinkType type,
DBLink.LinkFlags flags)
Creates a database link to the specified database. |
IView |
openIView(java.lang.String viewID)
opens a view |
IView |
openIView(java.lang.String viewID,
int modes,
int prefetch,
int directives)
opens a view. |
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@Deprecated public java.lang.Object userData
Deprecated - Subclass the program
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()
NullPointerException
if this has already
been called.
dispose
in interface HasDispose
public java.lang.String toString()
toString
in class java.lang.Object
public ActiveApplications getActiveApplications()
getActiveApplications
in interface IProgram
ActiveApplications
listing the active applicationspublic Licenses getLicenses()
getLicenses
in interface IProgram
Licenses
collection.public java.lang.String getAppID()
getAppID
in interface IProgram
public java.lang.String getAppVersion()
getAppVersion
in interface IProgram
public Company getCompany()
The returned object represents the state at the time of this call.
getCompany
in interface HasCompany
Company
representing the company profile.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 IProgram.getUserCompanyDirectory(String)
.
getCompanyDirectory
in interface IProgram
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.IProgram.getUserCompanyDirectory(String)
,
IProgram.getUserDirectory(String)
,
IProgram.getProgramFilesDirectory(String)
public final java.util.List<java.lang.String> getDisplayableIcons(java.lang.String appID, java.lang.String appVersion, java.util.List<Icon> iconsToCheckDisplay)
getDisplayableIcons
in interface IProgram
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.
getErrors
in interface IProgram
Errors
collectionErrors
public FiscalCalendar getFiscalCalendar()
getFiscalCalendar
in interface IProgram
FiscalCalendar
containing the company's fiscal calendarpublic java.lang.String[] getInstalledReports(java.lang.String appID)
getInstalledReports
in interface IProgram
appID
- Application ID.
public IPropertyBag getIPropertyBag()
getIPropertyBag
in interface IProgram
public IPropertyBag getIPropertyBag(java.lang.String menuID)
getIPropertyBag
in interface IProgram
menuID
- the menu ID of the particular property bag requested. If this is
a null reference or a string of length zero then the inherited
property bag will be selected.
public ISession getISession()
getISession
in interface IProgram
ISession
in which the program is runningpublic Meter getMeter()
getMeter
in interface IProgram
Meter
attached to the program, or null if there is nonepublic Multiuser getMultiuser()
getMultiuser
in interface IProgram
Multiuser
for the programpublic PropertyBag getPropertyBag()
public PropertyBag getPropertyBag(java.lang.String menuID)
menuID
- the menu ID of the particular property bag requested. If this is
a null reference or a string of length zero then the inherited
property bag will be selected.
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.
getProgramFilesDirectory
in interface IProgram
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.IProgram.getCompanyDirectory(String)
,
IProgram.getUserDirectory(String)
,
IProgram.getUserCompanyDirectory(String)
public java.lang.String getProgramName()
getProgramName
in interface IProgram
public java.lang.String getRscString(java.lang.String pgmID, int strID)
getRscString
in interface IProgram
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()
Use getISession()
instead
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.
getUserCompanyDirectory
in interface IProgram
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.IProgram.getCompanyDirectory(String)
,
IProgram.getUserDirectory(String)
,
IProgram.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 IProgram.getUserCompanyDirectory(String)
.
getUserDirectory
in interface IProgram
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.IProgram.getCompanyDirectory(String)
,
IProgram.getUserCompanyDirectory(String)
,
IProgram.getProgramFilesDirectory(String)
public boolean isPermitted(java.lang.String resource)
isPermitted
in interface HasSecurity
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.
openDBLink
in interface IProgram
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)
If the view is not one of the standard Sage Accpac views and is a view on
the system database then use DBLink's
openIView(...)
openView
in interface IProgram
viewID
- Roto ID of the view to open. The Roto ID is defined by the
application.
public IView openIView(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
openIView(...)
openIView
in interface IProgram
viewID
- Roto ID of the view to open. The Roto ID is defined by the
application.
public IView openIView(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(...)
openIView
in interface IProgram
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
behavior. 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, 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
openIView(...)
openView
in interface IProgram
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 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.
paramGet
in interface HasParams
viewID
- Roto ID of the view from which to retrieve the parametersfieldIDs
- a var-args list or array of field indexes of which parameters
should be retrieved
public java.lang.Object getParam(java.lang.String viewID, int field)
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.
getParam
in interface HasParams
viewID
- Roto ID of the view from which to retrieve the parametersfield
- the field indexes of which parameter should be retrieved
public GettableByField getParams(java.lang.String viewID)
GettableByField
that exposes the parameters of the given
view.
Note that although the return value is a full GettableByField
it
can only be accessed by field indexes, not names
getParams
in interface HasParams
viewID
- the Roto ID of the view from which to retrieve the parameters
GettableByField
that exposes the parameters by field
indexprotected void finalize()
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |