com.sap.tc.mobile.cfs.meta.mi25io
Class ModelDataProvider

java.lang.Object
  extended by com.sap.tc.mobile.cfs.meta.mi25io.ModelDataProvider

public abstract class ModelDataProvider
extends java.lang.Object

Model data provider for MI 2.5 metadata including DDIC import. ModelDataProvider is a helper class, which provides the methods for IDE to create/update model structures on demand. The generation of CFS meta model structures can be separated into several steps:

DDIC import requires setting of JCO properties. Currently needed properties: For the list of all supported properties @see com.sap.mw.jco.JCO Optionally, you may also specify following properties:

Author:
i013912, d039184

Field Summary
static int IMP_DDIC
          Import DDIC information about the model (constraints).
static int IMP_STRUCT
          Import structure of BOs.
static int IMP_TEXT
          Import language texts from DDIC information.
 
Constructor Summary
ModelDataProvider()
           
 
Method Summary
abstract  ModelDescriptor importModel(java.lang.String packageName, java.lang.String modelName, java.io.InputStream metaXml, int flags, com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry, java.util.Properties mwLoginParams, ProgressListener listener)
          Deprecated.  
abstract  ModelDescriptor importModel(java.lang.String packageName, java.lang.String modelName, java.io.InputStream metaXml, com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry)
          Deprecated.  
abstract  ModelDescriptor importModel(java.lang.String packageName, java.lang.String modelName, java.lang.String mwModelName, java.lang.String mwModelVersion, java.lang.StringBuffer metaFile, int flags, com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry, java.util.Properties mwLoginParams, ProgressListener listener)
          Import model from metadata on the middleware.
abstract  java.util.Collection listModels(java.util.Properties mwLoginParams)
          Get list of models available at a middleware.
static ModelDataProvider newInstance()
          instantiate a new instance of ModelDataProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMP_STRUCT

public static final int IMP_STRUCT
Import structure of BOs.

See Also:
Constant Field Values

IMP_DDIC

public static final int IMP_DDIC
Import DDIC information about the model (constraints).

See Also:
Constant Field Values

IMP_TEXT

public static final int IMP_TEXT
Import language texts from DDIC information.

See Also:
Constant Field Values
Constructor Detail

ModelDataProvider

public ModelDataProvider()
Method Detail

newInstance

public static ModelDataProvider newInstance()
instantiate a new instance of ModelDataProvider.

Returns:
ModelDataProvider instance.

listModels

public abstract java.util.Collection listModels(java.util.Properties mwLoginParams)
Get list of models available at a middleware.

Parameters:
mwLoginParams - login parameters for JCO call to get DDIC info (see description of the class for detailed info).
Returns:
collection of models available at the middleware. This collection contains instances of ModelInfo.
See Also:
ModelInfo

importModel

public abstract ModelDescriptor importModel(java.lang.String packageName,
                                            java.lang.String modelName,
                                            java.io.InputStream metaXml,
                                            com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry)
Deprecated. 

Import model from metadata file. The method creates or updates the model from XML file exported from MI middleware. Only structure of the BOs can be imported this way, no constraints or language texts. Please use the other importModel() method instead, to get information directly from middleware.

Parameters:
packageName - package name of new model to create or model to update.
modelName - model name of the model (for re-import must be equal to old one).
metaXml - input stream with XML metadata (will NOT be closed).
registry - model registry instance in which to create the model.
Returns:
model descriptor.

importModel

public abstract ModelDescriptor importModel(java.lang.String packageName,
                                            java.lang.String modelName,
                                            java.lang.String mwModelName,
                                            java.lang.String mwModelVersion,
                                            java.lang.StringBuffer metaFile,
                                            int flags,
                                            com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry,
                                            java.util.Properties mwLoginParams,
                                            ProgressListener listener)
Import model from metadata on the middleware. The method creates or updates the model from MI middleware metadata. If the model already exists, existing model will be updated. What exactly will be imported can be specified by OR-ing the flags:

Parameters:
packageName - package name of new model to create or model to update.
modelName - model name of the model (for re-import must be equal to old one).
mwModelName - model name on the middleware (as returned by listModels()).
mwModelVersion - model version on the middleware (as returned by listModels()).
metaFile - string buffer to fill in with XML metadata or null (to be stored in the project for runtime). This buffer is changed only if structure is imported.
flags - import flags to use (see IMP_* constants).
registry - model registry instance in which to create the model.
mwLoginParams - login parameters for JCO call to connect to middleware (see description of the class for detailed info).
listener - progress listener callback. This callback will be called to notify about progress of the import.
Returns:
model descriptor.
See Also:
ProgressListener

importModel

public abstract ModelDescriptor importModel(java.lang.String packageName,
                                            java.lang.String modelName,
                                            java.io.InputStream metaXml,
                                            int flags,
                                            com.sap.tc.mobile.cfs.meta.spi.ModelRegistrySPI registry,
                                            java.util.Properties mwLoginParams,
                                            ProgressListener listener)
Deprecated. 

Import model from metadata in XML file and DDIC/text info on the middleware. The method creates or updates the model from metadata in XML file. If the model already exists, existing model will be updated. What exactly will be imported can be specified by OR-ing the flags:

Parameters:
packageName - package name of new model to create or model to update.
modelName - model name of the model (for re-import must be equal to old one).
metaXml - input stream with XML metadata (will NOT be closed).
flags - import flags to use (see IMP_* constants).
registry - model registry instance in which to create the model.
mwLoginParams - login parameters for JCO call to connect to middleware (see description of the class for detailed info).
listener - progress listener callback. This callback will be called to notify about progress of the import.
Returns:
model descriptor.
See Also:
ProgressListener