loadSession
Synopsis
string loadSession(SessionId sessionId,
string uri,
LoadSessionOptions* options)
throws SessionServiceFault;
struct LoadSessionOptions {
string* suffix;
}
See also: SessionId, LoadSessionOptions, SessionServiceFault
The loadSession operation is used to load a pCon.basket compatible project (OBK) file into the current session.
Instead of a session ID the operation can also be invoked with a session context ID as their first argument (see also §newSessionContext). If so, the session ID stored in the session context will be used as the actual session ID. When invoked with a session context ID, the operation sets the project key of the session context to the key of the new or loaded project, but never close the session context’s old ‘current project’, regardless of whether it had been identified by a project key stored in the session context or, in the absence of such a key, was (and remains) the session’s current project.
On the other hand, if these operations are invoked with a session ID, and if the new project can be created or loaded successfully, then the new project will always become the session’s current project, and the old current project is always closed, regardless of whether there is a session context referencing this project. If there is such a session context, operations invoked for this session context will subsequently fail if they require a valid project until the project key of the session context has been reset or is set to the key of one of the projects currently held open by the session.
If the suffix option is not specified, the operation uses “.obk” as the suffix of the project file. If the client sets the suffix option to an empty string, then no suffix is appended to the project file name. Otherwise, the Online Configurator checks whether the suffix starts with a dot, prepending one if it does not, and appends the resulting suffix to the project file name.
The client should use an HTTP PUT request with this URL to upload the project file into the session’s working directory. The upload does not actually load the project into the current session.
The client may use an HTTP DELETE request to delete the uploaded file, either before or after it has been loaded into the current session.
If the uri argument is not an empty string, it must be one of the following:
-
a HTTP URL returned by a previous invocation of the
loadSessionoperation on the same session, and uploaded by the client -
a HTTP URL returned by a previous invocation of the
saveSessionoperation on the same session -
a FILE URL pointing to a file within the local file system of the Online Configurator
The loadSession operation loads the project file referenced by the URI into the current session. If the project file could be loaded successfully, the current state of the session is replaced with the state read from the project file. If there was an error, the session’s state is left unchanged.
If the uri argument is a FILE URL, The egr.eai.server.file_access property of the session or server configuration file must be properly configured (§Allowed File Access) or the Online Configurator will reject access to the project file.
The suffix option is ignored if the uri argument is not an empty string.
A SessionServiceFault is returned if one of the following conditions occurs:
-
The
sessionIdparameter is not a valid string representation of an UUID or does not represent an open session. -
The
uriargument is not empty and the syntax of the URI is invalid. -
The
suffixoption is specified (and theuriargument is empty), and the suffix contains a character not allowed in file names, or would result in an otherwise invalid file name (like a file name whose length exceeds the maximum length of file names supported by the underlying file system). -
The
uriargument is not an empty string and the URI is neither an URL returned by a previous invocation of theloadSessionorsaveSessionoperations on the same session, nor a FILE URL. -
The FILE URL can not be converted into a path name.
-
The server has not been configured to be allowed access to the file referenced by a the FILE URL.
-
The Online Configurator encountered some other problem while loading the project file (input/output error, corrupted project file, file system full, …).
-
The BSK/OBX stream contains a set-article and the license feature
egr.eai.basket.set_articlesis not enabled. -
After load, the number of items, not counting the top folder and basket sub-article items, is greater than one and the license feature
egr.eai.server.multiple_positionsis not enabled.