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

GomConfigurable

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()
provides a GOM (GUI Object Model) element object which may be used within the FS_INDEX input component's <SOURCE /> block in its form definition. See Additional XML Tags (Input Components) for more information.

void setConfiguration(GomElement)
sets the configuration data according to the given GomElement object. This configuration may be used to build a data access session object.

Revision Awareness

Aspect

Description

Methods / Notes

RevisionConfigurable

Enables configuration of revision-aware data access sessions.

void setRelease(boolean)
flags if the data access session should operate only on "released" data.

void setRevision(Revision)
sets the revision for which data objects should be fetched.

   

© 2005 - 2024 Crownpeak Technology GmbH | Alle Rechte vorbehalten. | FirstSpirit 2024.4 | Datenschutz