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

Quick Search    Search Deep

com.flexstor.flexdbserver.services.asset
Class ImageInfoService  view ImageInfoService download ImageInfoService.java

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

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

AlchemyInfoService

Calls the Alchemy utility to obtain display information about an asset. Different image convert applications can be plugged into this service.
The service requires the following key/value pair lines as output of the command line application being invoked (this is an example):
Type: JPEG
Mode: Truecolour
Width: 640
Height: 430
BitsPerPixel: 24
DPIX: 72
DPIY: 72
FileSize: 203189
The result must be sent to standard output.
The keys do not required to be with the capitalization shown.
Make sure a colon is used, not an equal sign.
Note that DPIX and DPIY can be substituted with DPCX and DPCY if this values are given in centimeters rather than inches.

Configurable Properties in roletype_services.config
In/Out Properties for Assets
Attribute IN OUT Default IN Default OUT
ROLE     ALL  
Highres X      
Lowres X      
Thumbnail X      
Layout X      
Video        
Audio        
TYPE X   ALL  
FLAG
PARENT X   X  
CHLDREN X      
ALL X      
TEMP_PARENT X      
TEMP_CHILDREN X      
TEMP_ALL X      

configfile: Path to configuration file holding alchemy related parameters (optional; defaults to the conversion.cfg file for the hot directory).
Legal values: Full path to configuration file

Input Data Object

com.flexstor.common.importprocessor.ImportData

Output Data Object

com.flexstor.common.importprocessor.ImportResult

Programmable Properties (passed inside data object)
Global Properties (apply to all assets)

"intervaltimer_timeout" : A user-specified property in roletype_services.config that defines the timeout period for the watch-dog timer that interrupts the Alchemy process if it hangs. Data type: int
Legal values: time (seconds)


Field Summary
protected  com.flexstor.flexdbserver.services.ServiceContext context
           
protected  java.lang.String fileSeparator
           
protected  int id
           
static java.lang.String IDENTIFIER
           
private  int nOemAlchemy
           
private  com.flexstor.flexdbserver.importprocessor.ConversionOptions refConversionOptions
           
protected  com.flexstor.common.importprocessor.ImportCtlData refCtlData
           
protected  com.flexstor.common.importprocessor.ImportData refImportData
           
private  java.lang.String sConfigFile
           
private  java.lang.String sPrimaryColorDepth
           
private  java.lang.String sPrimaryColorSpace
           
private  java.lang.String sPrimaryDPIX
           
private  java.lang.String sPrimaryDPIY
           
private  java.lang.String sPrimaryFileSize
           
private  java.lang.String sPrimaryFormat
           
private  java.lang.String sPrimaryHeight
           
private  java.lang.String sPrimaryWidth
           
private  java.lang.String sThisService
           
private  java.lang.String sTranslator
           
protected  boolean successful
           
 
Constructor Summary
ImageInfoService()
           
 
Method Summary
protected  boolean getImageInfo(java.lang.String[] saCommandLine)
           
protected  boolean getInfo(com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData refSourceAsset)
          Get Info
 java.lang.String getPrimaryColorDepth()
           
 java.lang.String getPrimaryColorSpace()
           
 java.lang.String getPrimaryDPIX()
           
 java.lang.String getPrimaryDPIY()
           
 java.lang.String getPrimaryFileSize()
           
 java.lang.String getPrimaryFormat()
           
 java.lang.String getPrimaryHeight()
           
 java.lang.String getPrimaryWidth()
           
 com.flexstor.common.data.ActionResult go()
          The start of the Convert Service.
 void initData(com.flexstor.common.data.ActionData actionData)
          A data initialization method called at the beginning of the service.
 boolean processElement(java.lang.String sSourcePath)
           
private  boolean readCfgFile()
           
 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.
private  float stringToFloat(java.lang.String theString)
           
private  long stringToLong(java.lang.String theString)
           
 
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

context

protected com.flexstor.flexdbserver.services.ServiceContext context

fileSeparator

protected java.lang.String fileSeparator

id

protected int id

sThisService

private java.lang.String sThisService

sPrimaryFormat

private java.lang.String sPrimaryFormat

sPrimaryDPIX

private java.lang.String sPrimaryDPIX

sPrimaryDPIY

private java.lang.String sPrimaryDPIY

sPrimaryWidth

private java.lang.String sPrimaryWidth

sPrimaryHeight

private java.lang.String sPrimaryHeight

sPrimaryColorDepth

private java.lang.String sPrimaryColorDepth

sPrimaryColorSpace

private java.lang.String sPrimaryColorSpace

sPrimaryFileSize

private java.lang.String sPrimaryFileSize

refConversionOptions

private com.flexstor.flexdbserver.importprocessor.ConversionOptions refConversionOptions

nOemAlchemy

private int nOemAlchemy

sTranslator

private java.lang.String sTranslator

sConfigFile

private java.lang.String sConfigFile

successful

protected boolean successful

refCtlData

protected com.flexstor.common.importprocessor.ImportCtlData refCtlData

refImportData

protected com.flexstor.common.importprocessor.ImportData refImportData
Constructor Detail

ImageInfoService

public ImageInfoService()
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)
A data initialization method called at the beginning of the service. The input argument, ActionData must be cast into its subclass, ImportData in order to extract the service specific data from it.

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

go

public com.flexstor.common.data.ActionResult go()
The start of the Convert Service.

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

getInfo

protected boolean getInfo(com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData refSourceAsset)
Get Info


readCfgFile

private boolean readCfgFile()

processElement

public boolean processElement(java.lang.String sSourcePath)

getImageInfo

protected boolean getImageInfo(java.lang.String[] saCommandLine)

stringToLong

private long stringToLong(java.lang.String theString)

stringToFloat

private float stringToFloat(java.lang.String theString)

getPrimaryFormat

public java.lang.String getPrimaryFormat()

getPrimaryWidth

public java.lang.String getPrimaryWidth()

getPrimaryHeight

public java.lang.String getPrimaryHeight()

getPrimaryDPIX

public java.lang.String getPrimaryDPIX()

getPrimaryDPIY

public java.lang.String getPrimaryDPIY()

getPrimaryColorDepth

public java.lang.String getPrimaryColorDepth()

getPrimaryColorSpace

public java.lang.String getPrimaryColorSpace()

getPrimaryFileSize

public java.lang.String getPrimaryFileSize()