Skip to content
Snippets Groups Projects
Commit 7e8da889 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

documentation

parent af0e302f
No related branches found
No related tags found
No related merge requests found
......@@ -36,12 +36,17 @@ ContextUtils.getContextName = function(pContextId)
return pContextId;
}
/**
*
* @param {Boolean} [pFilter=false] filter only for contexts which have a mapping in ContextUtils._getSelectMap
*
* @return {String[][]} the contexts [[contextId, contextName, contextTitle], [... ], ...]
*/
ContextUtils.getContexts = function(pFilter)
{
if (pFilter == undefined)
pFilter = false;
var contexts = project.getDataModels(project.DATAMODEL_KIND_CONTEXT);
if (pFilter)
......@@ -55,23 +60,38 @@ ContextUtils.getContexts = function(pFilter)
return contexts.map(ContextUtils._contextDataMapping).sort(function(pContext1, pContext2)
{
// sort after ContextTitle
if (pContext1[2] > pContext2[2])
return 1;
{
// sort after ContextTitle
if (pContext1[2] > pContext2[2])
return 1;
if (pContext1[2] < pContext2[2])
return -1;
if (pContext1[2] < pContext2[2])
return -1;
return 0;
});
return 0;
});
}
/**
* get the data of a context
*
* @param {String} pContextId the id of the context
*
* @return {String[]} the contextdata [contextId, contextName, contextTitle]
*/
ContextUtils.getContext = function(pContextId)
{
return ContextUtils._contextDataMapping(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, pContextId));
}
/**
* map the contextData from the system.project-lib to [contextId, contextName, contextTitle]
*
* @param {String[]} pContext the data of a context (e.g. from project.getDataModel())
*
* @return {String[]} the contextdata [contextId, contextName, contextTitle]
* @ignore
*/
ContextUtils._contextDataMapping = function(pContext)
{
var contextName = ContextUtils.getContextName(pContext[0]);
......@@ -127,7 +147,7 @@ ContextUtils.getNameSql = function(pContextId, pRowId)
}
/**
* TODO: Evtl ein anderer Weg ohne hard gecodedeten Selects.
* TODO: !!!temporary function until you can get fields from another Entity!!!
*/
ContextUtils.getContextDataSql = function(pContextId, pRowId)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment