Startseite / Plugin-Entwicklung / Universelle Erweiterungen / Datenzugriff / Datenzugriff-Session / Builder
Data Access Session Builder
FirstSpirit Developer API Interface: de.espirit.firstspirit.client.plugin.dataaccess.DataAccessSessionBuilder
Developer API documentation: DataAccessSessionBuilder<D>
The data access session builder object is used to configure a data access session object. Its purpose is to determine the information required to properly configure the data access session object. As such, it may optionally provide aspects which indicate that configuration information may be placed in XML tags within an FS_INDEX input component's form definition or that data access should be performed on a revision-aware basis.
public class MyDataAccessSessionBuilder implements DataAccessSessionBuilder<MyDataObject> {
private final SessionBuilderAspectMap _aspects;
public MyDataAccessSessionBuilder() {
_aspects = new SessionBuilderAspectMap();
}
@Nullable
@Override
public <A> A getAspect(@NotNull final SessionBuilderAspectType<A> type) {
return _aspects.get(type);
}
/**
* Instantiate and return a data access session object.
*/
@NotNull
@Override
public DataAccessSession<MyDataObject> createSession(@NotNull final BaseContext context) {
// Note that we're using a constructor that takes a BaseContext object as a parameter.
// This will come in handy later when the session object instantiates a data snippet provider.
return new MyDataAccessSession(context);
}
}
Providing Aspects
FirstSpirit occasionally calls the method getAspect(...) with various aspect types as a parameter to identify which input components support a given aspect. If the data access session builder class supports the requested aspect, the method should return an object which implements that aspect; otherwise, it should return null.
Data Access Session Builder Aspects | ||
---|---|---|
Configuration | ||
Aspect | Description | Methods / Notes |
Enables configuration of the data access session when the data access plug-in is used in the context of an FS_INDEX input component. Configuration is added as an XML tag or structure within an FS_INDEX component's <SOURCE /> block in form definitions. | GomElement createConfiguration() | |
Revision Awareness | ||
Aspect | Description | Methods / Notes |
Enables configuration of revision-aware data access sessions. | void setRelease(boolean) | |