Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.flexdbserver.services.asset.destination
Class SetDestinationService  view SetDestinationService download SetDestinationService.java

java.lang.Object
  extended bycom.flexstor.flexdbserver.services.asset.destination.SetDestinationService
All Implemented Interfaces:
com.flexstor.flexdbserver.services.Service

public class SetDestinationService
extends java.lang.Object
implements com.flexstor.flexdbserver.services.Service

SetDestinationService

Create destination paths for assets according to the mode selected. Destination paths can be retrieved by invoking the method call:
String destination = (String) asset.getProperty( String key );
where asset is an instance of DisguiseAssetRecordData.
Possible modes are:
fromMapfolders:
- Files are part of a mapfolders structure and the new destination will be another folder. This new destination folder can either preserve the mapped structure defined for the hot directory (this is the default behavior), or not preserve its hot directory structure (so that all files are copied into a single folder).
toMapfolders:
- Files are not under a mapfolders structure and new destination will be a folder where a new mapped structure will be created following the properties ([mapfolders] section) loaded into the ImportData object from an input control (*.ctl) file.
toSequencefolders:
- Files might or might not be in a mapfolders structure. New destination will be a sequence of numbered folders, each one containing a maximum number of files. No mapfolders structure is preserved.

Configurable Properties in roletype_services.config (or *.ctl file if run as a preservice)
In/Out Properties for Assets
Attribute IN OUT Default IN Default OUT
ROLE     ALL  
Highres X      
Lowres X      
Thumbnail X      
Layout X      
Video X      
Audio X      
TYPE X   ALL  
FLAG
PARENT X   X  
CHLDREN X      
ALL X      
TEMP_PARENT X      
TEMP_CHILDREN X      
TEMP_ALL X      

mode: See description of service above (defaults to fromMapfolders).
Legal values: fromMapfolders, toMapfolders, or toSequencefolders

exactMatch: If set to true, the service will succeed setting the path of an asset only if the number of buckets in the traversal path of the asset is equal to the number of buckets set in the [mapfolders] section of the *.ctl file. If set to false, it will succeed if the number of buckets in the traversal path is less or equal to the number of buckets in the [mapfolders] section. Please note that a single bucket can be set in more than one level in the [mapfolders] section, if so, it will only be counted once for the effects of setting the path (it will default to false if not specified)
Legal values: true or false

destinationbase: Destination path for files. If SetDestinationService is specified as a preservice in the input control (*.ctl) file and this property is not declared, it will default to either the lowcopybase or highcopybase property (depending on role) in the input control file. If SetDestinationService is not defined as a preservice, this property must be declared.
Configure this property for mode = fromMapfolders and toMapfolders
Legal values: Full path

originalbase: Base path where original files reside. If SetDestinationService is specified as a preservice in the input control file and this property is not declared, it will default to either the lowfilelistbase or highfilelistbase property (depending on role) in the input control file. If SetDestinationService is not defined as a preservice, this property must be declared.
Configure this property for mode = fromMapfolders
Legal values: Full path

flatmode: Indicates if destination location will duplicate all, none, or part of the original location under the destinationbase path. For instance, if the original path is /base/path/job/page/file.jpg, destinationbase is /dest, and flatmode is set to true, the destination path for the file will be /dest/file.jpg. If the original path is defined as /base/path and flatmode is set to false, the destination path will be /dest/job/page.file.jpg. If no original path is defined and no default is found, the destination path will be /dest/base/path/job/page/file.jpg (optional; defaults to false if service defined as a preservice; true otherwise).
Configure this property for mode = fromMapfolders
Legal values: true or false

max_no_of_files: The maximum number of files allowed per destination folder if mode is toSequenceFolders. This property must be defined if mode = toSequenceFolders; for all other modes, this property is ignored.
Legal values: Any positive number

map_sequence_to: Map the sequence numbered folder to a field in the bucket specified in this property. The syntax for this property is bucket name, field name, where the field name must exist in the specified bucket.
Legal values: A valid bucket name and field name for the application being used.

Input Data Object

com.flexstor.common.importprocessor.ImportData

Output Data Object

com.flexstor.common.importprocessor.ImportResult


Field Summary
protected  com.flexstor.flexdbserver.services.ServiceContext context
           
private static java.lang.String FROMMAPFOLDERS
           
private  java.util.Hashtable htProperties
           
protected  int id
           
static java.lang.String IDENTIFIER
           
private  com.flexstor.common.importprocessor.ImportData importData
           
private  java.lang.String sThisService
           
private static java.lang.String TOSEQUENCEFOLDERS
           
 
Constructor Summary
SetDestinationService()
           
 
Method Summary
 com.flexstor.common.data.ActionResult go()
          This methods carries the load of the business logic for the service.
 void initData(com.flexstor.common.data.ActionData actionData)
          A data initialization method called at the beginning of the service.
private  boolean isMapStructured(java.lang.String sMode)
          Determines if the assets stored in the ImportData object are to be treated as mapped structure.
 void setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
          Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final java.lang.String IDENTIFIER
See Also:
Constant Field Values

FROMMAPFOLDERS

private static final java.lang.String FROMMAPFOLDERS
See Also:
Constant Field Values

TOSEQUENCEFOLDERS

private static final java.lang.String TOSEQUENCEFOLDERS
See Also:
Constant Field Values

context

protected com.flexstor.flexdbserver.services.ServiceContext context

id

protected int id

importData

private com.flexstor.common.importprocessor.ImportData importData

sThisService

private java.lang.String sThisService

htProperties

private java.util.Hashtable htProperties
Constructor Detail

SetDestinationService

public SetDestinationService()
Method Detail

setServiceContext

public void setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running. This environment consists of information about the properties set for the service in one of these files (services.config, roletype_services.config, or *.ctl), plus methods to access other information such as an instance of the service broker to invoke other services, the transaction id for the service, file separator character and local path for the installation directory and configuration directory.

Specified by:
setServiceContext in interface com.flexstor.flexdbserver.services.Service

initData

public void initData(com.flexstor.common.data.ActionData actionData)
Description copied from interface: com.flexstor.flexdbserver.services.Service
A data initialization method called at the beginning of the service. Not business logic, relevant to the functionality of the service, should be added here, other than initializing some variables, etc.

Specified by:
initData in interface com.flexstor.flexdbserver.services.Service

go

public com.flexstor.common.data.ActionResult go()
Description copied from interface: com.flexstor.flexdbserver.services.Service
This methods carries the load of the business logic for the service.

Specified by:
go in interface com.flexstor.flexdbserver.services.Service

isMapStructured

private boolean isMapStructured(java.lang.String sMode)
Determines if the assets stored in the ImportData object are to be treated as mapped structure. If the ImportCtlData object inside ImportData contains the [mapfolders] section of the *.ctl file and this section contains the leveln properties then it is structured.