com.sap.sl.sdk.authoring.local
Interface LocalResourceService


public interface LocalResourceService

Provides methods to manage local resources.

Secured resources need an enterprise session. This session should be provided using CmsSessionService.


Method Summary
 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)
          Converts a local .unv universe into a local .unx universe.
 CheckIntegrityRunner createCheckIntegrityRunner(java.lang.String resourcePath)
          Creates a check integrity process.
 SlResource load(java.lang.String resourcePath)
          Loads a resource that has been saved locally.
 java.lang.String publish(java.lang.String businessLayerPath, java.lang.String destinationFolderPath, boolean overwrite)
          Publishes a local business layer to a local .unx universe.
 java.lang.String retrieve(java.lang.String universePath, java.lang.String destinationFolderPath)
          Retrieves the local business layer, data foundation and connection from a local .unx universe.
 IStatus save(SlResource resource, java.lang.String localTargetPath, boolean overwrite)
          Saves a resource on the user machine.
 

Method Detail

save

IStatus save(SlResource resource,
             java.lang.String localTargetPath,
             boolean overwrite)
             throws SlException
Saves a resource on the user machine.

The method saves a resource object as a file on the user machine. The resource can be a business layer, a data foundation, or a connection.

When saving a data foundation or business layer, the number of values of each row of the static lists of values is compared to the number of columns:

Parameters:
resource - The top level resource to be saved
localTargetPath - The file path where the resource will be saved locally, for example: C:\BusinessLayers\myProject.blx

The resource file name must be specified and cannot be empty (C:\BusinessLayers\.blx).

overwrite - An exception is thrown if false and the resource already exists on the user machine
Returns:
An IStatus object that provides information on the save operation success
Throws:
SlException - See SlException.getStatus() and IStatus.getChildren() to get further information about error management
Since:
14.0.5
See Also:
load(String)

load

SlResource load(java.lang.String resourcePath)
                throws SlException
Loads a resource that has been saved locally.

The method loads in memory a resource persisted physically on the user machine. The resource can be a business layer, a data foundation, or a connection. Every loaded resource must be released with the method close(SlResource) to avoid memory leak.

Parameters:
resourcePath - The path of the local resource, for example C:\BusinessLayers\myProject.blx
Returns:
An SlResource object
Throws:
SlException
Since:
14.0.5
See Also:
save(SlResource, String, boolean)

convertUniverse

void convertUniverse(java.lang.String sourceUnvFilePath,
                     java.lang.String destinationFolder,
                     java.lang.String newResourceName,
                     boolean isPromptConverted)
                     throws SlException
Converts a local .unv universe into a local .unx universe.

Parameters:
sourceUnvFilePath - The path of the .unv file, for example C:\XIUniverses\eFashion.unv
destinationFolder - The path of the converted universe stored locally, for example C:\XIUniverses\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 object
Throws:
SlException
Since:
14.0.5

publish

java.lang.String publish(java.lang.String businessLayerPath,
                         java.lang.String destinationFolderPath,
                         boolean overwrite)
                         throws SlException
Publishes a local business layer to a local .unx universe.

Parameters:
businessLayerPath - The path of the business layer previously saved on disk, for example C:\BusinessLayers\myProject.blx
destinationFolderPath - The folder path of the published universe, for example C:\Universes\
overwrite - An exception is thrown if false and the resource already exists on the user machine
Returns:
A string that represents the path of the published universe, for example C:\Universes\myProject.unx
Throws:
SlException
Since:
14.0.5
See Also:
retrieve(String, String)

retrieve

java.lang.String retrieve(java.lang.String universePath,
                          java.lang.String destinationFolderPath)
                          throws SlException
Retrieves the local business layer, data foundation and connection from a local .unx universe.

Parameters:
universePath - The path of the universe previously saved on disk, for example C:\Universes\myProject.unx
destinationFolderPath - The folder path of the resulting business layer, for example C:\
Returns:
A String that represents the created business layer path with the following format: [specified destinationFolderPath]+[temporary folder name]+[top level file name]. For example: ["C:\"]+["retrieval-2012-09-21-21-58-14"]+["myProject.blx"].
Throws:
SlException
Since:
14.0.5
See Also:
publish(String, String, boolean)

close

void close(SlResource resource)
           throws SlException
Releases the resource to avoid memory leak.

If a method is still using this resource after it has been closed, an SlException is raised.

The following methods also release this resource:

Parameters:
resource - The resource to release
Throws:
SlException
Since:
14.0.5

createCheckIntegrityRunner

CheckIntegrityRunner createCheckIntegrityRunner(java.lang.String resourcePath)
Creates a check integrity process.

Parameters:
resourcePath - A String that represents the path of a resource (such as a connection, a data foundation, or a business layer) previously saved locally
Returns:
A CheckIntegrityRunner object
Since:
14.1.5


© Copyright 2016 SAP SE or an SAP affiliate company. All rights reserved.