com.sap.tc.webdynpro.repository.api

Interface IWDRepositoryModelClass

All Superinterfaces:
ICMIGenericModelClass, ICMIModelClass
All Known Subinterfaces:
IWDAbstractViewInfo, IWDActionInfo, IWDApplicationInfo, IWDApplicationPropertyInfo, IWDBusinessGraphicsInfo, IWDComponentControllerUsageInfo, IWDComponentInfo, IWDComponentInterfaceDefinitionInfo, IWDComponentInterfaceImplementationInfo, IWDComponentInterfaceInfo, IWDComponentUsageInfo, IWDContextAttributeMappingInfo, IWDContextElementMappingInfo, IWDControllerInfo, IWDControllerUsageInfo, IWDCustomEventInfo, IWDEmptyViewInfo, IWDEventBindingInfo, IWDEventHandlerInfo, IWDEventInfo, IWDInboundPlugInfo, IWDIncomingEventInfo, IWDInterfaceViewInfo, IWDNavigationLinkInfo, IWDNavigationTargetReferenceInfo, IWDOutboundPlugInfo, IWDParameterInfo, IWDParameterizedFeatureInfo, IWDParameterMappingInfo, IWDUIElementInfo, IWDUIElementLibraryInfo, IWDViewContainerAssignmentInfo, IWDViewContainerInfo, IWDViewInfo, IWDViewUsageInfo, IWDWindowInfo

public interface IWDRepositoryModelClass
extends ICMIGenericModelClass

The API to the generic repository object class that represents repository content at runtime time.

Type Classification Type Classification:

This interface is part of the Web Dynpro API, so applications may reference it or call any method of it, but they must not implement or extend it.

For a detailed explanation of API classification see the Web Dynpro Compatibility Guide

Method Summary
 IWDRepositoryModelClass createRelatedModelObject(String rolename, String name)
          Creates a new child object for the given relation.
 IWDRepositoryModelClass createRelatedModelObject(String rolename, String name, IWDRepositoryModelClassInfo modelClassInfo)
          Creates a new child object for the given relation.
 boolean deleteRelatedModelObject(String rolename, IWDRepositoryModelClass o)
          Deletes the given child object from the given relation.
 String getAttributeValue(String name, Locale locale)
          Returns the value of an attribute for the specified locale.
 Locale getMasterLocale()
          Returns the master locale of this model class instance.
 String getName()
          Returns the name of the repository object.
 IWDRepositoryModelClass getParent()
          Returns the parent of this object.
 IWDRepositoryModelClass getPersonalizationObject()
          Returns a variant of this model object that can be used for personalization.
 IWDRepositoryModel getRepositoryModel()
          Returns the repository model of this repository object.
 IWDRepositoryModel getRepositoryRoot()
          Deprecated. To improve consistency across the Web Dynpro API, this method has been renamed to getRepositoryModel(). The method with the old name has been kept for backward compatiblity, but may be withdrawn with the first new NetWeaver release in 2006.
 boolean isVersionableModelObject()
          Returns true, iff the current object is a versionable model object.
 void resetAttribute(String name, Locale locale)
          Resets the value of the attribute.
 boolean resetRelatedModelObject(String rolename, IWDRepositoryModelClass o)
          Resets the given child object in the given relation.
 void setAttributeValue(String name, String value, Locale locale)
          Sets the attribute value.
 
Methods inherited from interface com.sap.tc.cmi.model.ICMIGenericModelClass
addRelatedModelObject, associatedModelClassInfo, getAttributeValue, getRelatedModelObject, getRelatedModelObjects, removeRelatedModelObject, setAttributeValue, setRelatedModelObject, setRelatedModelObjects
 
Methods inherited from interface com.sap.tc.cmi.model.ICMIModelClass
associatedModel
 

Method Detail

getName

public String getName()
Returns the name of the repository object.

Returns:
the name of the repository object

getParent

public IWDRepositoryModelClass getParent()
Returns the parent of this object.

Returns:
the parent of this object or null, if the object has no parent

getPersonalizationObject

public IWDRepositoryModelClass getPersonalizationObject()
Returns a variant of this model object that can be used for personalization. This method only works in the runtime mode. When applied to the transient version of the repository model object, it returns a variant whose changes will be persisted in the user data of the logged in user. If the personalized object is marked as deleted, null is returned.

Returns:
the personalization repository object for this repository object

getRepositoryRoot

