public interface CmsResourceService
This service needs a session that should be provided using CmsSessionService.
Semantic layer security is managed by CmsSecurityService.
UNIVERSES_ROOT,
CONNECTIONS_ROOT, or SETS_ROOT.
The root is followed by a subfolder and the resource name. The
separator is /. For example /Connections/myCmsFolder/MyConnection.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONNECTIONS_ROOT
CMS root path for connections.
|
static java.lang.String |
SETS_ROOT
CMS root path for sets.
|
static java.lang.String |
UNIVERSES_ROOT
CMS root path for universes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeUniverseConnection(java.lang.String repositoryUniversePath,
java.lang.String repositoryConnectionPath)
Replaces a connection from a published universe by another connection stored in the repository.
|
void |
changeUniverseConnections(java.lang.String repositoryUniversePath,
java.util.Map<java.lang.String,java.lang.String> repositoryConnectionPathMap)
Replaces a list of connections from a published multisource-enabled universe by another list of connections stored in the
repository.
|
void |
close(SlResource resource)
Releases the resource to avoid memory leak.
|
void |
convertUniverse(java.lang.String sourceUnvFilePath,
java.lang.String destinationFolder,
java.lang.String newResourceName,
boolean isPromptConverted)
Deprecated.
|
void |
convertUniverse(java.lang.String sourceUnvFilePath,
java.lang.String destinationFolder,
java.lang.String newResourceName,
boolean isPromptConverted,
boolean isCoreUniversesIncluded,
boolean isOverwritten)
Deprecated.
|
IStatus |
convertUniverse(java.lang.String sourceUnvFilePath,
java.lang.String destinationFolder,
java.lang.String newResourceName,
ConversionOptions options)
Converts a
.unv universe stored in the repository into a .unx universe. |
java.lang.String |
createShortcut(java.lang.String repositoryPath,
java.lang.String targetFolder)
Creates a connection shortcut (
.cns) in the local workspace from a published connection (
.cnx). |
java.lang.String |
getResourceCuid(java.lang.String path)
Gets the CUID of the resource from its path in the CMS repository.
|
java.lang.String |
getResourcePath(java.lang.String cuid)
Gets the path of the resource in the CMS repository from its CUID.
|
java.util.List<java.lang.String> |
getUniverseConnections(java.lang.String repositoryUniversePath)
Returns the secured connections attached to a published universe.
|
int |
getUniverseRevisionNumber(java.lang.String unxIdentifier)
Gets the revision number of a .unx universe published in the CMS repository.
|
DatabaseConnection |
loadConnection(java.lang.String connectionPath)
Returns a connection from its path in the repository.
|
java.lang.String |
publish(java.lang.String filePath,
java.lang.String repositoryPath,
boolean overwrite)
Creates or overwrites a resource (universe or connection) in the CMS.
|
java.lang.String |
retrieveUniverse(java.lang.String repositoryPath,
java.lang.String targetFolder,
boolean saveForAllUsers)
Creates resources (
.blx, .cns and .dfx if applicable) in the local
workspace from a published universe (.unx). |
void |
saveConnection(DatabaseConnection connection)
Updates a connection in the repository.
|
static final java.lang.String UNIVERSES_ROOT
static final java.lang.String CONNECTIONS_ROOT
static final java.lang.String SETS_ROOT
java.lang.String retrieveUniverse(java.lang.String repositoryPath,
java.lang.String targetFolder,
boolean saveForAllUsers)
throws SlException
.blx, .cns and .dfx if applicable) in the local
workspace from a published universe (.unx).repositoryPath - A String that represents the path of the repository universe you want to retrieve within the
Universes root folder. See UNIVERSES_ROOT.
Example: /Universes/myCmsFolder/MyUniverse.unx
targetFolder - A String that represents the targeted folder path within which the resources are created, for example:
C:\Workspace
Do not indicate the resource names, which are set from the business names of the retrieved resources.
saveForAllUsers - If set to false, this creates a secured version of the resources. A CMS session is
required to access them.
If set to true, this creates a non-encrypted version of the resources. Anyone can access
them.[targetFolder]/[temporary folder name]/[business layer name].blx.SlExceptionUNIVERSES_ROOTjava.lang.String createShortcut(java.lang.String repositoryPath,
java.lang.String targetFolder)
throws SlException
.cns) in the local workspace from a published connection (
.cnx).repositoryPath - A String that represents the path of the repository connection you want to retrieve within the
Connections root folder. See CONNECTIONS_ROOT
Example: /Connections/myCmsFolder/MyConnection
targetFolder - A String that represents the targeted folder path within which the connection shortcut is created, for
example: C:\Workspace
Do not indicate the resource name, which is set from the business name of the local resource.
[targetFolder]/[temporary folder name]/[connection name].cnsSlExceptionCONNECTIONS_ROOTjava.lang.String publish(java.lang.String filePath,
java.lang.String repositoryPath,
boolean overwrite)
throws SlException
The resource is created from a local file and all dependent resources must be available. If you want to publish a universe to the repository, the file path must be a business layer path and its dependencies must be available locally (data foundation and connection shortcut).
The SDK throws an exception:filePath - A String that represents the path of the local resource to publish, for example:
C:\myUniverse.blxrepositoryPath - A String that represents the repository folder where the resource is published.
Do not indicate the resource name, which is set from the business name of the local resource. For
CMS-specific implementation, specify the Universes or Connections root
folder, for example:
/Connections/myCmsFolder/Universes/myCmsFolderoverwrite - An exception is thrown if false and the resource already exists in the CMS/Universes/myCmsFolder/MyUniverse.unx
If the resource to publish is a connection, the method returns the path of the connection without
extension, for example: /Connections/myCmsFolder/MyConnection.
SlExceptionvoid changeUniverseConnection(java.lang.String repositoryUniversePath,
java.lang.String repositoryConnectionPath)
throws SlException
This method is used for universes with a single-source connection definition (an OLAP connection, an RDBMS connection, or a DataFederator connection). It does not check the structure of the universe after the connection replacement. It does not replace the connections of the "Connections" setting of a Data Security Profile.
Before committing the secured connection replacement, a check is run first to validate if the prerequisites are
respected, otherwise a SecuredConnectionException is raised with an error message. Possible
exceptions are the following:
changeUniverseConnections method.Connections root folder is not accessible because the view right is denied.repositoryUniversePath - The path of the published universe in the repository
For CMS-specific implementation, specify the Universes root folder, for example:
/Universes/myCmsFolder/MyUniverse.unx or /MyUniverse.unx if the file has
been stored directly under the root folder.
repositoryConnectionPath - The path of the replacement secured connection stored in the CMS
For CMS-specific implementation, specify the Connections root folder, for example:
/Connections/myCmsFolder/Connection or /Connection if the file has been
stored directly under the root folder.
SlExceptionvoid changeUniverseConnections(java.lang.String repositoryUniversePath,
java.util.Map<java.lang.String,java.lang.String> repositoryConnectionPathMap)
throws SlException
This method is used for universes with a multisource-enabled connection definition (RDBMS and/or DataFederator connections). You can replace a connection with one that is already used by the universe. If the replacement connection has not been deployed on the Data Federation Query Server, this is done automatically when the replacement is performed. This method does not check the structure of the universe after the connection replacement. It does not replace the connections of the "Connections" setting of a Data Security Profile.
Before committing the secured connection replacement, a check is run first to validate if the prerequisites are
respected in the repository connection path mapping, otherwise a SecuredConnectionException is
raised with an error message. Possible exceptions are the following:
Connections root folder is not accessible because the view right is denied.repositoryUniversePath - The path of the published universe in the repository
For CMS-specific implementation, specify the Universes root folder, for example:
/Universes/myCmsFolder/MyUniverse.unx or /MyUniverse.unx if the file has
been stored directly under the root folder.
repositoryConnectionPathMap - A map that ensures the connection replacement between the universe connections and a list of
connections stored in the repository:
CmsResourceService.getUniverseConnections(String
repositoryUniversePath) method to know the path of the connections attached to the published
universe and then to enter the right connection path in the map as key entry.
For CMS-specific implementation, specify the Connections root folder, for example:
/Connections/myCmsFolder/Connection.cnx or /Connections/Connection.cnx if
the file has been stored directly under the root folder.
SlExceptiongetUniverseConnections(String)java.util.List<java.lang.String> getUniverseConnections(java.lang.String repositoryUniversePath)
throws SlException
Every loaded resource must be released with the method close(SlResource) to avoid memory leak.
repositoryUniversePath - The path of the published universe in the repository
For CMS-specific implementation, specify the Universes root folder in the path, for
example: /Universes/myCmsFolder/MyUniverse.unx or /Universes/MyUniverse.unx
if the file has been stored directly under the root folder.
The retrieved connection path is formatted as /Connections/subFolder/connection. The root
folder is Connections.
SlExceptionchangeUniverseConnections(String, Map)DatabaseConnection loadConnection(java.lang.String connectionPath) throws SlException
If allowed, the connection parameter values are also returned.
connectionPath - The path of the connection, formatted as /Connections/subFolder/connection. The root
folder is Connections.Connection objectSlExceptionDatabaseConnection,
saveConnection(DatabaseConnection),
close(SlResource)void saveConnection(DatabaseConnection connection) throws SlException
The connection can only be provided by the loadConnection(String) method of the same
SlContext.
connection - The connection returned by loadConnection(String)SlExceptionDatabaseConnection,
loadConnection(String)IStatus convertUniverse(java.lang.String sourceUnvFilePath, java.lang.String destinationFolder, java.lang.String newResourceName, ConversionOptions options)
.unv universe stored in the repository into a .unx universe.sourceUnvFilePath - The path of the .unv universe
For CMS-specific implementation, it is formatted as /Universes/subFolder/myUniverse. The
root folder is Universes.
destinationFolder - The path of the converted universe stored in the repository
Do not indicate the resource name, which is set from the business name of the local resource. In the
repository, it is a string that represents the repository folder where the resource is to be
published. It is formatted as /Universes/myFolder.
For CMS-specific implementation, specify the Universes root folder, for example:
/Universes/SDK/Conversion.
newResourceName - The name of the new resource, without extension
Is optional. If not provided, the universe name will be used. Can be null, but not empty.
options - The conversion options.IStatus object containing the status of the conversion.ConversionOptions@Deprecated
void convertUniverse(java.lang.String sourceUnvFilePath,
java.lang.String destinationFolder,
java.lang.String newResourceName,
boolean isPromptConverted)
throws SlException
.unv universe stored in the repository into a .unx universe.sourceUnvFilePath - The path of the .unv universe
For CMS-specific implementation, it is formatted as /Universes/subFolder/myUniverse. The
root folder is Universes.
destinationFolder - The path of the converted universe stored in the repository
Do not indicate the resource name, which is set from the business name of the local resource. In the
repository, it is a string that represents the repository folder where the resource is to be
published. It is formatted as /Universes/myFolder.
For CMS-specific implementation, specify the Universes root folder, for example:
/Universes/SDK/Conversion.
newResourceName - The name of the new resource, without extension
Is optional. If not provided, the universe name will be used. Can be null, but not empty.
isPromptConverted - true to create the parameter prompt in the business layer during conversion,
false to keep the universe prompt definition into the business objectSlException@Deprecated
void convertUniverse(java.lang.String sourceUnvFilePath,
java.lang.String destinationFolder,
java.lang.String newResourceName,
boolean isPromptConverted,
boolean isCoreUniversesIncluded,
boolean isOverwritten)
throws SlException
.unv universe stored in the repository into a .unx universe.sourceUnvFilePath - The path of the .unv universe
/Universes/subFolder/myUniverse. The
root folder is Universes.destinationFolder - The path of the converted universe stored in the repository
/Universes/myFolder.Universes root folder, for example:
/Universes/SDK/Conversion.newResourceName - The name of the new resource, without extension
isPromptConverted - true to create the parameter prompt in the business layer during conversion,
false to keep the universe prompt definition into the business object.
isCoreUniversesIncluded - true to include the existing core universes into the converted linked universe,
false to convert the linked universes and its core universes.
isOverwritten - true to replace the universe that is already in the CMS repository during conversion,
false to keep the universe that is in the CMS repository.SlExceptionint getUniverseRevisionNumber(java.lang.String unxIdentifier)
throws SlException
unxIdentifier - The identifier of the .unx universe
In the CMS repository, the identifier of a .unx universe can be one of the following:
/Universes/subFolder/myUniverse.unxAUkhFsg72ntHpql8Izl9pv0SlExceptionjava.lang.String getResourceCuid(java.lang.String path)
throws SlException
The supported resources are the following:
path - The path of the resource
/Universes/subFolder/myUniverse.unx./Universes/subFolder/myUniverse./Connections/subFolder/myConnection.
The CUID is formatted as for example AUkhFsg72ntHpql8Izl9pv0.
SlExceptionjava.lang.String getResourcePath(java.lang.String cuid)
throws SlException
The supported resources are the following:
cuid - The CUID of the resource
For example: AUkhFsg72ntHpql8Izl9pv0
/Universes/subFolder/myUniverse.unx./Universes/subFolder/myUniverse./Connections/subFolder/myConnection.SlExceptionvoid close(SlResource resource) throws SlException
If a method is still using this resource after it has been closed, an SlException is raised.
The following methods also release this resource:
resource - The resource to releaseSlException