Package com.portal.bas
Interface PInfranetConnection
- All Superinterfaces:
Remote
- All Known Implementing Classes:
PInfranetAppControllerImpl
,PInfranetConnectionImpl
PInfranetConnection
is used purely as a handle on the client side.
It represents a connection to the BAS server, not to Portal.- Author:
- Larry Lynch-Freshner
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(boolean logout) Closes the connection to the Portal server.createController
(String controllerClass) Registers the client portion of a component with the BAS server.createNewModel
(String type) Creates a new, empty data model.Returns the current connection context.getModelField
(PModelHandle data, String desc) Gets a field from a model.boolean
getPermissionFor
(String componentName) Gets permission to use a component.getRestrictionOn
(String fieldSpecification) Retrieves the restrictions on a field, for example, whether it is a read-only field.Gets the user's UI preferences.void
Logsuser
into the Portal server specified byurl
.void
registerApp
(String appName, Locale locale, Object data) Registers the application with the BAS server.void
registerComponent
(PRemoteComponent comp, String controllerClass) Deprecated.void
Releases the connection retrieved bygetContext()
.void
Save user preferences Properties object.void
setModelField
(PModelHandle data, String desc, Object val) Sets a field in a model to a new value.void
setUserPreferences
(Properties userPrefs) Deprecated.use saveUserPreferences()void
Deprecated.As of Release 6.1, this method is deprecated and replaced byunregisterController
.
-
Method Details
-
getPermissionFor
Gets permission to use a component.- Parameters:
componentName
- the component's name- Returns:
- True if use is permitted; false otherwise.
- Throws:
RemoteException
- thrown for errors
-
getRestrictionOn
Retrieves the restrictions on a field, for example, whether it is a read-only field.- Parameters:
fieldSpecification
- the field's specification- Returns:
- The
PRestriction
object. - Throws:
RemoteException
- thrown for errors
-
registerApp
Registers the application with the BAS server. This gives the server-side components access to the application name and client locale.- Parameters:
appName
- the application's namelocale
- the client's localedata
- other application-specific data- Throws:
RemoteException
- thrown for errors
-
createController
Registers the client portion of a component with the BAS server.- Parameters:
controllerClass
- the class name of the component controller- Returns:
- A stub to the controller.
- Throws:
RemoteException
- thrown in case of failure
-
registerComponent
Deprecated.As of Release 6.1, this method is deprecated and replaced bycreateController
andregisterController
.Registers the client portion of a component with the BAS server.- Parameters:
comp
- the component to registercontrollerClass
- the class name of the component controller- Throws:
RemoteException
- thrown in case of failure
-
unregisterComponent
Deprecated.As of Release 6.1, this method is deprecated and replaced byunregisterController
.Unregisters the client portion of a component with the BAS server.- Parameters:
comp
- the component to unregister- Throws:
RemoteException
- thrown in case of failure
-
createNewModel
Creates a new, empty data model.- Parameters:
type
- the type of model to create- Returns:
- A new data model.
- Throws:
RemoteException
- thrown for errors
-
getModelField
Gets a field from a model. This version returns aPModelHandle
only for a field that is itself a model. Use this method when the returned field data will be sent to the client. For compound specifications, an object array is returned.- Parameters:
data
- the model from which to get a fielddesc
- a description of which field(s) to get- Returns:
- The contents of the field. This is an Integer, BigDecimal, Date, Double, byte array, String, or ModelHandle.
- Throws:
RemoteException
- thrown for errors
-
setModelField
Sets a field in a model to a new value. This version handles the case where the new value is aPModelHandle
.- Parameters:
data
- the model to set a field indesc
- a description of which field to setval
- the new value to be set- Throws:
RemoteException
- thrown for errors
-
getUserPreferences
Gets the user's UI preferences.- Returns:
- The
Properties
object that contains the user's preferences. - Throws:
RemoteException
- thrown for errors
-
saveUserPreferences
Save user preferences Properties object. Saves the object managed by this class that is retrieved using getUserPreferences() method. Always use this preferred method to save user prefs.- Throws:
RemoteException
-
setUserPreferences
Deprecated.use saveUserPreferences()Saves changes to the user's UI preferencesProperties
object.- Parameters:
userPrefs
- aProperties
object that contains the user's preferences- Throws:
RemoteException
- thrown for errors
-
login
Logsuser
into the Portal server specified byurl
.- Parameters:
user
- the usernamepassword
- user's passwordurl
- a string containing connection information in URL format, e.g., pcp://host:port- Throws:
RemoteException
- if login fails.
-
close
Closes the connection to the Portal server.- Parameters:
logout
- if true, logs out before closing the connection- Throws:
RemoteException
-
getContext
PortalContext getContext()Returns the current connection context. May be null if no connection to Portal has been made. For every call togetContext()
there must be a corresponding call toreleaseContext()
.- Returns:
- A CachedContext object or null
- See Also:
-
releaseContext
Releases the connection retrieved bygetContext()
. For every call togetContext()
there must be a corresponding call toreleaseContext()
.- Parameters:
ctx
- the connection to be released.- See Also:
-
createController
andregisterController
.