public IWDRepositoryModel getRepositoryRoot()
Deprecated. To improve consistency across the Web Dynpro API, this method has been renamed to getRepositoryModel(). The method with the old name has been kept for backward compatiblity, but may be withdrawn with the first new NetWeaver release in 2006.

Returns the repository root of this repository object.

Returns:
the repository root of this repository object

getRepositoryModel

public IWDRepositoryModel getRepositoryModel()
Returns the repository model of this repository object.

Returns:
the repository model of this repository object

createRelatedModelObject

public IWDRepositoryModelClass createRelatedModelObject(String rolename,
                                                        String name)
Creates a new child object for the given relation. Preconditions:
rolename is not empty
name is not empty
name must only contain a..zA..Z0..9._- symbols
object with the given name must not exist in the given role
the relation must be an aggregation

Parameters:
rolename - name of the relation role the new child will belong to
name - name of the child object
Returns:
the newly created child object
Throws:
RepositoryRuntimeException - if name is the name of an object that was deleted in the current variant, in one of its predecessor variants or in the personalization layer before

createRelatedModelObject

public IWDRepositoryModelClass createRelatedModelObject(String rolename,
                                                        String name,
                                                        IWDRepositoryModelClassInfo modelClassInfo)
Creates a new child object for the given relation. The provided modelClassInfo must belong to a modelClass which is a sub-class of the aggregated class. Preconditions:
rolename is not empty
name is not empty
name must only contain a..zA..Z0..9._- symbols
object with the given name must not exist in the given role
the relation must be an aggregation

Parameters:
rolename - name of the relation role the new child will belong to
name - name of the child object
modelClassInfo - the class description to use when creating the object
Returns:
the newly created child object
Throws:
RepositoryRuntimeException - if name is the name of an object that was deleted in the current variant, in one of its predecessor variants or in the personalization layer before

deleteRelatedModelObject

public boolean deleteRelatedModelObject(String rolename,
                                        IWDRepositoryModelClass o)
Deletes the given child object from the given relation. Preconditions:
rolename is not empty
the role be a valid target role for this repository model class
o != null

Parameters:
rolename - name of the relation role the child belongs to
o - the child object to be deleted
Returns:
true, iff the child belonged to the given relation role and was deleted

isVersionableModelObject

public boolean isVersionableModelObject()
Returns true, iff the current object is a versionable model object.


getAttributeValue

public String getAttributeValue(String name,
                                Locale locale)
Returns the value of an attribute for the specified locale. The search algorithm is as follows (the first found value is used):
Specified locale in current layer.
Specified locale without country in current layer.
Specified locale in previous layers.
Specified locale without country in previous layers.
Master locale in current layer.
Master locale without country in current layer.
Master locale in previous layers.
Master locale without country in previous layers.
Continue search in the same way for all predecessing variants.
Precondition: name denotes an attribute that is translatable, i.e. ((RepositoryObjectAttributeInfo) associatedModelClassInfo.getPropertyInfo(name)).isTranslatable() == true

Parameters:
name - the attribute's name
locale - the locale to be used; if null, the default locale of the repository is used
Returns:
the value of the attribute with name supplied as input parameter; if the attribute couldn't be found, null is returned

setAttributeValue

public void setAttributeValue(String name,
                              String value,
                              Locale locale)
Sets the attribute value. Precondition: name denotes an attribute that is translatable, i.e. ((RepositoryObjectAttributeInfo) associatedModelClassInfo.getPropertyInfo(name)).isTranslatable() == true

Parameters:
name - name of the attribute
value - value of the attribute
locale - the locale the specified value belongs to

resetAttribute

public void resetAttribute(String name,
                           Locale locale)
Resets the value of the attribute.

Parameters:
name - name of the attribute
locale - in case of translatable attribute the locale the specified value belongs to

resetRelatedModelObject

public boolean resetRelatedModelObject(String rolename,
                                       IWDRepositoryModelClass o)
Resets the given child object in the given relation. If such an object is defined in the predecessing layer, then that object will be visible, otherwise it is be completely deleted Preconditions:
rolename is not empty
the role be a valid target role for this repository model class
o != null

Parameters:
rolename - name of the relation role the child belongs to
o - the child object to be reset
Returns:
true, iff the child belonged to the given relation role and was reset

getMasterLocale

public Locale getMasterLocale()
Returns the master locale of this model class instance. The master locale is the locale for which the corresponding versionable model class was created.

Returns:
the master locale of this versionable model class


Copyright 2006 SAP AG Complete Copyright Notice