|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable lumis.doui.source.Source<F>
F
- the interface all fields of this source must implement.@StableMinor(version="6.2", sinceVersion="4.0") public abstract class Source<F extends ISourceField>
The base implementation of a doui data source.
Field Summary | |
---|---|
protected String |
addInterfaceId
|
protected String |
administrationInterfaceId
|
protected String |
connectionId
|
protected String |
detailsInterfaceId
|
protected String |
editInterfaceId
|
protected List<F> |
fields
A unmodifiable list of this source's fields. |
protected Map<String,F> |
fieldsMap
A map of field id to the ISourceField instance. |
protected String |
id
|
protected F |
introductionSourceField
|
protected F |
keywordsSourceField
|
protected boolean |
load
|
protected String |
metaDataSourceId
|
protected Map<String,Object> |
parameters
|
protected F |
primaryNameSourceField
|
protected String |
readData
|
static String |
SOURCE_READ_DATA_ALWAYS
|
static String |
SOURCE_READ_DATA_NEVER
|
static String |
SOURCE_READ_DATA_ON_DEMAND
|
protected ISourceContext |
sourceContext
|
protected Node |
sourceDefinitionNode
|
Constructor Summary | |
---|---|
Source(Node sourceDefinitionNode,
ISourceContext sourceContext)
|
Method Summary | ||
---|---|---|
void |
applyPostLoadFilters()
Apply the filters specified in this source to its data. |
|
protected abstract void |
convertDataToDefinedDataTypes()
Converts the data in this source to the values that should be used according to its fields definitions. |
|
protected F |
createCustomSourceField(Node fieldNode)
Factory method for creating a custom source field. |
|
protected ISourceFilter |
createDefaultCompositeFilterInstance()
Creates and returns a source filter instance to be used as default to filters nodes. |
|
protected ISourceFilter |
createDefaultFilterInstance()
Creates and returns a source filter instance to be used as default to filter nodes. |
|
protected F |
createSourceField(Node fieldNode)
Factory method for creating a source field instance that corresponds to the field node given. |
|
ISourceFilter |
createSourceFilter(Node filterNode)
Creates a source filter for the given filter definition node. |
|
String |
getAddInterfaceId()
Returns the default add interface id for this source. |
|
String |
getAdministrationInterfaceId()
Returns the main administration interface id for this source. |
|
ISourceData |
getData()
Returns this source's data. |
|
|
getDataProvider()
Returns the data provider for this source. |
|
protected abstract String |
getDefaultProviderClass()
Abstract method that returns the default data provider class name. |
|
Node |
getDefinitionNode()
Deprecated. This method may not be public in the future. |
|
String |
getDetailsInterfaceId()
Returns the default details interface id for this source. |
|
boolean |
getDistinct()
Returns the distinct property of the source. |
|
DouiContext |
getDouiContext()
Returns this source's doui context. |
|
DouiHyperlinkItemParameterField |
getDouiHyperlinkItemParameterField()
Returns the information about the field that is associated with the item id page parameter. |
|
String |
getEditInterfaceId()
Returns the default edit interface id for this source. |
|
F |
getField(String fieldId)
Returns the field with the given id. |
|
List<F> |
getFields()
Returns a unmodifiable list of the fields in this source. |
|
ISourceFilter |
getFilter()
Returns the filter for this source. |
|
Node |
getFiltersNode()
Returns the "filters" node of the source. |
|
Collection<String> |
getHyperlinkDefaultParameters()
Returns the default parameters that should be used when creating a hyperlink url from this source. |
|
String |
getId()
Returns the source id. |
|
F |
getIntroductionField()
Returns the field that is the introduction of this source. |
|
F |
getKeywordsField()
|
|
boolean |
getLoad()
Returns the load property. |
|
String |
getMetaDataSourceId()
Returns the metaDataId. |
|
Class<?> |
getParameterClass(String parameterName)
Returns the class given a parameter name. |
|
Object |
getParameterValue(String parameterName)
Returns a parameter value previously set. |
|
F |
getPrimaryNameField()
Returns the field that is the primary name of this source. |
|
String |
getReadData()
|
|
SourceContainer |
getSourceContainer()
Returns this source's container. |
|
ISourceContext |
getSourceContext()
Returns this source's context. |
|
ITransaction |
getTransaction()
Returns the transaction for this source. |
|
protected boolean |
isAdministrationInterface(IServiceInterface serviceInterface)
Returns true if the given service interface is the main administration interface for this source. |
|
void |
load()
This is where the actual loading of the source data takes place. |
|
protected void |
postProcessSource()
Executes the post load processors associated with the current source. |
|
protected void |
readFieldsIntoFieldsMap()
Reads this source's fields into the fieldsMap . |
|
void |
setLoad(boolean load)
Sets the property indicating whether this source must be loaded by its data provider. |
|
void |
setParameterValue(String parameterName,
Object value)
Sets the parameter value of the source. |
|
void |
setReadData(String loadType)
Returns the load type of the source. |
|
protected boolean |
valueChanged(String parameterName,
Object value)
Returns true if the current value of the parameter changed from the previous value. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SOURCE_READ_DATA_ON_DEMAND
public static final String SOURCE_READ_DATA_NEVER
public static final String SOURCE_READ_DATA_ALWAYS
protected final String id
protected final String metaDataSourceId
protected final String connectionId
protected final Map<String,Object> parameters
protected final ISourceContext sourceContext
protected final Node sourceDefinitionNode
protected final String administrationInterfaceId
protected final String addInterfaceId
protected final String editInterfaceId
protected final String detailsInterfaceId
protected final Map<String,F extends ISourceField> fieldsMap
ISourceField
instance. Changes to this
map automatically reflects in the fields
list. The fields
list has the order the entries were put in this map.
fields
protected final List<F extends ISourceField> fields
fieldsMap
.
The order of fields in this list is the same as the order the fields were put
in fieldsMap
.
fieldsMap
protected boolean load
protected String readData
protected F extends ISourceField primaryNameSourceField
protected F extends ISourceField introductionSourceField
protected F extends ISourceField keywordsSourceField
Constructor Detail |
---|
public Source(Node sourceDefinitionNode, ISourceContext sourceContext) throws PortalException
PortalException
Method Detail |
---|
protected boolean isAdministrationInterface(IServiceInterface serviceInterface)
serviceInterface
- the service interface.
protected void readFieldsIntoFieldsMap() throws PortalException
fieldsMap
.
The order the source fields are put in the map will define the
order the fields will be in the fields
list. This
order may affect some field processing.
PortalException
- if an error was found while reading the
source's fields into the fields
map.protected F createCustomSourceField(Node fieldNode) throws PortalException
fieldNode
- the field definition.
PortalException
protected F createSourceField(Node fieldNode) throws PortalException
fieldNode
- the field node.
PortalException
createCustomSourceField(Node)
public ISourceFilter createSourceFilter(Node filterNode) throws PortalException
filters
or filter
node.
filterNode
- the filter definition node.
PortalException
protected ISourceFilter createDefaultFilterInstance()
filter
nodes.
protected ISourceFilter createDefaultCompositeFilterInstance()
filters
nodes.
public ISourceFilter getFilter()
public String getId()
public Class<?> getParameterClass(String parameterName)
The class is determined by the field type where the fieldId equals the parameter name.
parameterName
-
public void setParameterValue(String parameterName, Object value)
parameterName
- value
- public Object getParameterValue(String parameterName)
parameterName
-
protected boolean valueChanged(String parameterName, Object value)
parameterName
- value
-
public Node getDefinitionNode()
public String getAdministrationInterfaceId()
null
if the
source does not have a main administration interface.public String getAddInterfaceId()
null
if the
source does not have a default add interface.public String getEditInterfaceId()
null
if the
source does not have a default edit interface.public String getDetailsInterfaceId()
null
if the
source does not have a default details interface.public <S extends Source> IDataProvider<S> getDataProvider() throws PortalException
S
-
PortalException
protected abstract String getDefaultProviderClass() throws PortalException
PortalException
public ISourceData getData() throws PortalException
PortalException
public void setLoad(boolean load)
load
- public boolean getLoad()
The doui framework uses this to determine whether the source should be loaded or not.
public ITransaction getTransaction() throws PortalException
PortalException
public void load() throws PortalException
The data provider is called by the source to load its data. After data is loaded, all data conversion is performed and observers are notified.
PortalException
protected void postProcessSource() throws PortalException
PortalException
protected abstract void convertDataToDefinedDataTypes() throws PortalException
PortalException
public String getReadData()
public void setReadData(String loadType)
loadType
- The loadType to set.public Node getFiltersNode() throws PortalException
A null value is returned if no filters are specified.
PortalException
public void applyPostLoadFilters() throws PortalException
Data providers that may provide significant quantity of data should implement its own filtering during load instead of using this method, to prevent unnecessary use of server's memory and cpu.
UnsupportedOperationException
- if the source's implementation
for this method does not support the filters specified.
PortalException
IDataProvider#loadData(lumis.portal.SessionConfig, Source, lumis.util.ITransaction)
public ISourceContext getSourceContext()
public DouiContext getDouiContext()
public SourceContainer getSourceContainer()
public boolean getDistinct() throws PortalException
The data provider reads this property to determine how to retireve data.
PortalException
public String getMetaDataSourceId()
public F getField(String fieldId)
fieldId
- the field's id.
public List<F> getFields()
public F getPrimaryNameField()
public F getIntroductionField()
public F getKeywordsField()
public DouiHyperlinkItemParameterField getDouiHyperlinkItemParameterField()
PageConfig.PAGE_PARAMETER_ITEMID
,
DouiHyperlinkItemParameterField
public Collection<String> getHyperlinkDefaultParameters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |