public final class Core
extends java.lang.Object
Constructor and Description |
---|
Core() |
Modifier and Type | Method and Description |
---|---|
static <T extends CoreAction<?>> |
addListener(ActionListener<T> al)
Deprecated.
As of release 7.6, replaced by
ListenersRegistry.addListener(ActionListener) |
static void |
addRequestHandler(java.lang.String path,
RequestHandler requestHandler)
Add a custom request handler to the Mendix Business Server.
|
static void |
addUserAction(java.lang.Class<? extends UserAction<?>> userActionClass)
Add the action specified by the given action name to action registry.
|
static boolean |
authenticate(IContext context,
IUser user,
java.lang.String password)
Authenticate the given user with the given password.
|
static void |
buildException(java.lang.StringBuilder trace,
java.lang.Throwable throwable)
Prints the message and stacktrace of a Throwable and its cause(s).
|
static boolean |
change(IContext context,
IMendixObject object,
java.util.Map<java.lang.String,java.lang.String> changes)
Changes the given object in cache (synchronously).
|
static java.util.concurrent.Future<java.lang.Boolean> |
changeAsync(IContext context,
IMendixObject obj,
java.util.Map<java.lang.String,java.lang.String> changes)
Changes the object (asynchronously).
|
static IMendixObject |
commit(IContext context,
IMendixObject object)
Commits the given object.
|
static java.util.List<IMendixObject> |
commit(IContext context,
java.util.List<IMendixObject> objects)
Commits the given objects.
|
static java.util.List<java.util.concurrent.Future<java.util.List<IMendixObject>>> |
commitAsync(IContext context,
java.util.List<IMendixObject> objects)
Commits the given object (asynchronously).
|
static IMendixObject |
commitWithoutEvents(IContext context,
IMendixObject object)
Commits the given object without events.
|
static java.util.List<IMendixObject> |
commitWithoutEvents(IContext context,
java.util.List<IMendixObject> objects)
Commits the given objects without events.
|
static IDataType |
createDataType(java.lang.String type)
Creates a DataType based on a type.
Possible types: - Boolean - Integer - Long - Float - String - Datetime - {code#id} (enumeration key) - ModuleName.ObjectName (IMendixObject) - [ModuleName.ObjectName] (List<IMendixObject>) |
static IDataType |
createDataType(java.lang.String objectType,
java.lang.String attributeName)
Creates a DataType based on an object type and a attribute name.
|
static IMendixIdentifier |
createMendixIdentifier(long guid)
Creates a new IMendixIdentifier for the given guid.
|
static IMendixIdentifier |
createMendixIdentifier(java.lang.String guid)
Creates a IMendixIdentifier for the given guid.
|
static IOQLTextGetRequest |
createOQLTextGetRequest()
Create a new IOQLTextGetRequest.
|
static IOQLTextGetRequest |
createOQLTextGetRequestFromDataSet(java.lang.String dataSetQualifiedName)
Instantiate
IOQLTextGetRequest from given qualified DataSet name. |
static IRetrievalSchema |
createRetrievalSchema()
Create a new IRetrievalSchema.
|
static IContext |
createSystemContext()
Returns the context of the system session (this is always a sudo context).
|
static XPathQuery |
createXPathQuery(java.lang.String xpathQuery)
Creates an XPath query representation that can be built up in a fluent manner
|
static IXPathTextGetRequest |
createXPathTextGetRequest()
Create a new IXPathTextGetRequest.
|
static DataStorage |
dataStorage()
Returns an interface to data storage functionality.
|
static boolean |
delete(IContext context,
IMendixObject... objects)
Deletes the given objects from the database and server cache (synchronously).
|
static boolean |
delete(IContext context,
java.util.List<IMendixObject> objectList)
Deletes the given objects from the database and server cache (synchronously).
|
static java.util.List<java.util.concurrent.Future<java.lang.Boolean>> |
deleteAsync(IContext context,
IMendixObject object,
boolean useDeleteBehavior)
Deletes the given object from the database and server cache (asynchronously).
|
static java.util.List<java.util.concurrent.Future<java.lang.Boolean>> |
deleteAsync(IContext context,
java.util.List<IMendixObject> objects,
boolean useDeleteBehavior)
Deletes the given object from the database and server cache (asynchronously).
|
static boolean |
deleteWithoutEvents(IContext context,
java.util.List<IMendixObject> objects,
boolean useDeleteBehavior)
Deletes the given objects from the database and server cache (synchronously) without events
This action is executed in a transaction.
|
static java.lang.Object |
evaluateExpression(IContext context,
java.util.Map<java.lang.String,java.lang.Object> variables,
java.lang.String expression)
Evaluate the given (microflow)expression.
|
static <R> R |
execute(IContext context,
java.lang.String actionName,
boolean executeInTransaction,
java.util.Map<java.lang.String,java.lang.Object> params)
Execute the specified action (synchronously).
|
static <R> R |
execute(IContext context,
java.lang.String actionName,
java.util.Map<java.lang.String,java.lang.Object> params)
Execute the specified action (synchronously).
|
static <R> R |
execute(IContext context,
java.lang.String actionName,
java.lang.Object... params)
Execute a Java or microflow action synchronously based on the name passed.
|
static <T extends CoreAction<R>,R> |
execute(T action)
Execute an action asynchronously, result is given and/or exceptions are raised when calling Future.get().
|
static <R> java.util.concurrent.Future<R> |
executeAsync(IContext context,
java.lang.String microflowName,
boolean executeInTransaction,
java.util.Map<java.lang.String,java.lang.Object> params)
Execute the specified microflow (asynchronously).
|
static <R> java.util.concurrent.Future<R> |
executeAsync(IContext context,
java.lang.String actionName,
java.lang.Object... params)
Execute the specified action (asynchronously).
|
static <T extends CoreAction<R>,R> |
executeSync(T action)
Execute an action synchronously.
|
static <T extends CoreAction<R>,R> |
executeVoid(T action)
Execute the specified action (asynchronously).
|
static java.io.InputStream |
exportStream(IContext context,
java.lang.String exportMappingName,
IMendixObject objectToExport,
java.lang.Boolean shouldValidate)
Deprecated.
Use method Core.integration().exportStream.
|
static int |
getActionQueueSize()
Returns the current action pool queue size.
|
static int |
getActiveActionCount()
Returns the current number of active actions.
|
static ISession |
getActiveSession(java.lang.String userName)
Deprecated.
use xpath query on session table instead.
|
static java.util.Collection<? extends ISession> |
getActiveSessions()
Deprecated.
use xpath query on session table instead.
|
static java.lang.Iterable<IMendixObject> |
getAllMendixObjects()
Get all IMendixObject types.
|
static long |
getCompletedActionCount()
Returns the number of completed actions since server startup.
|
static long |
getConcurrentUserCount(boolean anonymous)
The current number of concurrent users.
|
static Configuration |
getConfiguration()
Returns the current configuration.
|
static int |
getCurrentPoolSize()
Returns the current action pool size.
|
static java.lang.String |
getDatabaseChildColumnName(IMetaAssociation metaAssociation)
Returns the name of the database column for the child of the given association.
|
static java.lang.String |
getDatabaseColumnName(IMetaPrimitive metaPrimitive)
Returns the name of the database column for the given attribute.
|
static java.lang.String |
getDatabaseParentColumnName(IMetaAssociation metaAssociation)
Returns the name of the database column for the parent of the given association.
|
static java.lang.String |
getDatabaseTableName(IMetaAssociation metaAssociation)
Returns the name of the database table for the given association.
|
static java.lang.String |
getDatabaseTableName(IMetaObject metaObject)
Returns the name of the database table for the given entity type.
|
static ILanguage |
getDefaultLanguage()
Returns the default language of the loaded project.
|
static java.io.InputStream |
getFileDocumentContent(IContext context,
IMendixObject fileDocument)
Returns contents of a file document as an input stream.
|
static java.io.InputStream |
getImage(IContext context,
IMendixObject imageDocument,
boolean retrieveThumbnail)
Retrieve contents of the given image document.
|
static java.util.Map<java.lang.String,IDataType> |
getInputParameters(java.lang.String actionName)
Returns all input parameter data types the specified action by name.
|
static java.lang.String |
getInternationalizedString(IContext context,
java.lang.String key,
java.lang.Object... args)
Returns the translated string for a certain key and context.
|
static java.lang.String |
getInternationalizedString(java.lang.String languageCode,
java.lang.String key,
java.lang.Object... args)
Returns the translated string for a certain key and language code.
|
static int |
getLargestPoolSize()
Returns the largest action pool size.
|
static ListenersRegistry |
getListenersRegistry()
Returns an instance of
ListenersRegistry which can be used to register
callbacks for commit, create, change and delete actions on all persistable entities in the application. |
static java.util.Locale |
getLocale(IContext context)
Retrieve locale using the given context.
|
static java.util.Locale |
getLocale(java.lang.String languageCode)
Retrieve locale using the given language code (e.g.
|
static com.mendix.logging.ILogNode |
getLogger(java.lang.String name) |
static int |
getMaximumNumberConcurrentUsers()
Returns the maximum number of concurrent users since the server was started.
|
static IMetaAssociation |
getMetaAssociation(java.lang.String association)
Get the IMetaAssociation corresponding to the given association name.
|
static java.lang.Iterable<IMetaAssociation> |
getMetaAssociations()
Get all IMetaAssociations.
|
static IMetaObject |
getMetaObject(java.lang.String metaObjectName)
Get the IMetaObject corresponding to the given meta object name.
|
static java.lang.Iterable<IMetaObject> |
getMetaObjects()
Get all IMetaObjects.
|
static IMetaPrimitive |
getMetaPrimitive(java.lang.String qualifiedAttributeName)
Get the IMetaPrimtive based on a qualified attribute name (e.g.
|
static java.util.Set<java.lang.String> |
getMicroflowNames()
Returns the names of all modeled microflows.
|
static java.lang.String |
getModelVersion()
Returns the model version of the project.
|
static long |
getNamedUserCount() |
static long |
getNumberConcurrentSessions()
Returns current number of concurrent sessions.
|
static IProfiler |
getProfiler() |
static java.util.UUID |
getProjectId()
Returns the project identifier of the project.
|
static IDataType |
getReturnType(java.lang.String actionName)
Returns the return type of the specified action.
|
static int |
getScheduledActionCount()
Returns the number of actions currently scheduled for future execution.
|
static ISession |
getSessionById(java.util.UUID sessionId)
Returns the session belonging to the given session id.
|
static java.util.Date |
getStartupDateTime()
Returns the startup date time of the Mendix Business Server.
|
static java.util.List<java.lang.String> |
getSubtypesOf(java.lang.String objectType)
Get all subtypes for an object type (including subtypes of subtypes, etc.).
|
static IUser |
getUser(IContext context,
java.lang.String userName)
Returns a user using the given user name.
|
static java.lang.String |
getXASId()
Returns the id of this server instance.
|
static Http |
http()
Returns an interface to HTTP functionality.
|
static java.util.List<IMendixObject> |
importStream(IContext context,
java.io.InputStream stream,
java.lang.String importMappingName,
IMendixObject mappingParameter,
java.lang.Boolean shouldValidate)
Deprecated.
Use method Core.integration().importStream.
|
static void |
initialize(ICore core,
Http http,
Integration integration,
DataStorage dataStorage,
Metrics metrics)
Initializes this Core class, so that all methods can be invoked statically.
|
static ISession |
initializeGuestSession()
Initialize a new session for a guest user.
|
static ISession |
initializeSession(IUser user,
java.lang.String currentSessionId)
Initialize a new session for the given user.
|
static IMendixObject |
instantiate(IContext context,
java.lang.String objectType)
Creates a new IMendixObject with the given object type (synchronously).
|
static java.util.concurrent.Future<IMendixObject> |
instantiateAsync(IContext context,
java.lang.String objectType)
Creates a new IMendixObject with the given object type (asynchronously).
|
static Integration |
integration()
Returns an interface to import and export data into and from Mendix.
|
static boolean |
isInDevelopment() |
static boolean |
isSubClassOf(IMetaObject superObject,
IMetaObject type)
Checks whether a type is a subclass of or equal to a potential super class.
|
static boolean |
isSubClassOf(java.lang.String superClass,
short typeHash)
Checks whether a type is a subclass of or equal to a potential super class.
|
static boolean |
isSubClassOf(java.lang.String superClass,
java.lang.String type)
Checks whether a type is a subclass of or equal to a potential super class.
|
static ISession |
login(java.util.Map<java.lang.String,? extends java.lang.Object> params)
Generic login method (can be used in modules in combination with LoginAction replacement).
|
static ISession |
login(java.lang.String userName,
java.lang.String password)
Login user with the given user name and password.
|
static ISession |
login(java.lang.String userName,
java.lang.String password,
com.mendix.m2ee.api.IMxRuntimeRequest request) |
static ISession |
login(java.lang.String userName,
java.lang.String password,
java.lang.String currentSessionId)
Login user with the given parameters.
|
static void |
logout(ISession session)
Logout the given session.
|
static Metrics |
metrics()
Returns the metrics API.
|
static MicroflowCallBuilder |
microflowCall(java.lang.String name)
This API call is experimental and should not be used! It will not work without explicitly enabling background processing.
|
static void |
registerLogSubscriber(com.mendix.logging.LogSubscriber subscriber) |
static void |
registerProfiler(IProfiler profiler) |
static boolean |
removeScheduledFuture(java.util.concurrent.RunnableScheduledFuture<?> scheduledFuture)
Remove scheduled future.
|
static <R> java.util.concurrent.ScheduledFuture<?> |
reschedule(java.util.concurrent.RunnableScheduledFuture<R> scheduledFuture,
CoreAction<R> action,
long newDelay,
java.util.concurrent.TimeUnit timeUnit)
Reschedule an action with a new delay.
|
static java.lang.Object |
resolveTokens(IContext context,
java.lang.String text)
Resolve tokens in the given text.
|
static java.util.List<IMendixObject> |
retrieveByPath(IContext context,
IMendixObject mxObject,
java.lang.String path)
Retrieves objects using the given object and path.
|
static java.util.List<IMendixObject> |
retrieveByPath(IContext context,
IMendixObject mxObject,
java.lang.String path,
boolean isSelfAssociationChild)
Retrieves objects using the given object and path.
|
static IMendixObject |
retrieveId(IContext context,
IMendixIdentifier id)
Retrieves object with the given id (synchronously).
|
static java.util.concurrent.Future<IMendixObject> |
retrieveIdAsync(IContext context,
IMendixIdentifier id)
Retrieves object with the given id (asynchronously).
|
static java.util.List<IMendixObject> |
retrieveIdList(IContext context,
java.util.List<IMendixIdentifier> ids)
Retrieves objects with the given ids (synchronously).
|
static java.util.List<IMendixObject> |
retrieveIdList(IContext context,
java.util.List<IMendixIdentifier> ids,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort)
Retrieves objects with the given ids (synchronously).
|
static java.util.concurrent.Future<java.util.List<IMendixObject>> |
retrieveIdListAsync(IContext context,
java.util.List<IMendixIdentifier> ids)
Retrieves objects with the given ids (asynchronously).
|
static IDataTable |
retrieveOQLDataTable(IContext context,
IGetRequest request)
Retrieve raw data (IDataTable) using an IGetRequest object (synchronously).
|
static IDataTable |
retrieveOQLDataTable(IContext context,
java.lang.String oqlQuery)
Retrieve raw data (IDataTable) using an IGetRequest object (synchronously).
|
static IDataTable |
retrieveOQLDataTable(IContext context,
java.lang.String oqlQuery,
int amount,
int offset)
Retrieve raw data (IDataTable) using an OQL query (asynchronously).
|
static java.util.concurrent.Future<IDataTable> |
retrieveOQLDataTableAsync(IContext context,
IGetRequest request)
Retrieve raw data (IDataTable) using an IGetRequest object (asynchronously).
|
static java.util.concurrent.Future<IDataTable> |
retrieveOQLDataTableAsync(IContext context,
java.lang.String oqlQuery)
Retrieve raw data (IDataTable) using an OQL query (asynchronously).
|
static java.util.concurrent.Future<IDataTable> |
retrieveOQLDataTableAsync(IContext context,
java.lang.String oqlQuery,
int amount,
int offset)
Retrieve raw data (IDataTable) using an OQL query (asynchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathQuery(IContext context,
java.lang.String xpathQuery)
Retrieves object list based on the given XPath query (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathQuery(IContext context,
java.lang.String xpathQuery,
int depth)
Retrieves object list based on the given XPath query (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathQuery(IContext context,
java.lang.String xpathQuery,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort)
Retrieves object list based on the given XPath query (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathQuery(IContext context,
java.lang.String xpathQuery,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort,
int depth)
Retrieves object list based on the given XPath query (synchronously).
|
static java.lang.Long |
retrieveXPathQueryAggregate(IContext context,
java.lang.String xpathQuery)
Retrieves long aggregate value based on the given query (root element of the query should be an aggregate function) (synchronously).
|
static java.util.concurrent.Future<java.lang.Long> |
retrieveXPathQueryAggregateAsync(IContext context,
java.lang.String xpathQuery)
Retrieves long aggregate value based on the given query (root element of the query should be an aggregate function) (asynchronously).
|
static java.util.concurrent.Future<java.lang.Double> |
retrieveXPathQueryAggregateAsyncDouble(IContext context,
java.lang.String xpathQuery)
Retrieves long value based on the given query (query should have an aggregate function as root element).
|
static java.lang.Double |
retrieveXPathQueryAggregateDouble(IContext context,
java.lang.String xpathQuery)
Retrieves double aggregate value based on the given query (root element of the query should be an aggregate function) (synchronously).
|
static java.lang.Long |
retrieveXPathQueryAggregateSchema(IContext context,
java.lang.String xpathQuery,
IRetrievalSchema retrievalSchema)
Retrieves long aggregate value based on the given query and schema (root element of the query should be an aggregate function).
|
static java.lang.Long |
retrieveXPathQueryAggregateSchema(IContext context,
java.lang.String xpathQuery,
IRetrievalSchema retrievalSchema,
boolean disableSecurity)
Retrieves long aggregate value based on the given query and schema (root element of the query should be an aggregate function).
|
static java.util.concurrent.Future<java.util.List<IMendixObject>> |
retrieveXPathQueryAsync(IContext context,
java.lang.String xpathQuery,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort,
int depth)
Retrieves object list based on the given XPath query (asynchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathQueryEscaped(IContext context,
java.lang.String xpathFormat,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort,
int depth,
java.lang.String... params)
Deprecated.
As of release 7.17, replaced by
createXPathQuery(String) |
static java.util.List<IMendixObject> |
retrieveXPathQueryEscaped(IContext context,
java.lang.String xpathFormat,
java.lang.String... params)
Deprecated.
As of release 7.17, replaced by
createXPathQuery(String) |
static IDataTable |
retrieveXPathQueryRaw(IContext context,
java.lang.String xpathQuery,
int amount,
int offset,
java.util.Map<java.lang.String,java.lang.String> sort,
int depth)
Retrieves raw data (IDataTables) based on the given XPath query (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathSchema(IContext context,
java.lang.String xpathQuery,
IRetrievalSchema retrievalSchema,
boolean shouldRetrieveCount)
Retrieves objects based on the XPath query and given schema (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathSchema(IContext context,
java.lang.String xpathQuery,
IRetrievalSchema retrievalSchema,
boolean shouldRetrieveCount,
boolean disableSecurity)
Retrieves objects based on the XPath query and given schema (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathSchemaEscaped(IContext context,
java.lang.String xpathFormat,
IRetrievalSchema retrievalSchema,
boolean shouldRetrieveCount,
boolean disableSecurity,
java.lang.String... params)
Retrieves object list based on the given XPath query (synchronously).
|
static java.util.List<IMendixObject> |
retrieveXPathSchemaEscaped(IContext context,
java.lang.String xpathFormat,
IRetrievalSchema retrievalSchema,
boolean shouldRetrieveCount,
java.lang.String... params)
Deprecated.
As of release 7.17, replaced by
createXPathQuery(String) |
static IDataTable |
retrieveXPathSchemaRaw(IContext context,
java.lang.String xpathQuery,
boolean shouldRetrieveCount,
IRetrievalSchema retrievalSchema)
Retrieves raw data (IDataTables) based on the XPath query and given schema (synchronously).
|
static IMendixObject |
rollback(IContext context,
IMendixObject object)
Rollback changes of the object with the given id (synchronously).
|
static java.util.concurrent.Future<IMendixObject> |
rollbackAsync(IContext context,
IMendixObject object)
Rollback changes of the object with the given id (asynchronously).
|
static <R> java.util.concurrent.RunnableScheduledFuture<?> |
schedule(CoreAction<R> action,
long delay,
java.util.concurrent.TimeUnit timeUnit)
Schedule an action on a certain delay from now.
|
static <R> java.util.concurrent.RunnableScheduledFuture<?> |
schedule(java.lang.String actionName,
java.util.Date date)
Schedule an action on a certain date.
|
static <R> void |
scheduleAtFixedRate(CoreAction<R> action,
java.util.Date firstRun,
long period,
java.util.concurrent.TimeUnit timeUnit)
Schedule a periodic action that run for the first time on the given date/time,
and subsequently with the given period; that is executions will commence on firstRun then
initialDelay+period, then initialDelay + 2 * period, and so on.
No result will be returned. |
static <R> void |
scheduleAtFixedRate(CoreAction<R> action,
long initialDelay,
long period,
java.util.concurrent.TimeUnit timeUnit)
Schedule a periodic action that runs for the first time after the given initial delay,
and subsequently with the given period; that is executions will commence after initialDelay then
initialDelay+period, then initialDelay + 2 * period, and so on.
|
static <R> void |
scheduleAtFixedRate(java.lang.String actionName,
java.util.Date firstRun,
long period,
java.util.concurrent.TimeUnit timeUnit,
java.lang.String name,
java.lang.String description)
Schedule a periodic action that runs for the first time after the given initial delay (first run),
and subsequently with the given period; that is executions will commence after initialDelay then
initialDelay+period, then initialDelay + 2 * period, and so on.
|
static <R> void |
scheduleWithFixedDelay(CoreAction<R> action,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit timeUnit)
Schedule a periodic action that runs for the first time after the given initial delay,
and subsequently with the given delay between the termination of one execution and the commencement of the next.
|
static void |
storeFileDocumentContent(IContext context,
IMendixObject fileDocument,
java.io.InputStream inputStream)
Physically stores a file using the given input stream and commits the file document.
|
static void |
storeFileDocumentContent(IContext context,
IMendixObject fileDocument,
java.lang.String fileName,
java.io.InputStream inputStream)
Physically stores a file using the given input stream and commits the file document.
|
static void |
storeImageDocumentContent(IContext context,
IMendixObject imageDocument,
java.io.InputStream inputStream,
int thumbnailWidth,
int thumbnailHeight)
Physically stores an image using the given input stream and commits the image document.
|
static void |
unregisterProfiler() |
public static void initialize(ICore core, Http http, Integration integration, DataStorage dataStorage, Metrics metrics)
public static DataStorage dataStorage()
DataStorage
.public static Http http()
Http
.public static Integration integration()
Integration
.public static Metrics metrics()
public static boolean isInDevelopment()
public static java.lang.String getXASId()
public static java.util.Set<java.lang.String> getMicroflowNames()
public static java.util.Map<java.lang.String,IDataType> getInputParameters(java.lang.String actionName)
actionName
- the name of a microflow or java action (format "ModuleName.ActionName").public static IDataType getReturnType(java.lang.String actionName)
actionName
- the name of a microflow or java action (format "ModuleName.ActionName").public static java.lang.Object evaluateExpression(IContext context, java.util.Map<java.lang.String,java.lang.Object> variables, java.lang.String expression)
context
- the contextvariables
- name of variables referenced in the expression (without '$') and their values.expression
- the expressionpublic static MicroflowCallBuilder microflowCall(java.lang.String name)
Core.microflowCall("AModule.SomeMicroflow") .withParam("Param1", "Value1") .withParam("Param2", "Value2") .executeInBackground(context, "DEFAULT");
name
- the name of the microflow call to prepareMicroflowCallBuilder
public static <T extends CoreAction<R>,R> java.util.concurrent.Future<R> execute(T action)
T
- action type, subclass of CoreAction.R
- result type of the action, can be any object.action
- the action to execute.public static <R> R execute(IContext context, java.lang.String actionName, java.lang.Object... params) throws CoreException
Note that when called with a microflow, primitives will not be passed and multiple arguments that are a subtype of a microflow parameter will not work as expected.
When calling microflows use execute(IContext, String, boolean, Map)
instead.
context
- the contextactionName
- the name of the user action or microflowparams
- the objects to be passed to either the constructor of the Java action or the microflow in
which case one can pass IMendixObject, IMendixIdentifier or primitive values.CoreException
public static <R> R execute(IContext context, java.lang.String actionName, java.util.Map<java.lang.String,java.lang.Object> params) throws CoreException
context
- the context for this action.actionName
- the name of a microflow or java action (format "ModuleName.ActionName").params
- action parameters by name.CoreException
public static <R> R execute(IContext context, java.lang.String actionName, boolean executeInTransaction, java.util.Map<java.lang.String,java.lang.Object> params) throws CoreException
context
- the context for this action.actionName
- the name of a microflow or java action (format "ModuleName.ActionName").executeInTransaction
- defines whether the action should be execute in a transaction (enables rolling back changes when exceptions
are raised).params
- action parameters by name.CoreException
public static <T extends CoreAction<R>,R> R executeSync(T action) throws CoreException
T
- action type, subclass of CoreAction.R
- result type of action, can be any object.action
- the action to execute.CoreException
public static <R> java.util.concurrent.Future<R> executeAsync(IContext context, java.lang.String actionName, java.lang.Object... params) throws CoreException
executeAsync(IContext, String, boolean, Map)
with a named parameter map instead.
Result is given and/or exceptions are raised when calling Future.get().
When calling Future.get() the result of the action will return immediately if the execution is done,
otherwise the call is blocking. Exceptions raised while executing the action will not be thrown until
Future.get() is called.context
- the context for this action.actionName
- the name of a microflow or java action (format "ModuleName.ActionName").params
- ordered params for the Java action.CoreException
public static <R> java.util.concurrent.Future<R> executeAsync(IContext context, java.lang.String microflowName, boolean executeInTransaction, java.util.Map<java.lang.String,java.lang.Object> params) throws CoreException
context
- the context for this microflow.microflowName
- the name of the microflow (format "ModuleName.ActionName").executeInTransaction
- defines whether the microflow should be executed in a transaction (enables rolling back changes when
exceptions are raised).params
- microflow parameters by name.CoreException
public static <T extends CoreAction<R>,R> void executeVoid(T action)
R
- result type of the action, can be any object.T
- action type, subclass of CoreAction.action
- the action to execute.public static <R> java.util.concurrent.RunnableScheduledFuture<?> schedule(java.lang.String actionName, java.util.Date date) throws CoreException
actionName
- the name of a microflow or java action (format "ModuleName.ActionName")date
- the date and time on which the action should be executedCoreException
public static <R> java.util.concurrent.RunnableScheduledFuture<?> schedule(CoreAction<R> action, long delay, java.util.concurrent.TimeUnit timeUnit)
action
- the action to execute.delay
- the delay after which the action should be executed.timeUnit
- time unit in which the delay is specified.public static <R> void scheduleAtFixedRate(java.lang.String actionName, java.util.Date firstRun, long period, java.util.concurrent.TimeUnit timeUnit, java.lang.String name, java.lang.String description)
actionName
- the name of a microflow or java action (format "ModuleName.ActionName").firstRun
- the date on which the action will be executed the first time.period
- the period between each start of the execution of the action.timeUnit
- the timeUnit in which the initialDelay and the period is specified.name
- the name of the scheduled event.description
- the description of the scheduled event.public static <R> void scheduleAtFixedRate(CoreAction<R> action, long initialDelay, long period, java.util.concurrent.TimeUnit timeUnit)
action
- the action to execute.initialDelay
- the delay after which the action will be executed the first time.period
- the period between each start of the execution of the action.timeUnit
- the timeUnit in which the initialDelay and the period is specified.public static <R> void scheduleAtFixedRate(CoreAction<R> action, java.util.Date firstRun, long period, java.util.concurrent.TimeUnit timeUnit)
action
- the action to executefirstRun
- the Date/time on which the action will be executed the first timeperiod
- the period between each start of the execution of the actiontimeUnit
- the timeUnit in which the period is specifiedpublic static <R> void scheduleWithFixedDelay(CoreAction<R> action, long initialDelay, long delay, java.util.concurrent.TimeUnit timeUnit)
action
- the action to execute.initialDelay
- the delay after which the action will be executed the first time.delay
- the delay between the end of the execution of the action and the start of the next time the action will be
executed.timeUnit
- the timeUnit in which the initialDelay and the delay is specified.public static boolean removeScheduledFuture(java.util.concurrent.RunnableScheduledFuture<?> scheduledFuture)
scheduledFuture
- the RunnableScheduledFuture to remove.public static <R> java.util.concurrent.ScheduledFuture<?> reschedule(java.util.concurrent.RunnableScheduledFuture<R> scheduledFuture, CoreAction<R> action, long newDelay, java.util.concurrent.TimeUnit timeUnit)
scheduledFuture
- the scheduledFuture (old action) to remove from the queue.action
- the action to reschedule.newDelay
- the new delay.timeUnit
- time unit of the delay.public static ListenersRegistry getListenersRegistry()
ListenersRegistry
which can be used to register
callbacks for commit, create, change and delete actions on all persistable entities in the application.@Deprecated public static <T extends CoreAction<?>> void addListener(ActionListener<T> al)
ListenersRegistry.addListener(ActionListener)
al
- the ActionListener to add.public static java.util.List<java.util.concurrent.Future<java.util.List<IMendixObject>>> commitAsync(IContext context, java.util.List<IMendixObject> objects)
context
- the context.objects
- the IMendixObjects to commit.public static IMendixObject commit(IContext context, IMendixObject object) throws CoreException
context
- the context.object
- the IMendixObject to commit.CoreRuntimeException
- if commit failsCoreException
public static java.util.List<IMendixObject> commit(IContext context, java.util.List<IMendixObject> objects)
context
- the context.objects
- the objects to commit.CoreRuntimeException
- if commit failspublic static IMendixObject commitWithoutEvents(IContext context, IMendixObject object)
Commits the given object without events. This will store the object in the database and remove it from the server cache.
This action is executed in a transaction.
Validations except unique validation are not executed. It is possible to save an entity which would not pass validations using this method.
context
- the context.object
- the IMendixObject to commit.CoreRuntimeException
- if commit failspublic static java.util.List<IMendixObject> commitWithoutEvents(IContext context, java.util.List<IMendixObject> objects)
Commits the given objects without events. This will store the objects in the database and remove it from the server cache.
This action is executed in a transaction.
Validations except unique validation are not executed. It is possible to save entities which would not pass validations using this method.
context
- the context.objects
- the objects to commit.CoreRuntimeException
- if commit failspublic static java.util.concurrent.Future<IMendixObject> instantiateAsync(IContext context, java.lang.String objectType)
context
- the context.objectType
- type of object to create (e.g. "System.User").public static IMendixObject instantiate(IContext context, java.lang.String objectType)
context
- the context.objectType
- type of object to create (e.g. "System.User").public static boolean change(IContext context, IMendixObject object, java.util.Map<java.lang.String,java.lang.String> changes) throws CoreException
context
- the context.object
- the object to change.changes
- contains changes by member name (e.g. <"Name", "User1">).CoreException
public static java.util.concurrent.Future<java.lang.Boolean> changeAsync(IContext context, IMendixObject obj, java.util.Map<java.lang.String,java.lang.String> changes)
context
- the context.obj
- the MendixObject to changechanges
- contains changes by member name (e.g. <"Name", "User1">).public static java.util.concurrent.Future<IMendixObject> rollbackAsync(IContext context, IMendixObject object)
context
- the context.object
- the object to rollback.public static IMendixObject rollback(IContext context, IMendixObject object) throws CoreException
context
- the context.object
- the object to rollback.CoreException
public static boolean delete(IContext context, IMendixObject... objects)
context
- the context.objects
- the objects to delete.public static boolean delete(IContext context, java.util.List<IMendixObject> objectList)
context
- the context.objectList
- the objects to delete.public static boolean deleteWithoutEvents(IContext context, java.util.List<IMendixObject> objects, boolean useDeleteBehavior)
context
- the context.objects
- the objects to delete.public static java.util.List<java.util.concurrent.Future<java.lang.Boolean>> deleteAsync(IContext context, IMendixObject object, boolean useDeleteBehavior)
context
- the context.object
- the object to delete.useDeleteBehavior
- whether to use delete behavior.public static java.util.List<java.util.concurrent.Future<java.lang.Boolean>> deleteAsync(IContext context, java.util.List<IMendixObject> objects, boolean useDeleteBehavior)
context
- the context.objects
- the objects to delete.useDeleteBehavior
- whether to use delete behavior.public static java.util.concurrent.Future<java.util.List<IMendixObject>> retrieveIdListAsync(IContext context, java.util.List<IMendixIdentifier> ids)
context
- the context.ids
- ids of the objects to retrieve.public static java.util.List<IMendixObject> retrieveIdList(IContext context, java.util.List<IMendixIdentifier> ids, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort) throws CoreException
context
- the context.ids
- ids of the objects to retrieve.amount
- the maximum number of objects to retrieve from the database.offset
- offset of returned objects when retrieved from the database.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).CoreException
public static java.util.List<IMendixObject> retrieveIdList(IContext context, java.util.List<IMendixIdentifier> ids) throws CoreException
context
- the context.ids
- ids of the objects to retrieve.CoreException
public static java.util.concurrent.Future<IMendixObject> retrieveIdAsync(IContext context, IMendixIdentifier id)
context
- the context.id
- id of the object to retrieve.public static IMendixObject retrieveId(IContext context, IMendixIdentifier id) throws CoreException
context
- the context.id
- id of the object to retrieve.CoreException
public static java.util.List<IMendixObject> retrieveByPath(IContext context, IMendixObject mxObject, java.lang.String path)
context
- the context.mxObject
- the start point of the path.path
- the path (association) to the objects to retrieve.public static java.util.List<IMendixObject> retrieveByPath(IContext context, IMendixObject mxObject, java.lang.String path, boolean isSelfAssociationChild)
context
- the context.mxObject
- the start point of the path.path
- the path (association) to the objects to retrieve.isSelfAssociationChild
- defines whether the mxObject instance is the child of the path of a self association.public static java.util.concurrent.Future<java.util.List<IMendixObject>> retrieveXPathQueryAsync(IContext context, java.lang.String xpathQuery, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort, int depth)
context
- the context.xpathQuery
- the XPath query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).depth
- indicates the level until which each reference (IMendixIdentifier) is also retrieved as an IMendixObject.public static java.util.List<IMendixObject> retrieveXPathQuery(IContext context, java.lang.String xpathQuery, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort, int depth) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).depth
- indicates the level until which each reference (IMendixIdentifier) is also retrieved as an IMendixObject.CoreException
public static java.util.List<IMendixObject> retrieveXPathQuery(IContext context, java.lang.String xpathQuery, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).CoreException
public static java.util.List<IMendixObject> retrieveXPathQuery(IContext context, java.lang.String xpathQuery, int depth) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.depth
- indicates the level until which each reference (IMendixIdentifier) is also retrieved as an IMendixObject.CoreException
public static java.util.List<IMendixObject> retrieveXPathQuery(IContext context, java.lang.String xpathQuery) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.CoreException
public static IDataTable retrieveXPathQueryRaw(IContext context, java.lang.String xpathQuery, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort, int depth) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).depth
- indicates the level until which each reference (IMendixIdentifier) is also retrieved as an IMendixObject.CoreException
public static IDataTable retrieveXPathSchemaRaw(IContext context, java.lang.String xpathQuery, boolean shouldRetrieveCount, IRetrievalSchema retrievalSchema) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.shouldRetrieveCount
- indicates whether the total number object corresponding to the given schema should be included in the
result.retrievalSchema
- the schema to apply.CoreException
public static java.util.List<IMendixObject> retrieveXPathSchema(IContext context, java.lang.String xpathQuery, IRetrievalSchema retrievalSchema, boolean shouldRetrieveCount) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.retrievalSchema
- the schema to apply.shouldRetrieveCount
- indicates whether the total number object corresponding to the given schema should be included in the
result.CoreException
public static java.util.List<IMendixObject> retrieveXPathSchema(IContext context, java.lang.String xpathQuery, IRetrievalSchema retrievalSchema, boolean shouldRetrieveCount, boolean disableSecurity) throws CoreException
context
- the context.xpathQuery
- the XPath query to execute.retrievalSchema
- the schema to apply.shouldRetrieveCount
- indicates whether the total number object corresponding to the given schema should be included in the
result.disableSecurity
- indicates whether security should be applied when this query is being executed.CoreException
@Deprecated public static java.util.List<IMendixObject> retrieveXPathQueryEscaped(IContext context, java.lang.String xpathFormat, int amount, int offset, java.util.Map<java.lang.String,java.lang.String> sort, int depth, java.lang.String... params) throws CoreException
createXPathQuery(String)
context
- the context.xpathFormat
- the XPath query to execute with %s for each param to escape.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.sort
- sorting of returned objects when retrieved from the database (e.g. <"Name", "ASC">, <"Age", "DESC">).depth
- depth of the retrieval (0 is all attributes and association guids, 1 is also all attributes of 1-deep associations
and 2-deep associaton guids etc.).params
- xpath arguments.CoreException
@Deprecated public static java.util.List<IMendixObject> retrieveXPathQueryEscaped(IContext context, java.lang.String xpathFormat, java.lang.String... params) throws CoreException
createXPathQuery(String)
context
- the context.xpathFormat
- the XPath query to execute with %s for each param to escape.params
- a collection of parameters for each %s in xpathFormat.CoreException
@Deprecated public static java.util.List<IMendixObject> retrieveXPathSchemaEscaped(IContext context, java.lang.String xpathFormat, IRetrievalSchema retrievalSchema, boolean shouldRetrieveCount, java.lang.String... params) throws CoreException
createXPathQuery(String)
context
- the context.xpathFormat
- the XPath query to execute with %s for each param to escape.retrievalSchema
- the schema to apply.shouldRetrieveCount
- indicates whether the total number object corresponding to the given schema should be included in the
result.params
- a collection of parameters for each %s in xpathFormat.CoreException
public static java.util.List<IMendixObject> retrieveXPathSchemaEscaped(IContext context, java.lang.String xpathFormat, IRetrievalSchema retrievalSchema, boolean shouldRetrieveCount, boolean disableSecurity, java.lang.String... params) throws CoreException
context
- the context.xpathFormat
- the XPath query to execute with %s for each param to escape.retrievalSchema
- the schema to apply.shouldRetrieveCount
- indicates whether the total number object corresponding to the given schema should be included in the
result.disableSecurity
- indicates whether security should be disabled when executing this query.params
- a collection of parameters for each %s in xpathFormat.CoreException
public static IRetrievalSchema createRetrievalSchema()
public static IXPathTextGetRequest createXPathTextGetRequest()
public static IOQLTextGetRequest createOQLTextGetRequest()
public static IOQLTextGetRequest createOQLTextGetRequestFromDataSet(java.lang.String dataSetQualifiedName)
IOQLTextGetRequest
from given qualified DataSet name.
Code examples
Example OQL query without parameters
private String getOqlQueryFromDataSet(String dataSetName) {
final IOQLTextGetRequest oqlTextGetRequest = Core.createOQLTextGetRequestFromDataSet(dataSetName);
return oqlTextGetRequest.getQuery();
}
public Report generateReport() {
String oqlQuery = getOqlQueryFromDataSet();
final IDataTable dataTable = Core.retrieveOQLDataTable(context, oqlQuery);
final List<? extends IDataRow> rows = dataTable.getRows();
Report report = new Report();
report.addRow(rows.get(0));
return report;
}
The above example first defines a getOqlQueryFromDataSet method at the top, which returns a OQL query in string format.
It takes a qualified dataSetName which means DataSet name along with its module name separated by '.' character.
For example, if the name of the DataSet is ReportGeneratorDataSet and it belongs to a module named Reporting
then the qualified DataSet name will be Reporting.ReportGeneratorDataSet.
public Report generateReport(String dataSetName) {
final IOQLTextGetRequest oqlTextGetRequest = Core.createOQLTextGetRequestFromDataSet(dataSetName);
final IParameterMap newParameterMap = oqlTextGetRequest.createParameterMap();
newParameterMap.put("ParGroupNumber", 4); // Set value of ParGroupNumber parameter to 4
oqlTextGetRequest.setParameters(newParameterMap);
final IDataTable dataTable = Core.retrieveOQLDataTable(context, oqlTextGetRequest);
final List<? extends IDataRow> rows = dataTable.getRows();
Report report = new Report();
report.addRow(rows.get(0));
return report;
}
The above example defines a similar generateReport method as shown in the previous example, however in this case the given
DataSet has a OQL query which takes parameters.
Let us consider that the given DataSet contains following OQL query with a parameter named ParGroupNumber -
FROM CRM.Customers As CustomerObj
INNER JOIN CustomerObj/CRM.Orders_Customer/CRM.Orders As OrderObj
WHERE CustomerObj/CRM.Customer_Group/CRM.Group/GroupNumber = $ParGroupNumber
GROUP BY CustomerObj/Name
SELECT CustomerObj/Name As Name, SUM(OrderObj/TotalAmount) As TotalAmount
Using the DataSet name generateReport method first creates a oqlTextGetRequest. Next, in order to set the
ParGroupNumber parameter a new IParameterMap is instantiated and the value of ParGroupNumber parameter is specified,
which in the above example would be 4.
Finally we provide this newParameterMap to the setParameters method of IOQLTextGetRequest.
This modified request is then used to retrieve a data table from the database, which in turn is used to generate a report.dataSetQualifiedName
- the qualified name of the DataSet containing OQLIOQLTextGetRequest
if DataSet with OQL is found by given namejava.lang.IllegalArgumentException
- if given qualified name is null, has invalid format, found DataSet
contains Java Action or DataSet is not foundpublic static XPathQuery createXPathQuery(java.lang.String xpathQuery)
Can be used to create and execute XPath queries in a fluent manner. For example:
public getObjectsWithValue(IContext context, ICore core, int value) {
List<IMendixObject> results = core.createXPathQuery("//Entity[attribute=$value]")
.setVariable("value", 1)
.setAmount(500)
.setOffset(50)
.setDepth(1)
.execute(context);
return results;
}
After the XPath query
is built up, XPathQueryBase.execute(IContext)
can be called to retrieve the results.
xpathQuery
- the XPath query to execute. Variable can be denoted with '$', e.g. a valid query syntax could be
'//Entity.Ref[field >= $limit)'.XPathQuery
that can be use to construct an XPath querypublic static java.util.concurrent.Future<IDataTable> retrieveOQLDataTableAsync(IContext context, java.lang.String oqlQuery)
context
- context to be used to process this requestoqlQuery
- the OQL query to execute.public static java.util.concurrent.Future<IDataTable> retrieveOQLDataTableAsync(IContext context, IGetRequest request)
context
- context to be used to process this requestrequest
- the request object.public static java.util.concurrent.Future<IDataTable> retrieveOQLDataTableAsync(IContext context, java.lang.String oqlQuery, int amount, int offset)
context
- context to be used to process this requestoqlQuery
- the OQL query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.public static IDataTable retrieveOQLDataTable(IContext context, IGetRequest request) throws CoreException
context
- context to be used to process this requestrequest
- the request object.CoreException
public static IDataTable retrieveOQLDataTable(IContext context, java.lang.String oqlQuery) throws CoreException
context
- context to be used to process this requestoqlQuery
- the OQL query to execute.CoreException
public static IDataTable retrieveOQLDataTable(IContext context, java.lang.String oqlQuery, int amount, int offset) throws CoreException
context
- context to be used to process this requestoqlQuery
- the OQL query to execute.amount
- maximum number of objects to retrieve.offset
- index of first object to retrieve.CoreException
public static java.util.concurrent.Future<java.lang.Long> retrieveXPathQueryAggregateAsync(IContext context, java.lang.String xpathQuery)
context
- context to be used to process this requestxpathQuery
- the aggregate xpath query (e.g. "COUNT(//System.User)").public static java.lang.Long retrieveXPathQueryAggregate(IContext context, java.lang.String xpathQuery) throws CoreException
context
- context to be used to process this requestxpathQuery
- the aggregate xpath query (e.g. "COUNT(//System.User)").CoreException
public static java.lang.Long retrieveXPathQueryAggregateSchema(IContext context, java.lang.String xpathQuery, IRetrievalSchema retrievalSchema) throws CoreException
context
- context to be used to process this requestxpathQuery
- the aggregate xpath query (e.g. "COUNT(//System.User)").retrievalSchema
- the schema.CoreException
public static java.lang.Long retrieveXPathQueryAggregateSchema(IContext context, java.lang.String xpathQuery, IRetrievalSchema retrievalSchema, boolean disableSecurity) throws CoreException
context
- context to be used to process this requestxpathQuery
- the aggregate xpath query (e.g. "COUNT(//System.User)").retrievalSchema
- the schema.disableSecurity
- whether security should be applied for this retrieval.CoreException
public static java.util.concurrent.Future<java.lang.Double> retrieveXPathQueryAggregateAsyncDouble(IContext context, java.lang.String xpathQuery)
context
- context to be used to process this requestxpathQuery
- the aggregate XPath query (e.g. "COUNT(//System.User)")public static java.lang.Double retrieveXPathQueryAggregateDouble(IContext context, java.lang.String xpathQuery) throws CoreException
context
- context to be used to process this requestxpathQuery
- the aggregate XPath query (e.g. "COUNT(//System.User)")CoreException
public static java.io.InputStream getFileDocumentContent(IContext context, IMendixObject fileDocument)
context
- the context.fileDocument
- the file document from which the contents will be returned.public static void storeFileDocumentContent(IContext context, IMendixObject fileDocument, java.lang.String fileName, java.io.InputStream inputStream)
context
- the context.fileDocument
- the file document to which the file to store is linked to.fileName
- the original name of the file (will be stored in the Name attribute)inputStream
- the content of the filepublic static void storeFileDocumentContent(IContext context, IMendixObject fileDocument, java.io.InputStream inputStream)
context
- the context.fileDocument
- the file document to which the file to store is linked to.inputStream
- the content of the filepublic static void storeImageDocumentContent(IContext context, IMendixObject imageDocument, java.io.InputStream inputStream, int thumbnailWidth, int thumbnailHeight)
context
- the context.imageDocument
- the image document to which the image to store is linked to.inputStream
- the content of the filethumbnailWidth
- the width of the thumbnail to create for this image.thumbnailHeight
- the width of the thumbnail to create for this image.public static java.io.InputStream getImage(IContext context, IMendixObject imageDocument, boolean retrieveThumbnail)
context
- the context.imageDocument
- the image document for which its contents are retrieved.retrieveThumbnail
- indicates whether a thumbnail or the full image is retrieved.public static boolean isSubClassOf(java.lang.String superClass, java.lang.String type)
superClass
- the name of the super classtype
- the name of the type to checkpublic static boolean isSubClassOf(IMetaObject superObject, IMetaObject type)
superObject
- the super object.type
- the name of the type to check.public static boolean isSubClassOf(java.lang.String superClass, short typeHash)
superClass
- the name of the super classtypeHash
- the hash of the name of the type to checkpublic static java.lang.Iterable<IMendixObject> getAllMendixObjects()
public static java.util.List<java.lang.String> getSubtypesOf(java.lang.String objectType)
objectType
- the object type.public static IMetaObject getMetaObject(java.lang.String metaObjectName)
metaObjectName
- the meta object name.public static IMetaPrimitive getMetaPrimitive(java.lang.String qualifiedAttributeName)
qualifiedAttributeName
- the qualified attribute name.public static java.lang.Iterable<IMetaObject> getMetaObjects()
public static java.lang.Iterable<IMetaAssociation> getMetaAssociations()
public static IMetaAssociation getMetaAssociation(java.lang.String association)
association
- the association name (e.g. "System.UserRoles").public static java.lang.String getDatabaseTableName(IMetaObject metaObject)
metaObject
- the meta object to get the database table name forpublic static java.lang.String getDatabaseTableName(IMetaAssociation metaAssociation)
metaAssociation
- the meta association to get the database table name forpublic static java.lang.String getDatabaseColumnName(IMetaPrimitive metaPrimitive)
metaPrimitive
- the meta primitive to get the database column name forpublic static java.lang.String getDatabaseChildColumnName(IMetaAssociation metaAssociation)
metaAssociation
- the meta association to get the database child column name forpublic static java.lang.String getDatabaseParentColumnName(IMetaAssociation metaAssociation)
metaAssociation
- the meta association to get the database parent column name forpublic static IContext createSystemContext()
public static ISession getSessionById(java.util.UUID sessionId)
sessionId
- A session id.public static IMendixIdentifier createMendixIdentifier(java.lang.String guid)
guid
- the guid.public static IMendixIdentifier createMendixIdentifier(long guid)
guid
- the guid.public static boolean authenticate(IContext context, IUser user, java.lang.String password) throws CoreException
CoreException
public static ISession login(java.util.Map<java.lang.String,? extends java.lang.Object> params) throws CoreException
params
- the params.CoreException
public static ISession login(java.lang.String userName, java.lang.String password) throws CoreException
userName
- the user name.password
- the password.CoreException
public static ISession login(java.lang.String userName, java.lang.String password, java.lang.String currentSessionId) throws CoreException
userName
- the user name.password
- the password.currentSessionId
- current session UUID.CoreException
public static ISession login(java.lang.String userName, java.lang.String password, com.mendix.m2ee.api.IMxRuntimeRequest request) throws CoreException
CoreException
public static void logout(ISession session)
session
- the session to logout.public static IUser getUser(IContext context, java.lang.String userName) throws CoreException
context
- the context.userName
- the user name to retrieve a user for.CoreException
public static ISession initializeSession(IUser user, java.lang.String currentSessionId) throws CoreException
user
- the user for which the session should be initialized.currentSessionId
- id of the current session, will be used to transfer data when current session is associated with a guest user.CoreException
public static ISession initializeGuestSession() throws CoreException
CoreException
public static void addRequestHandler(java.lang.String path, RequestHandler requestHandler)
path
- the path for which request should be processed.requestHandler
- the custom request handler.public static com.mendix.logging.ILogNode getLogger(java.lang.String name)
public static Configuration getConfiguration()
public static java.lang.Object resolveTokens(IContext context, java.lang.String text)
text
- the text to resolve.context
- the context.public static int getActiveActionCount()
public static long getCompletedActionCount()
public static int getActionQueueSize()
public static int getCurrentPoolSize()
public static int getLargestPoolSize()
public static int getScheduledActionCount()
public static int getMaximumNumberConcurrentUsers() throws CoreException
CoreException
public static long getNumberConcurrentSessions()
@Deprecated public static java.util.Collection<? extends ISession> getActiveSessions()
@Deprecated public static ISession getActiveSession(java.lang.String userName)
userName
- the user name associated with the session to search for.public static long getNamedUserCount()
public static long getConcurrentUserCount(boolean anonymous)
anonymous
- whether anonymous users should be included in the count.public static java.lang.String getInternationalizedString(IContext context, java.lang.String key, java.lang.Object... args)
context
- the context.key
- the key referring to the translatable string.args
- the arguments which should be applied to translatable string template.public static java.lang.String getInternationalizedString(java.lang.String languageCode, java.lang.String key, java.lang.Object... args)
languageCode
- the language code (ISO-639).key
- the key referring to the translatable string.args
- values which should replace possible templates in the translatable string ({1}, {2}, etc.).public static ILanguage getDefaultLanguage()
public static java.util.Locale getLocale(IContext context)
context
- the context.public static java.util.Locale getLocale(java.lang.String languageCode)
languageCode
- the languageCode (ISO-639).public static java.util.Date getStartupDateTime()
public static void registerLogSubscriber(com.mendix.logging.LogSubscriber subscriber)
public static void buildException(java.lang.StringBuilder trace, java.lang.Throwable throwable)
trace
- the StringBuilder the exception is printed to.throwable
- the Throwable to print.public static void addUserAction(java.lang.Class<? extends UserAction<?>> userActionClass)
Core.execute(actionName)
for this action.userActionClass
- the fully qualified class name of the action (e.g. com.mendix.action.MyAction).public static IDataType createDataType(java.lang.String type)
type
- the type to base the IDataType on.public static IDataType createDataType(java.lang.String objectType, java.lang.String attributeName)
objectType
- the object type (format: "ModuleName.EntityName").attributeName
- the attribute to create the IDataType for (should be a member of above object type)public static IProfiler getProfiler()
public static void registerProfiler(IProfiler profiler) throws MendixException
MendixException
public static void unregisterProfiler()
@Deprecated public static java.util.List<IMendixObject> importStream(IContext context, java.io.InputStream stream, java.lang.String importMappingName, IMendixObject mappingParameter, java.lang.Boolean shouldValidate)
context
- the context.stream
- the XML or JSON stream to map and store.importMappingName
- name of the mapping document, containing the mapping of the XML or JSON to domain model objects.mappingParameter
- parameter object used during the mapping (optional)shouldValidate
- whether the XML should be validated (not supported for JSON).@Deprecated public static java.io.InputStream exportStream(IContext context, java.lang.String exportMappingName, IMendixObject objectToExport, java.lang.Boolean shouldValidate)
context
- the context.exportMappingName
- name of the mapping document, containing the mapping of the domain model objects to XML or JSON.objectToExport
- Domain model object to export to JSON or XML using the specified export mapping.shouldValidate
- whether the XML should be validated (not supported for JSON).public static java.util.UUID getProjectId()
public static java.lang.String getModelVersion()