|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gentics.api.portalnode.connector.PortalConnectorFactory
public final class PortalConnectorFactory
PortalConnectorFactory can be used to create instances for datasources, RuleTrees and Resolvables.
Method Summary | |
---|---|
static Datasource |
createDatasource(Map handleprops)
Creates a new datasource handle with the specified properties as well as a new Datasource (with default properties). |
static Datasource |
createDatasource(Map handleprops,
Map dsprops)
Creates a new Datasource connection with the specified properties which should point to a Content Repository of Gentics Content.Node. |
static Expression |
createExpression(String rule)
Parse the given expression string into an Expression. |
static MultichannellingDatasource |
createMultichannellingDatasource(Map<String,String> handleProps,
Map<String,String> dsProps)
Create a new instance of a multichannelling datasource |
static RuleTree |
createRuleTree(String rule)
Deprecated. deprecated, replaced by createExpression(String) |
static WritableMultichannellingDatasource |
createWritableMultichannellingDatasource(Map<String,String> handleProps,
Map<String,String> dsProps)
Create a new writeable multichannelling datasource instance |
static WriteableDatasource |
createWriteableDatasource(Map handleProperties)
Creates a new datasource handle with the specified properties as well as a new writeable datasource (with default properties). |
static WriteableDatasource |
createWriteableDatasource(Map handleProperties,
Map datasourceProperties)
Creates a new datasource handle with the specified properties as well as a new writeable datasource with the specified properties. |
static void |
destroy()
Destroy the portal connector factory, close all database connections, remove the scheduler (created background threads). |
protected static void |
destroyDatasourceFactories()
Destroy all created datasource factories, close all handles (closing database connections) |
static Changeable |
getChangeableContentObject(String contentId,
WriteableDatasource datasource)
Returns a changeable content object with the given content id. |
static Resolvable |
getContentObject(String contentId,
Datasource datasource)
Returns a content object with the given content id. |
static void |
prefillAttributes(Datasource ds,
Collection<Resolvable> objects,
List<String> prefillAttributes)
Prefill the given attributes for objects which were fetched from the given datasource |
protected static void |
startScheduler()
Start the scheduler |
protected static void |
stopScheduler()
Stop the scheduler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Datasource createDatasource(Map handleprops)
handleprops
- Handle properties used when initializing SQL handle.
Datasource
,
createDatasource(Map, Map)
public static Datasource createDatasource(Map handleprops, Map dsprops)
Datasource
is NOT thread-safe.
Handle Property - Parameters:
type - Type of the datasource. (jndi or jdbc)
For JNDI:
name - The name of the defined JNDI datasource.
For JDBC:
driverClass = The name of the JDBC class to be used (e.g. com.mysql.jdbc.Driver)
url = The URL which describes the JDBC datasource. (e.g. jdbc:mysql://playground.office:3306/testdb?user=root)
Optional JDBC Pool Parameters:
maxActive = Controls the maximum number of objects that can be borrowed from the pool at one time.
maxIdle = Controls the maximum number of objects that can sit idle in the pool at any time.
for more options and more detailed documentation for JDBC Pool options
take a look at the API documentation of
GenericObjectPool
handleprops
- Handle properties used when initializing SQL handle.dsprops
- Datasource properties, may be an empty map.
public static MultichannellingDatasource createMultichannellingDatasource(Map<String,String> handleProps, Map<String,String> dsProps)
handleProps
- handle propertiesdsProps
- datasource properties
public static Resolvable getContentObject(String contentId, Datasource datasource) throws DatasourceNotAvailableException
contentId
- The content id of the object which should be returned.
([objecttype].[object id] e.g. 10002.123)datasource
- Datasource used to load the content object.
DatasourceNotAvailableException
public static Expression createExpression(String rule) throws ParserException
rule
- The Rule string to be parsed as Expression.
ParserException
Datasource.createDatasourceFilter(Expression)
public static RuleTree createRuleTree(String rule) throws ParserException
createExpression(String)
rule
- The rule string which is used to initialize the RuleTree
ParserException
- when rule has invalid syntax or is null.RuleTree
public static WriteableDatasource createWriteableDatasource(Map handleProperties)
handleProperties
- Handle properties used when initializing SQL
handle.
public static WriteableDatasource createWriteableDatasource(Map handleProperties, Map datasourceProperties)
handleProperties
- Handle properties used when initializing SQL
handle.datasourceProperties
- Datasource properties, may be an empty map.
public static WritableMultichannellingDatasource createWritableMultichannellingDatasource(Map<String,String> handleProps, Map<String,String> dsProps)
handleProps
- handle propertiesdsProps
- datasource properties
public static Changeable getChangeableContentObject(String contentId, WriteableDatasource datasource) throws DatasourceNotAvailableException
contentId
- The content id of the object which should be returned.
([objecttype].[object id] e.g. 10002.123)datasource
- Writeable Datasource used to load the content object.
DatasourceNotAvailableException
public static void prefillAttributes(Datasource ds, Collection<Resolvable> objects, List<String> prefillAttributes) throws NodeException
ds
- datasourceobjects
- collection of objects fetched from the datasourceprefillAttributes
- list of attributes to be prefilled
NodeException
protected static void startScheduler()
protected static void stopScheduler()
protected static void destroyDatasourceFactories()
public static void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |