repo
stringlengths 5
67
| path
stringlengths 4
116
| func_name
stringlengths 0
58
| original_string
stringlengths 52
373k
| language
stringclasses 1
value | code
stringlengths 52
373k
| code_tokens
list | docstring
stringlengths 4
11.8k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 86
226
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sName) {
if (this._oDimensionSet[sName]) { // the easy case
return this._oDimensionSet[sName];
}
for ( var sDimensionName in this._oDimensionSet) {
var oDimension = this._oDimensionSet[sDimensionName];
var oTextProperty = oDimension.getTextProperty();
if (oTextProperty && oTextProperty.name == sName) {
return oDimension;
}
if (oDimension.findAttributeByName(sName)) {
return oDimension;
}
}
return null;
}
|
javascript
|
function(sName) {
if (this._oDimensionSet[sName]) { // the easy case
return this._oDimensionSet[sName];
}
for ( var sDimensionName in this._oDimensionSet) {
var oDimension = this._oDimensionSet[sDimensionName];
var oTextProperty = oDimension.getTextProperty();
if (oTextProperty && oTextProperty.name == sName) {
return oDimension;
}
if (oDimension.findAttributeByName(sName)) {
return oDimension;
}
}
return null;
}
|
[
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"this",
".",
"_oDimensionSet",
"[",
"sName",
"]",
")",
"{",
"return",
"this",
".",
"_oDimensionSet",
"[",
"sName",
"]",
";",
"}",
"for",
"(",
"var",
"sDimensionName",
"in",
"this",
".",
"_oDimensionSet",
")",
"{",
"var",
"oDimension",
"=",
"this",
".",
"_oDimensionSet",
"[",
"sDimensionName",
"]",
";",
"var",
"oTextProperty",
"=",
"oDimension",
".",
"getTextProperty",
"(",
")",
";",
"if",
"(",
"oTextProperty",
"&&",
"oTextProperty",
".",
"name",
"==",
"sName",
")",
"{",
"return",
"oDimension",
";",
"}",
"if",
"(",
"oDimension",
".",
"findAttributeByName",
"(",
"sName",
")",
")",
"{",
"return",
"oDimension",
";",
"}",
"}",
"return",
"null",
";",
"}"
] |
Find dimension by property name
@param {string}
sName Property name
@returns {sap.ui.model.analytics.odata4analytics.Dimension} The dimension object to
which the given property name is related, because the property
holds the dimension key, its text, or is an attribute of this
dimension. If no such dimension exists, null is returned.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResult#findDimensionByPropertyName
|
[
"Find",
"dimension",
"by",
"property",
"name"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1105-L1121
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty && oFormattedValueProperty.name == sName) {
return oMeasure;
}
}
return null;
}
|
javascript
|
function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty && oFormattedValueProperty.name == sName) {
return oMeasure;
}
}
return null;
}
|
[
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
")",
"{",
"return",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
";",
"}",
"for",
"(",
"var",
"sMeasureName",
"in",
"this",
".",
"_oMeasureSet",
")",
"{",
"var",
"oMeasure",
"=",
"this",
".",
"_oMeasureSet",
"[",
"sMeasureName",
"]",
";",
"var",
"oFormattedValueProperty",
"=",
"oMeasure",
".",
"getFormattedValueProperty",
"(",
")",
";",
"if",
"(",
"oFormattedValueProperty",
"&&",
"oFormattedValueProperty",
".",
"name",
"==",
"sName",
")",
"{",
"return",
"oMeasure",
";",
"}",
"}",
"return",
"null",
";",
"}"
] |
Find measure by property name
@param {string}
sName Property name
@returns {sap.ui.model.analytics.odata4analytics.Measure} The measure object to which
the given property name is related, because the property holds
the raw measure value or its formatted value. If no such measure
exists, null is returned.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResult#findMeasureByPropertyName
|
[
"Find",
"measure",
"by",
"property",
"name"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1163-L1176
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(oQueryResult, oAssociation) {
this._oQueryResult = oQueryResult;
var sQAssocName = this._oEntityType.getSchema().namespace + "." + oAssociation.name;
var aNavProp = this._oEntityType.getTypeDescription().navigationProperty;
if (!aNavProp) {
throw "Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type";
}
for (var i = -1, oNavProp; (oNavProp = aNavProp[++i]) !== undefined;) {
if (oNavProp.relationship == sQAssocName) {
this._oNavPropToQueryResult = oNavProp.name;
}
}
if (!this._oNavPropToQueryResult) {
throw "Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type";
}
}
|
javascript
|
function(oQueryResult, oAssociation) {
this._oQueryResult = oQueryResult;
var sQAssocName = this._oEntityType.getSchema().namespace + "." + oAssociation.name;
var aNavProp = this._oEntityType.getTypeDescription().navigationProperty;
if (!aNavProp) {
throw "Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type";
}
for (var i = -1, oNavProp; (oNavProp = aNavProp[++i]) !== undefined;) {
if (oNavProp.relationship == sQAssocName) {
this._oNavPropToQueryResult = oNavProp.name;
}
}
if (!this._oNavPropToQueryResult) {
throw "Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type";
}
}
|
[
"function",
"(",
"oQueryResult",
",",
"oAssociation",
")",
"{",
"this",
".",
"_oQueryResult",
"=",
"oQueryResult",
";",
"var",
"sQAssocName",
"=",
"this",
".",
"_oEntityType",
".",
"getSchema",
"(",
")",
".",
"namespace",
"+",
"\".\"",
"+",
"oAssociation",
".",
"name",
";",
"var",
"aNavProp",
"=",
"this",
".",
"_oEntityType",
".",
"getTypeDescription",
"(",
")",
".",
"navigationProperty",
";",
"if",
"(",
"!",
"aNavProp",
")",
"{",
"throw",
"\"Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type\"",
";",
"}",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oNavProp",
";",
"(",
"oNavProp",
"=",
"aNavProp",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"oNavProp",
".",
"relationship",
"==",
"sQAssocName",
")",
"{",
"this",
".",
"_oNavPropToQueryResult",
"=",
"oNavProp",
".",
"name",
";",
"}",
"}",
"if",
"(",
"!",
"this",
".",
"_oNavPropToQueryResult",
")",
"{",
"throw",
"\"Invalid consumption model: Parameters entity type lacks navigation property for association to query result entity type\"",
";",
"}",
"}"
] |
to be called only by Model objects
|
[
"to",
"be",
"called",
"only",
"by",
"Model",
"objects"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1291-L1306
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (this._aParameterNames) {
return this._aParameterNames;
}
this._aParameterNames = [];
for ( var sName in this._oParameterSet) {
this._aParameterNames.push(this._oParameterSet[sName].getName());
}
return this._aParameterNames;
}
|
javascript
|
function() {
if (this._aParameterNames) {
return this._aParameterNames;
}
this._aParameterNames = [];
for ( var sName in this._oParameterSet) {
this._aParameterNames.push(this._oParameterSet[sName].getName());
}
return this._aParameterNames;
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_aParameterNames",
")",
"{",
"return",
"this",
".",
"_aParameterNames",
";",
"}",
"this",
".",
"_aParameterNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oParameterSet",
")",
"{",
"this",
".",
"_aParameterNames",
".",
"push",
"(",
"this",
".",
"_oParameterSet",
"[",
"sName",
"]",
".",
"getName",
"(",
")",
")",
";",
"}",
"return",
"this",
".",
"_aParameterNames",
";",
"}"
] |
Get the names of all parameters part of the parameterization
@returns {string[]} List of all parameter names
@public
@function
@name sap.ui.model.analytics.odata4analytics.Parameterization#getAllParameterNames
|
[
"Get",
"the",
"names",
"of",
"all",
"parameters",
"part",
"of",
"the",
"parameterization"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1337-L1349
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
var sPeerParamPropName = null;
if (this._oLowerIntervalBoundaryParameterProperty) {
sPeerParamPropName = this._oLowerIntervalBoundaryParameterProperty.name;
} else {
sPeerParamPropName = this._oUpperIntervalBoundaryParameterProperty.name;
}
if (!sPeerParamPropName) {
throw "Parameter is not an interval boundary";
}
return this._oParameterization.findParameterByName(sPeerParamPropName);
}
|
javascript
|
function() {
var sPeerParamPropName = null;
if (this._oLowerIntervalBoundaryParameterProperty) {
sPeerParamPropName = this._oLowerIntervalBoundaryParameterProperty.name;
} else {
sPeerParamPropName = this._oUpperIntervalBoundaryParameterProperty.name;
}
if (!sPeerParamPropName) {
throw "Parameter is not an interval boundary";
}
return this._oParameterization.findParameterByName(sPeerParamPropName);
}
|
[
"function",
"(",
")",
"{",
"var",
"sPeerParamPropName",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_oLowerIntervalBoundaryParameterProperty",
")",
"{",
"sPeerParamPropName",
"=",
"this",
".",
"_oLowerIntervalBoundaryParameterProperty",
".",
"name",
";",
"}",
"else",
"{",
"sPeerParamPropName",
"=",
"this",
".",
"_oUpperIntervalBoundaryParameterProperty",
".",
"name",
";",
"}",
"if",
"(",
"!",
"sPeerParamPropName",
")",
"{",
"throw",
"\"Parameter is not an interval boundary\"",
";",
"}",
"return",
"this",
".",
"_oParameterization",
".",
"findParameterByName",
"(",
"sPeerParamPropName",
")",
";",
"}"
] |
Get property for the parameter representing the peer boundary of the same
interval
@returns {sap.ui.model.analytics.odata4analytics.Parameter} The parameter representing
the peer boundary of the same interval. This means that if
*this* parameter is a lower boundary, the returned object
@public
@function
@name sap.ui.model.analytics.odata4analytics.Parameter#getPeerIntervalBoundaryParameter
|
[
"Get",
"property",
"for",
"the",
"parameter",
"representing",
"the",
"peer",
"boundary",
"of",
"the",
"same",
"interval"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1589-L1600
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (!this._sSuperOrdinateDimension) {
var oSuperOrdProperty = this._oQueryResult.getEntityType().getSuperOrdinatePropertyOfProperty(this.getName());
if (oSuperOrdProperty) {
this._sSuperOrdinateDimension = this._oQueryResult.findDimensionByName(oSuperOrdProperty.name);
}
}
return this._sSuperOrdinateDimension;
}
|
javascript
|
function() {
if (!this._sSuperOrdinateDimension) {
var oSuperOrdProperty = this._oQueryResult.getEntityType().getSuperOrdinatePropertyOfProperty(this.getName());
if (oSuperOrdProperty) {
this._sSuperOrdinateDimension = this._oQueryResult.findDimensionByName(oSuperOrdProperty.name);
}
}
return this._sSuperOrdinateDimension;
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_sSuperOrdinateDimension",
")",
"{",
"var",
"oSuperOrdProperty",
"=",
"this",
".",
"_oQueryResult",
".",
"getEntityType",
"(",
")",
".",
"getSuperOrdinatePropertyOfProperty",
"(",
"this",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"oSuperOrdProperty",
")",
"{",
"this",
".",
"_sSuperOrdinateDimension",
"=",
"this",
".",
"_oQueryResult",
".",
"findDimensionByName",
"(",
"oSuperOrdProperty",
".",
"name",
")",
";",
"}",
"}",
"return",
"this",
".",
"_sSuperOrdinateDimension",
";",
"}"
] |
Get super-ordinate dimension
@returns {object} The super-ordinate dimension or null if there is none
@public
@function
@name sap.ui.model.analytics.odata4analytics.Dimension#getSuperOrdinateDimension
|
[
"Get",
"super",
"-",
"ordinate",
"dimension"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1804-L1812
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (this._aAttributeNames) {
return this._aAttributeNames;
}
this._aAttributeNames = [];
for ( var sName in this._oAttributeSet) {
this._aAttributeNames.push(this._oAttributeSet[sName].getName());
}
return this._aAttributeNames;
}
|
javascript
|
function() {
if (this._aAttributeNames) {
return this._aAttributeNames;
}
this._aAttributeNames = [];
for ( var sName in this._oAttributeSet) {
this._aAttributeNames.push(this._oAttributeSet[sName].getName());
}
return this._aAttributeNames;
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_aAttributeNames",
")",
"{",
"return",
"this",
".",
"_aAttributeNames",
";",
"}",
"this",
".",
"_aAttributeNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oAttributeSet",
")",
"{",
"this",
".",
"_aAttributeNames",
".",
"push",
"(",
"this",
".",
"_oAttributeSet",
"[",
"sName",
"]",
".",
"getName",
"(",
")",
")",
";",
"}",
"return",
"this",
".",
"_aAttributeNames",
";",
"}"
] |
Get the names of all attributes included in this dimension
@returns {string[]} List of all attribute names
@public
@function
@name sap.ui.model.analytics.odata4analytics.Dimension#getAllAttributeNames
|
[
"Get",
"the",
"names",
"of",
"all",
"attributes",
"included",
"in",
"this",
"dimension"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1843-L1855
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (this._bIsUpdatable != null) {
return this._bIsUpdatable;
}
var oUpdatablePropertyNameSet = this._oQueryResult.getEntitySet().getUpdatablePropertyNameSet();
return (oUpdatablePropertyNameSet[this.getName()] != undefined);
}
|
javascript
|
function() {
if (this._bIsUpdatable != null) {
return this._bIsUpdatable;
}
var oUpdatablePropertyNameSet = this._oQueryResult.getEntitySet().getUpdatablePropertyNameSet();
return (oUpdatablePropertyNameSet[this.getName()] != undefined);
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_bIsUpdatable",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"_bIsUpdatable",
";",
"}",
"var",
"oUpdatablePropertyNameSet",
"=",
"this",
".",
"_oQueryResult",
".",
"getEntitySet",
"(",
")",
".",
"getUpdatablePropertyNameSet",
"(",
")",
";",
"return",
"(",
"oUpdatablePropertyNameSet",
"[",
"this",
".",
"getName",
"(",
")",
"]",
"!=",
"undefined",
")",
";",
"}"
] |
Get indicator whether or not the measure is updatable
@returns {boolean} True iff the measure is updatable
@public
@function
@name sap.ui.model.analytics.odata4analytics.Measure#isUpdatable
|
[
"Get",
"indicator",
"whether",
"or",
"not",
"the",
"measure",
"is",
"updatable"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2211-L2218
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (this._oUpdatablePropertyNames) {
return this._oUpdatablePropertyNames;
}
this._oUpdatablePropertyNames = {};
var bSetIsUpdatable = true;
if (this._oEntitySet.extensions != undefined) {
for (var j = -1, oExtension; (oExtension = this._oEntitySet.extensions[++j]) !== undefined;) {
if (oExtension.namespace == odata4analytics.constants.SAP_NAMESPACE && oExtension.name == "updatable") {
if (oExtension.value == "false") {
bSetIsUpdatable = false;
break;
}
}
}
}
if (!bSetIsUpdatable) { // set not updatable cascades to all properties
return this._oUpdatablePropertyNames;
}
var aProperty = this._oEntityType.getTypeDescription().property;
for (var i = -1, oProperty; (oProperty = aProperty[++i]) !== undefined;) {
var bPropertyIsUpdatable = true;
if (oProperty.extensions == undefined) {
continue;
}
for (var k = -1, oExtension2; (oExtension2 = oProperty.extensions[++k]) !== undefined;) {
if (oExtension2.namespace != odata4analytics.constants.SAP_NAMESPACE) {
continue;
}
if (oExtension2.name == "updatable") {
if (oExtension2.value == "false") {
bPropertyIsUpdatable = false;
break;
}
}
}
if (bPropertyIsUpdatable) {
this._oUpdatablePropertyNames[oProperty.name] = true;
}
}
return this._oUpdatablePropertyNames;
}
|
javascript
|
function() {
if (this._oUpdatablePropertyNames) {
return this._oUpdatablePropertyNames;
}
this._oUpdatablePropertyNames = {};
var bSetIsUpdatable = true;
if (this._oEntitySet.extensions != undefined) {
for (var j = -1, oExtension; (oExtension = this._oEntitySet.extensions[++j]) !== undefined;) {
if (oExtension.namespace == odata4analytics.constants.SAP_NAMESPACE && oExtension.name == "updatable") {
if (oExtension.value == "false") {
bSetIsUpdatable = false;
break;
}
}
}
}
if (!bSetIsUpdatable) { // set not updatable cascades to all properties
return this._oUpdatablePropertyNames;
}
var aProperty = this._oEntityType.getTypeDescription().property;
for (var i = -1, oProperty; (oProperty = aProperty[++i]) !== undefined;) {
var bPropertyIsUpdatable = true;
if (oProperty.extensions == undefined) {
continue;
}
for (var k = -1, oExtension2; (oExtension2 = oProperty.extensions[++k]) !== undefined;) {
if (oExtension2.namespace != odata4analytics.constants.SAP_NAMESPACE) {
continue;
}
if (oExtension2.name == "updatable") {
if (oExtension2.value == "false") {
bPropertyIsUpdatable = false;
break;
}
}
}
if (bPropertyIsUpdatable) {
this._oUpdatablePropertyNames[oProperty.name] = true;
}
}
return this._oUpdatablePropertyNames;
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_oUpdatablePropertyNames",
")",
"{",
"return",
"this",
".",
"_oUpdatablePropertyNames",
";",
"}",
"this",
".",
"_oUpdatablePropertyNames",
"=",
"{",
"}",
";",
"var",
"bSetIsUpdatable",
"=",
"true",
";",
"if",
"(",
"this",
".",
"_oEntitySet",
".",
"extensions",
"!=",
"undefined",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"-",
"1",
",",
"oExtension",
";",
"(",
"oExtension",
"=",
"this",
".",
"_oEntitySet",
".",
"extensions",
"[",
"++",
"j",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"oExtension",
".",
"namespace",
"==",
"odata4analytics",
".",
"constants",
".",
"SAP_NAMESPACE",
"&&",
"oExtension",
".",
"name",
"==",
"\"updatable\"",
")",
"{",
"if",
"(",
"oExtension",
".",
"value",
"==",
"\"false\"",
")",
"{",
"bSetIsUpdatable",
"=",
"false",
";",
"break",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"!",
"bSetIsUpdatable",
")",
"{",
"return",
"this",
".",
"_oUpdatablePropertyNames",
";",
"}",
"var",
"aProperty",
"=",
"this",
".",
"_oEntityType",
".",
"getTypeDescription",
"(",
")",
".",
"property",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oProperty",
";",
"(",
"oProperty",
"=",
"aProperty",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"var",
"bPropertyIsUpdatable",
"=",
"true",
";",
"if",
"(",
"oProperty",
".",
"extensions",
"==",
"undefined",
")",
"{",
"continue",
";",
"}",
"for",
"(",
"var",
"k",
"=",
"-",
"1",
",",
"oExtension2",
";",
"(",
"oExtension2",
"=",
"oProperty",
".",
"extensions",
"[",
"++",
"k",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"oExtension2",
".",
"namespace",
"!=",
"odata4analytics",
".",
"constants",
".",
"SAP_NAMESPACE",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"oExtension2",
".",
"name",
"==",
"\"updatable\"",
")",
"{",
"if",
"(",
"oExtension2",
".",
"value",
"==",
"\"false\"",
")",
"{",
"bPropertyIsUpdatable",
"=",
"false",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"bPropertyIsUpdatable",
")",
"{",
"this",
".",
"_oUpdatablePropertyNames",
"[",
"oProperty",
".",
"name",
"]",
"=",
"true",
";",
"}",
"}",
"return",
"this",
".",
"_oUpdatablePropertyNames",
";",
"}"
] |
Get names of properties in this entity set that can be updated
@returns {object} An object with individual JS properties for each
updatable property. For testing whether propertyName is the name
of an updatable property, use
<code>getUpdatablePropertyNameSet()[propertyName]</code>. The
included JS object properties are all set to true.
@public
@function
@name sap.ui.model.analytics.odata4analytics.EntitySet#getUpdatablePropertyNameSet
|
[
"Get",
"names",
"of",
"properties",
"in",
"this",
"entity",
"set",
"that",
"can",
"be",
"updated"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2335-L2380
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
getOrCreateHierarchy
|
function getOrCreateHierarchy(sKey) {
var oResult = oRecursiveHierarchies[sKey];
if (!oResult) {
oResult = oRecursiveHierarchies[sKey] = {};
}
return oResult;
}
|
javascript
|
function getOrCreateHierarchy(sKey) {
var oResult = oRecursiveHierarchies[sKey];
if (!oResult) {
oResult = oRecursiveHierarchies[sKey] = {};
}
return oResult;
}
|
[
"function",
"getOrCreateHierarchy",
"(",
"sKey",
")",
"{",
"var",
"oResult",
"=",
"oRecursiveHierarchies",
"[",
"sKey",
"]",
";",
"if",
"(",
"!",
"oResult",
")",
"{",
"oResult",
"=",
"oRecursiveHierarchies",
"[",
"sKey",
"]",
"=",
"{",
"}",
";",
"}",
"return",
"oResult",
";",
"}"
] |
temp for collecting all properties participating in hierarchies
|
[
"temp",
"for",
"collecting",
"all",
"properties",
"participating",
"in",
"hierarchies"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2449-L2456
|
train
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
if (this._aHierarchyPropertyNames) {
return this._aHierarchyPropertyNames;
}
this._aHierarchyPropertyNames = [];
for ( var sName in this._oRecursiveHierarchySet) {
this._aHierarchyPropertyNames.push(this._oRecursiveHierarchySet[sName].getNodeValueProperty().name);
}
return this._aHierarchyPropertyNames;
}
|
javascript
|
function() {
if (this._aHierarchyPropertyNames) {
return this._aHierarchyPropertyNames;
}
this._aHierarchyPropertyNames = [];
for ( var sName in this._oRecursiveHierarchySet) {
this._aHierarchyPropertyNames.push(this._oRecursiveHierarchySet[sName].getNodeValueProperty().name);
}
return this._aHierarchyPropertyNames;
}
|
[
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_aHierarchyPropertyNames",
")",
"{",
"return",
"this",
".",
"_aHierarchyPropertyNames",
";",
"}",
"this",
".",
"_aHierarchyPropertyNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oRecursiveHierarchySet",
")",
"{",
"this",
".",
"_aHierarchyPropertyNames",
".",
"push",
"(",
"this",
".",
"_oRecursiveHierarchySet",
"[",
"sName",
"]",
".",
"getNodeValueProperty",
"(",
")",
".",
"name",
")",
";",
"}",
"return",
"this",
".",
"_aHierarchyPropertyNames",
";",
"}"
] |
Get the names of all properties with an associated hierarchy
@returns {string[]} List of all property names
@public
@function
@name sap.ui.model.analytics.odata4analytics.EntityType#getAllHierarchyPropertyNames
|
[
"Get",
"the",
"names",
"of",
"all",
"properties",
"with",
"an",
"associated",
"hierarchy"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2812-L2824
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName, sOperator, oValue, oValue2) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + sPropertyName; // TODO
}
var aFilterablePropertyNames = this._oEntityType.getFilterablePropertyNames();
if (((aFilterablePropertyNames ? Array.prototype.indexOf.call(aFilterablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add filter condition for not filterable property name " + sPropertyName; // TODO
}
this._addCondition(sPropertyName, sOperator, oValue, oValue2);
return this;
}
|
javascript
|
function(sPropertyName, sOperator, oValue, oValue2) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + sPropertyName; // TODO
}
var aFilterablePropertyNames = this._oEntityType.getFilterablePropertyNames();
if (((aFilterablePropertyNames ? Array.prototype.indexOf.call(aFilterablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add filter condition for not filterable property name " + sPropertyName; // TODO
}
this._addCondition(sPropertyName, sOperator, oValue, oValue2);
return this;
}
|
[
"function",
"(",
"sPropertyName",
",",
"sOperator",
",",
"oValue",
",",
"oValue2",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot add filter condition for unknown property name \"",
"+",
"sPropertyName",
";",
"}",
"var",
"aFilterablePropertyNames",
"=",
"this",
".",
"_oEntityType",
".",
"getFilterablePropertyNames",
"(",
")",
";",
"if",
"(",
"(",
"(",
"aFilterablePropertyNames",
"?",
"Array",
".",
"prototype",
".",
"indexOf",
".",
"call",
"(",
"aFilterablePropertyNames",
",",
"sPropertyName",
")",
":",
"-",
"1",
")",
")",
"===",
"-",
"1",
")",
"{",
"throw",
"\"Cannot add filter condition for not filterable property name \"",
"+",
"sPropertyName",
";",
"}",
"this",
".",
"_addCondition",
"(",
"sPropertyName",
",",
"sOperator",
",",
"oValue",
",",
"oValue2",
")",
";",
"return",
"this",
";",
"}"
] |
Add a condition to the filter expression.
Multiple conditions on the same property are combined with a logical OR first, and in a second step conditions for
different properties are combined with a logical AND.
@param {string}
sPropertyName The name of the property bound in the condition
@param {sap.ui.model.FilterOperator}
sOperator operator used for the condition
@param {object}
oValue value to be used for this condition
@param {object}
oValue2 (optional) as second value to be used for this condition
@throws Exception
if the property is unknown or not filterable
@returns {sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
@public
@function
@name sap.ui.model.analytics.odata4analytics.FilterExpression#addCondition
|
[
"Add",
"a",
"condition",
"to",
"the",
"filter",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3153-L3164
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot remove filter conditions for unknown property name " + sPropertyName; // TODO
}
for (var i = 0; i < this._aConditionUI5Filter.length; i++) {
var oUI5Filter = this._aConditionUI5Filter[i];
if (oUI5Filter.sPath == sPropertyName) {
this._aConditionUI5Filter.splice(i--, 1);
}
}
return this;
}
|
javascript
|
function(sPropertyName) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot remove filter conditions for unknown property name " + sPropertyName; // TODO
}
for (var i = 0; i < this._aConditionUI5Filter.length; i++) {
var oUI5Filter = this._aConditionUI5Filter[i];
if (oUI5Filter.sPath == sPropertyName) {
this._aConditionUI5Filter.splice(i--, 1);
}
}
return this;
}
|
[
"function",
"(",
"sPropertyName",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot remove filter conditions for unknown property name \"",
"+",
"sPropertyName",
";",
"}",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_aConditionUI5Filter",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"oUI5Filter",
"=",
"this",
".",
"_aConditionUI5Filter",
"[",
"i",
"]",
";",
"if",
"(",
"oUI5Filter",
".",
"sPath",
"==",
"sPropertyName",
")",
"{",
"this",
".",
"_aConditionUI5Filter",
".",
"splice",
"(",
"i",
"--",
",",
"1",
")",
";",
"}",
"}",
"return",
"this",
";",
"}"
] |
Remove all conditions for some property from the filter expression.
All previously set conditions for some property are removed from the filter expression.
@param {string}
sPropertyName The name of the property bound in the condition
@throws Exception
if the property is unknown
@returns {sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
@public
@function
@name sap.ui.model.analytics.odata4analytics.FilterExpression#removeConditions
|
[
"Remove",
"all",
"conditions",
"for",
"some",
"property",
"from",
"the",
"filter",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3180-L3192
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName, aValues) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + sPropertyName; // TODO
}
var aFilterablePropertyNames = this._oEntityType.getFilterablePropertyNames();
if (((aFilterablePropertyNames ? Array.prototype.indexOf.call(aFilterablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add filter condition for not filterable property name " + sPropertyName; // TODO
}
for ( var i = -1, oValue; (oValue = aValues[++i]) !== undefined;) {
this._addCondition(sPropertyName, FilterOperator.EQ, oValue);
}
return this;
}
|
javascript
|
function(sPropertyName, aValues) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + sPropertyName; // TODO
}
var aFilterablePropertyNames = this._oEntityType.getFilterablePropertyNames();
if (((aFilterablePropertyNames ? Array.prototype.indexOf.call(aFilterablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add filter condition for not filterable property name " + sPropertyName; // TODO
}
for ( var i = -1, oValue; (oValue = aValues[++i]) !== undefined;) {
this._addCondition(sPropertyName, FilterOperator.EQ, oValue);
}
return this;
}
|
[
"function",
"(",
"sPropertyName",
",",
"aValues",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot add filter condition for unknown property name \"",
"+",
"sPropertyName",
";",
"}",
"var",
"aFilterablePropertyNames",
"=",
"this",
".",
"_oEntityType",
".",
"getFilterablePropertyNames",
"(",
")",
";",
"if",
"(",
"(",
"(",
"aFilterablePropertyNames",
"?",
"Array",
".",
"prototype",
".",
"indexOf",
".",
"call",
"(",
"aFilterablePropertyNames",
",",
"sPropertyName",
")",
":",
"-",
"1",
")",
")",
"===",
"-",
"1",
")",
"{",
"throw",
"\"Cannot add filter condition for not filterable property name \"",
"+",
"sPropertyName",
";",
"}",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oValue",
";",
"(",
"oValue",
"=",
"aValues",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"this",
".",
"_addCondition",
"(",
"sPropertyName",
",",
"FilterOperator",
".",
"EQ",
",",
"oValue",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
Add a set condition to the filter expression.
A set condition tests if the value of a property is included in a set of given values. It is a convenience method for
this particular use case eliminating the need for multiple API calls.
@param {string}
sPropertyName The name of the property bound in the condition
@param {array}
aValues values defining the set
@throws Exception
if the property is unknown or not filterable
@returns {sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
@public
@function
@name sap.ui.model.analytics.odata4analytics.FilterExpression#addSetCondition
|
[
"Add",
"a",
"set",
"condition",
"to",
"the",
"filter",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3211-L3224
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(aUI5Filter) {
if (!Array.isArray(aUI5Filter)) {
throw "Argument is not an array";
}
if (aUI5Filter.length == 0) {
return this;
}
// check if a multi filter is included; otherwise every element simply represents a single condition
var bHasMultiFilter = false;
for (var i = 0; i < aUI5Filter.length; i++) {
if (aUI5Filter[i].aFilters != undefined) {
bHasMultiFilter = true;
break;
}
}
if (bHasMultiFilter) {
this._addUI5FilterArray(aUI5Filter);
} else {
for (var j = 0; j < aUI5Filter.length; j++) {
this.addCondition(aUI5Filter[j].sPath, aUI5Filter[j].sOperator, aUI5Filter[j].oValue1, aUI5Filter[j].oValue2);
}
}
return this;
}
|
javascript
|
function(aUI5Filter) {
if (!Array.isArray(aUI5Filter)) {
throw "Argument is not an array";
}
if (aUI5Filter.length == 0) {
return this;
}
// check if a multi filter is included; otherwise every element simply represents a single condition
var bHasMultiFilter = false;
for (var i = 0; i < aUI5Filter.length; i++) {
if (aUI5Filter[i].aFilters != undefined) {
bHasMultiFilter = true;
break;
}
}
if (bHasMultiFilter) {
this._addUI5FilterArray(aUI5Filter);
} else {
for (var j = 0; j < aUI5Filter.length; j++) {
this.addCondition(aUI5Filter[j].sPath, aUI5Filter[j].sOperator, aUI5Filter[j].oValue1, aUI5Filter[j].oValue2);
}
}
return this;
}
|
[
"function",
"(",
"aUI5Filter",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"aUI5Filter",
")",
")",
"{",
"throw",
"\"Argument is not an array\"",
";",
"}",
"if",
"(",
"aUI5Filter",
".",
"length",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"var",
"bHasMultiFilter",
"=",
"false",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aUI5Filter",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"aUI5Filter",
"[",
"i",
"]",
".",
"aFilters",
"!=",
"undefined",
")",
"{",
"bHasMultiFilter",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"bHasMultiFilter",
")",
"{",
"this",
".",
"_addUI5FilterArray",
"(",
"aUI5Filter",
")",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"aUI5Filter",
".",
"length",
";",
"j",
"++",
")",
"{",
"this",
".",
"addCondition",
"(",
"aUI5Filter",
"[",
"j",
"]",
".",
"sPath",
",",
"aUI5Filter",
"[",
"j",
"]",
".",
"sOperator",
",",
"aUI5Filter",
"[",
"j",
"]",
".",
"oValue1",
",",
"aUI5Filter",
"[",
"j",
"]",
".",
"oValue2",
")",
";",
"}",
"}",
"return",
"this",
";",
"}"
] |
Add an array of UI5 filter conditions to the filter expression.
The UI5 filter condition is combined with the other given conditions using a logical AND. This method
is particularly useful for passing forward already created UI5 filter arrays.
@param {sap.ui.model.Filter[]}
aUI5Filter Array of UI5 filter objects
@returns {sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
@public
@function
@name sap.ui.model.analytics.odata4analytics.FilterExpression#addUI5FilterConditions
|
[
"Add",
"an",
"array",
"of",
"UI5",
"filter",
"conditions",
"to",
"the",
"filter",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3239-L3263
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
var aFilterObjects = this._aConditionUI5Filter.concat([]);
for ( var i = -1, aFilter; (aFilter = this._aUI5FilterArray[++i]) !== undefined;) {
for ( var j = -1, oFilter; (oFilter = aFilter[++j]) !== undefined;) {
aFilterObjects.push(oFilter);
}
}
return aFilterObjects;
}
|
javascript
|
function() {
var aFilterObjects = this._aConditionUI5Filter.concat([]);
for ( var i = -1, aFilter; (aFilter = this._aUI5FilterArray[++i]) !== undefined;) {
for ( var j = -1, oFilter; (oFilter = aFilter[++j]) !== undefined;) {
aFilterObjects.push(oFilter);
}
}
return aFilterObjects;
}
|
[
"function",
"(",
")",
"{",
"var",
"aFilterObjects",
"=",
"this",
".",
"_aConditionUI5Filter",
".",
"concat",
"(",
"[",
"]",
")",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"aFilter",
";",
"(",
"aFilter",
"=",
"this",
".",
"_aUI5FilterArray",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"-",
"1",
",",
"oFilter",
";",
"(",
"oFilter",
"=",
"aFilter",
"[",
"++",
"j",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"aFilterObjects",
".",
"push",
"(",
"oFilter",
")",
";",
"}",
"}",
"return",
"aFilterObjects",
";",
"}"
] |
Get an array of SAPUI5 Filter objects corresponding to this expression.
@returns {sap.ui.model.Filter[]} List of filter objects representing this expression
@public
@function
@name sap.ui.model.analytics.odata4analytics.FilterExpression#getExpressionAsUI5FilterArray
|
[
"Get",
"an",
"array",
"of",
"SAPUI5",
"Filter",
"objects",
"corresponding",
"to",
"this",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3274-L3283
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
var oReferencedProperties = {};
for ( var i = -1, oUI5Filter; (oUI5Filter = this._aConditionUI5Filter[++i]) !== undefined;) {
if (oReferencedProperties[oUI5Filter.sPath] == undefined) {
oReferencedProperties[oUI5Filter.sPath] = [];
}
oReferencedProperties[oUI5Filter.sPath].push(oUI5Filter);
}
for ( var j = -1, aUI5Filter; (aUI5Filter = this._aUI5FilterArray[++j]) !== undefined;) {
this.getPropertiesReferencedByUI5FilterArray(aUI5Filter, oReferencedProperties);
}
return oReferencedProperties;
}
|
javascript
|
function() {
var oReferencedProperties = {};
for ( var i = -1, oUI5Filter; (oUI5Filter = this._aConditionUI5Filter[++i]) !== undefined;) {
if (oReferencedProperties[oUI5Filter.sPath] == undefined) {
oReferencedProperties[oUI5Filter.sPath] = [];
}
oReferencedProperties[oUI5Filter.sPath].push(oUI5Filter);
}
for ( var j = -1, aUI5Filter; (aUI5Filter = this._aUI5FilterArray[++j]) !== undefined;) {
this.getPropertiesReferencedByUI5FilterArray(aUI5Filter, oReferencedProperties);
}
return oReferencedProperties;
}
|
[
"function",
"(",
")",
"{",
"var",
"oReferencedProperties",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oUI5Filter",
";",
"(",
"oUI5Filter",
"=",
"this",
".",
"_aConditionUI5Filter",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"oReferencedProperties",
"[",
"oUI5Filter",
".",
"sPath",
"]",
"==",
"undefined",
")",
"{",
"oReferencedProperties",
"[",
"oUI5Filter",
".",
"sPath",
"]",
"=",
"[",
"]",
";",
"}",
"oReferencedProperties",
"[",
"oUI5Filter",
".",
"sPath",
"]",
".",
"push",
"(",
"oUI5Filter",
")",
";",
"}",
"for",
"(",
"var",
"j",
"=",
"-",
"1",
",",
"aUI5Filter",
";",
"(",
"aUI5Filter",
"=",
"this",
".",
"_aUI5FilterArray",
"[",
"++",
"j",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"this",
".",
"getPropertiesReferencedByUI5FilterArray",
"(",
"aUI5Filter",
",",
"oReferencedProperties",
")",
";",
"}",
"return",
"oReferencedProperties",
";",
"}"
] |
Get the properties referenced by the filter expression.
@returns {object} Object containing (JavaScript) properties for all (OData entity type)
properties referenced in the filter expression. The value for each of these properties is an array holding all used UI5 filters referencing them.
@private
|
[
"Get",
"the",
"properties",
"referenced",
"by",
"the",
"filter",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3310-L3324
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(oUI5Filter) {
var sFilterExpression = null,
oProperty = this._oEntityType.findPropertyByName(oUI5Filter.sPath);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + oUI5Filter.sPath; // TODO
}
switch (oUI5Filter.sOperator) {
case FilterOperator.BT:
sFilterExpression = "(" + oUI5Filter.sPath + " ge "
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type)
+ " and " + oUI5Filter.sPath + " le "
+ this._renderPropertyFilterValue(oUI5Filter.oValue2, oProperty.type)
+ ")";
break;
case FilterOperator.NB:
sFilterExpression = "(" + oUI5Filter.sPath + " lt "
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type)
+ " or " + oUI5Filter.sPath + " gt "
+ this._renderPropertyFilterValue(oUI5Filter.oValue2, oProperty.type)
+ ")";
break;
case FilterOperator.Contains:
case FilterOperator.NotContains:
sFilterExpression = (oUI5Filter.sOperator[0] === "N" ? "not " : "") + "substringof("
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, "Edm.String")
+ "," + oUI5Filter.sPath + ")";
break;
case FilterOperator.StartsWith:
case FilterOperator.EndsWith:
case FilterOperator.NotStartsWith:
case FilterOperator.NotEndsWith:
sFilterExpression = oUI5Filter.sOperator.toLowerCase().replace("not", "not ") + "("
+ oUI5Filter.sPath + ","
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, "Edm.String") + ")";
break;
default:
sFilterExpression = oUI5Filter.sPath + " " + oUI5Filter.sOperator.toLowerCase()
+ " " + this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type);
}
return sFilterExpression;
}
|
javascript
|
function(oUI5Filter) {
var sFilterExpression = null,
oProperty = this._oEntityType.findPropertyByName(oUI5Filter.sPath);
if (oProperty == null) {
throw "Cannot add filter condition for unknown property name " + oUI5Filter.sPath; // TODO
}
switch (oUI5Filter.sOperator) {
case FilterOperator.BT:
sFilterExpression = "(" + oUI5Filter.sPath + " ge "
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type)
+ " and " + oUI5Filter.sPath + " le "
+ this._renderPropertyFilterValue(oUI5Filter.oValue2, oProperty.type)
+ ")";
break;
case FilterOperator.NB:
sFilterExpression = "(" + oUI5Filter.sPath + " lt "
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type)
+ " or " + oUI5Filter.sPath + " gt "
+ this._renderPropertyFilterValue(oUI5Filter.oValue2, oProperty.type)
+ ")";
break;
case FilterOperator.Contains:
case FilterOperator.NotContains:
sFilterExpression = (oUI5Filter.sOperator[0] === "N" ? "not " : "") + "substringof("
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, "Edm.String")
+ "," + oUI5Filter.sPath + ")";
break;
case FilterOperator.StartsWith:
case FilterOperator.EndsWith:
case FilterOperator.NotStartsWith:
case FilterOperator.NotEndsWith:
sFilterExpression = oUI5Filter.sOperator.toLowerCase().replace("not", "not ") + "("
+ oUI5Filter.sPath + ","
+ this._renderPropertyFilterValue(oUI5Filter.oValue1, "Edm.String") + ")";
break;
default:
sFilterExpression = oUI5Filter.sPath + " " + oUI5Filter.sOperator.toLowerCase()
+ " " + this._renderPropertyFilterValue(oUI5Filter.oValue1, oProperty.type);
}
return sFilterExpression;
}
|
[
"function",
"(",
"oUI5Filter",
")",
"{",
"var",
"sFilterExpression",
"=",
"null",
",",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"oUI5Filter",
".",
"sPath",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot add filter condition for unknown property name \"",
"+",
"oUI5Filter",
".",
"sPath",
";",
"}",
"switch",
"(",
"oUI5Filter",
".",
"sOperator",
")",
"{",
"case",
"FilterOperator",
".",
"BT",
":",
"sFilterExpression",
"=",
"\"(\"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\" ge \"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue1",
",",
"oProperty",
".",
"type",
")",
"+",
"\" and \"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\" le \"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue2",
",",
"oProperty",
".",
"type",
")",
"+",
"\")\"",
";",
"break",
";",
"case",
"FilterOperator",
".",
"NB",
":",
"sFilterExpression",
"=",
"\"(\"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\" lt \"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue1",
",",
"oProperty",
".",
"type",
")",
"+",
"\" or \"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\" gt \"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue2",
",",
"oProperty",
".",
"type",
")",
"+",
"\")\"",
";",
"break",
";",
"case",
"FilterOperator",
".",
"Contains",
":",
"case",
"FilterOperator",
".",
"NotContains",
":",
"sFilterExpression",
"=",
"(",
"oUI5Filter",
".",
"sOperator",
"[",
"0",
"]",
"===",
"\"N\"",
"?",
"\"not \"",
":",
"\"\"",
")",
"+",
"\"substringof(\"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue1",
",",
"\"Edm.String\"",
")",
"+",
"\",\"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\")\"",
";",
"break",
";",
"case",
"FilterOperator",
".",
"StartsWith",
":",
"case",
"FilterOperator",
".",
"EndsWith",
":",
"case",
"FilterOperator",
".",
"NotStartsWith",
":",
"case",
"FilterOperator",
".",
"NotEndsWith",
":",
"sFilterExpression",
"=",
"oUI5Filter",
".",
"sOperator",
".",
"toLowerCase",
"(",
")",
".",
"replace",
"(",
"\"not\"",
",",
"\"not \"",
")",
"+",
"\"(\"",
"+",
"oUI5Filter",
".",
"sPath",
"+",
"\",\"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue1",
",",
"\"Edm.String\"",
")",
"+",
"\")\"",
";",
"break",
";",
"default",
":",
"sFilterExpression",
"=",
"oUI5Filter",
".",
"sPath",
"+",
"\" \"",
"+",
"oUI5Filter",
".",
"sOperator",
".",
"toLowerCase",
"(",
")",
"+",
"\" \"",
"+",
"this",
".",
"_renderPropertyFilterValue",
"(",
"oUI5Filter",
".",
"oValue1",
",",
"oProperty",
".",
"type",
")",
";",
"}",
"return",
"sFilterExpression",
";",
"}"
] |
Render a UI5 Filter as OData condition.
@param {string} oUI5Filter The filter object to render (must not be a multi filter)
@returns {string} The $filter value for the given UI5 filter
@private
|
[
"Render",
"a",
"UI5",
"Filter",
"as",
"OData",
"condition",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3333-L3376
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName) {
var oResult = null;
for (var i = -1, oCurrentSorter; (oCurrentSorter = this._aSortCondition[++i]) !== undefined;) {
if (oCurrentSorter.property.name === sPropertyName) {
oResult = {
sorter : oCurrentSorter,
index : i
};
break;
}
}
return oResult;
}
|
javascript
|
function(sPropertyName) {
var oResult = null;
for (var i = -1, oCurrentSorter; (oCurrentSorter = this._aSortCondition[++i]) !== undefined;) {
if (oCurrentSorter.property.name === sPropertyName) {
oResult = {
sorter : oCurrentSorter,
index : i
};
break;
}
}
return oResult;
}
|
[
"function",
"(",
"sPropertyName",
")",
"{",
"var",
"oResult",
"=",
"null",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oCurrentSorter",
";",
"(",
"oCurrentSorter",
"=",
"this",
".",
"_aSortCondition",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"oCurrentSorter",
".",
"property",
".",
"name",
"===",
"sPropertyName",
")",
"{",
"oResult",
"=",
"{",
"sorter",
":",
"oCurrentSorter",
",",
"index",
":",
"i",
"}",
";",
"break",
";",
"}",
"}",
"return",
"oResult",
";",
"}"
] |
Checks if an order by expression for the given property is already
defined and returns a reference to an object with property sorter and
index of the object or null if the property is not yet defined in an
order by expression.
@private
|
[
"Checks",
"if",
"an",
"order",
"by",
"expression",
"for",
"the",
"given",
"property",
"is",
"already",
"defined",
"and",
"returns",
"a",
"reference",
"to",
"an",
"object",
"with",
"property",
"sorter",
"and",
"index",
"of",
"the",
"object",
"or",
"null",
"if",
"the",
"property",
"is",
"not",
"yet",
"defined",
"in",
"an",
"order",
"by",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3635-L3647
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName, sSortOrder) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add sort condition for unknown property name " + sPropertyName; // TODO
}
var oExistingSorterEntry = this._containsSorter(sPropertyName);
if (oExistingSorterEntry != null) {
oExistingSorterEntry.sorter.order = sSortOrder;
return this;
}
var aSortablePropertyNames = this._oEntityType.getSortablePropertyNames();
if (((aSortablePropertyNames ? Array.prototype.indexOf.call(aSortablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add sort condition for not sortable property name " + sPropertyName; // TODO
}
this._aSortCondition.push({
property : oProperty,
order : sSortOrder
});
return this;
}
|
javascript
|
function(sPropertyName, sSortOrder) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot add sort condition for unknown property name " + sPropertyName; // TODO
}
var oExistingSorterEntry = this._containsSorter(sPropertyName);
if (oExistingSorterEntry != null) {
oExistingSorterEntry.sorter.order = sSortOrder;
return this;
}
var aSortablePropertyNames = this._oEntityType.getSortablePropertyNames();
if (((aSortablePropertyNames ? Array.prototype.indexOf.call(aSortablePropertyNames, sPropertyName) : -1)) === -1) {
throw "Cannot add sort condition for not sortable property name " + sPropertyName; // TODO
}
this._aSortCondition.push({
property : oProperty,
order : sSortOrder
});
return this;
}
|
[
"function",
"(",
"sPropertyName",
",",
"sSortOrder",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot add sort condition for unknown property name \"",
"+",
"sPropertyName",
";",
"}",
"var",
"oExistingSorterEntry",
"=",
"this",
".",
"_containsSorter",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oExistingSorterEntry",
"!=",
"null",
")",
"{",
"oExistingSorterEntry",
".",
"sorter",
".",
"order",
"=",
"sSortOrder",
";",
"return",
"this",
";",
"}",
"var",
"aSortablePropertyNames",
"=",
"this",
".",
"_oEntityType",
".",
"getSortablePropertyNames",
"(",
")",
";",
"if",
"(",
"(",
"(",
"aSortablePropertyNames",
"?",
"Array",
".",
"prototype",
".",
"indexOf",
".",
"call",
"(",
"aSortablePropertyNames",
",",
"sPropertyName",
")",
":",
"-",
"1",
")",
")",
"===",
"-",
"1",
")",
"{",
"throw",
"\"Cannot add sort condition for not sortable property name \"",
"+",
"sPropertyName",
";",
"}",
"this",
".",
"_aSortCondition",
".",
"push",
"(",
"{",
"property",
":",
"oProperty",
",",
"order",
":",
"sSortOrder",
"}",
")",
";",
"return",
"this",
";",
"}"
] |
Add a condition to the order by expression. It replaces any previously specified
sort order for the property.
@param {string}
sPropertyName The name of the property bound in the condition
@param {sap.ui.model.analytics.odata4analytics.SortOrder}
sSortOrder sorting order used for the condition
@throws Exception
if the property is unknown, not sortable or already added as
sorter
@returns {sap.ui.model.analytics.odata4analytics.SortExpression} This object for method
chaining
@public
@function
@name sap.ui.model.analytics.odata4analytics.SortExpression#addSorter
|
[
"Add",
"a",
"condition",
"to",
"the",
"order",
"by",
"expression",
".",
"It",
"replaces",
"any",
"previously",
"specified",
"sort",
"order",
"for",
"the",
"property",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3688-L3708
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sPropertyName) {
if (!sPropertyName) {
return;
}
var oSorter = this._containsSorter(sPropertyName);
if (oSorter) {
this._removeFromArray(this._aSortCondition, oSorter.index);
}
}
|
javascript
|
function(sPropertyName) {
if (!sPropertyName) {
return;
}
var oSorter = this._containsSorter(sPropertyName);
if (oSorter) {
this._removeFromArray(this._aSortCondition, oSorter.index);
}
}
|
[
"function",
"(",
"sPropertyName",
")",
"{",
"if",
"(",
"!",
"sPropertyName",
")",
"{",
"return",
";",
"}",
"var",
"oSorter",
"=",
"this",
".",
"_containsSorter",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oSorter",
")",
"{",
"this",
".",
"_removeFromArray",
"(",
"this",
".",
"_aSortCondition",
",",
"oSorter",
".",
"index",
")",
";",
"}",
"}"
] |
Removes the order by expression for the given property name from the list
of order by expression. If no order by expression with this property name
exists the method does nothing.
@param {string}
sPropertyName The name of the property to be removed from the
condition
@public
@function
@name sap.ui.model.analytics.odata4analytics.SortExpression#removeSorter
|
[
"Removes",
"the",
"order",
"by",
"expression",
"for",
"the",
"given",
"property",
"name",
"from",
"the",
"list",
"of",
"order",
"by",
"expression",
".",
"If",
"no",
"order",
"by",
"expression",
"with",
"this",
"property",
"name",
"exists",
"the",
"method",
"does",
"nothing",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3722-L3731
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function() {
var aSorterObjects = [];
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
aSorterObjects.push(new Sorter(oCondition.property.name,
oCondition.order == odata4analytics.SortOrder.Descending));
}
return aSorterObjects;
}
|
javascript
|
function() {
var aSorterObjects = [];
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
aSorterObjects.push(new Sorter(oCondition.property.name,
oCondition.order == odata4analytics.SortOrder.Descending));
}
return aSorterObjects;
}
|
[
"function",
"(",
")",
"{",
"var",
"aSorterObjects",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oCondition",
";",
"(",
"oCondition",
"=",
"this",
".",
"_aSortCondition",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"aSorterObjects",
".",
"push",
"(",
"new",
"Sorter",
"(",
"oCondition",
".",
"property",
".",
"name",
",",
"oCondition",
".",
"order",
"==",
"odata4analytics",
".",
"SortOrder",
".",
"Descending",
")",
")",
";",
"}",
"return",
"aSorterObjects",
";",
"}"
] |
Get an array of SAPUI5 Sorter objects corresponding to this expression.
@returns {sap.ui.model.Sorter[]} List of sorter objects representing
this expression
@public
@function
@name sap.ui.model.analytics.odata4analytics.SortExpression#getExpressionsAsUI5SorterArray
|
[
"Get",
"an",
"array",
"of",
"SAPUI5",
"Sorter",
"objects",
"corresponding",
"to",
"this",
"expression",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3742-L3751
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sParameterName, sValue, sToValue) {
var oParameter = this._oParameterization.findParameterByName(sParameterName);
if (!oParameter) {
throw "Invalid parameter name " + sParameterName; // TODO improve
}
// error handling
if (sToValue != null) {
if (!oParameter.isIntervalBoundary()) {
// TODO improve error handling
throw "Range value cannot be applied to parameter " + sParameterName + " accepting only single values"; // TODO
}
if (!oParameter.isLowerIntervalBoundary()) {
// TODO improve error handling
throw "Range value given, but parameter " + sParameterName + " does not hold the lower boundary"; // TODO
}
}
if (!oParameter.isIntervalBoundary()) {
if (sValue == null) {
delete this._oParameterValueAssignment[sParameterName];
} else {
this._oParameterValueAssignment[sParameterName] = sValue;
}
} else {
if (sValue == null && sToValue != null) {
throw "Parameter " + sParameterName + ": An upper boundary cannot be given without the lower boundary"; // TODO
}
if (sValue == null) {
delete this._oParameterValueAssignment[sParameterName];
sToValue = null;
} else {
this._oParameterValueAssignment[sParameterName] = sValue;
}
var oUpperBoundaryParameter = oParameter.getPeerIntervalBoundaryParameter();
if (sToValue == null) {
sToValue = sValue;
}
if (sValue == null) {
delete this._oParameterValueAssignment[oUpperBoundaryParameter.getName()];
} else {
this._oParameterValueAssignment[oUpperBoundaryParameter.getName()] = sToValue;
}
}
return;
}
|
javascript
|
function(sParameterName, sValue, sToValue) {
var oParameter = this._oParameterization.findParameterByName(sParameterName);
if (!oParameter) {
throw "Invalid parameter name " + sParameterName; // TODO improve
}
// error handling
if (sToValue != null) {
if (!oParameter.isIntervalBoundary()) {
// TODO improve error handling
throw "Range value cannot be applied to parameter " + sParameterName + " accepting only single values"; // TODO
}
if (!oParameter.isLowerIntervalBoundary()) {
// TODO improve error handling
throw "Range value given, but parameter " + sParameterName + " does not hold the lower boundary"; // TODO
}
}
if (!oParameter.isIntervalBoundary()) {
if (sValue == null) {
delete this._oParameterValueAssignment[sParameterName];
} else {
this._oParameterValueAssignment[sParameterName] = sValue;
}
} else {
if (sValue == null && sToValue != null) {
throw "Parameter " + sParameterName + ": An upper boundary cannot be given without the lower boundary"; // TODO
}
if (sValue == null) {
delete this._oParameterValueAssignment[sParameterName];
sToValue = null;
} else {
this._oParameterValueAssignment[sParameterName] = sValue;
}
var oUpperBoundaryParameter = oParameter.getPeerIntervalBoundaryParameter();
if (sToValue == null) {
sToValue = sValue;
}
if (sValue == null) {
delete this._oParameterValueAssignment[oUpperBoundaryParameter.getName()];
} else {
this._oParameterValueAssignment[oUpperBoundaryParameter.getName()] = sToValue;
}
}
return;
}
|
[
"function",
"(",
"sParameterName",
",",
"sValue",
",",
"sToValue",
")",
"{",
"var",
"oParameter",
"=",
"this",
".",
"_oParameterization",
".",
"findParameterByName",
"(",
"sParameterName",
")",
";",
"if",
"(",
"!",
"oParameter",
")",
"{",
"throw",
"\"Invalid parameter name \"",
"+",
"sParameterName",
";",
"}",
"if",
"(",
"sToValue",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"oParameter",
".",
"isIntervalBoundary",
"(",
")",
")",
"{",
"throw",
"\"Range value cannot be applied to parameter \"",
"+",
"sParameterName",
"+",
"\" accepting only single values\"",
";",
"}",
"if",
"(",
"!",
"oParameter",
".",
"isLowerIntervalBoundary",
"(",
")",
")",
"{",
"throw",
"\"Range value given, but parameter \"",
"+",
"sParameterName",
"+",
"\" does not hold the lower boundary\"",
";",
"}",
"}",
"if",
"(",
"!",
"oParameter",
".",
"isIntervalBoundary",
"(",
")",
")",
"{",
"if",
"(",
"sValue",
"==",
"null",
")",
"{",
"delete",
"this",
".",
"_oParameterValueAssignment",
"[",
"sParameterName",
"]",
";",
"}",
"else",
"{",
"this",
".",
"_oParameterValueAssignment",
"[",
"sParameterName",
"]",
"=",
"sValue",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"sValue",
"==",
"null",
"&&",
"sToValue",
"!=",
"null",
")",
"{",
"throw",
"\"Parameter \"",
"+",
"sParameterName",
"+",
"\": An upper boundary cannot be given without the lower boundary\"",
";",
"}",
"if",
"(",
"sValue",
"==",
"null",
")",
"{",
"delete",
"this",
".",
"_oParameterValueAssignment",
"[",
"sParameterName",
"]",
";",
"sToValue",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"_oParameterValueAssignment",
"[",
"sParameterName",
"]",
"=",
"sValue",
";",
"}",
"var",
"oUpperBoundaryParameter",
"=",
"oParameter",
".",
"getPeerIntervalBoundaryParameter",
"(",
")",
";",
"if",
"(",
"sToValue",
"==",
"null",
")",
"{",
"sToValue",
"=",
"sValue",
";",
"}",
"if",
"(",
"sValue",
"==",
"null",
")",
"{",
"delete",
"this",
".",
"_oParameterValueAssignment",
"[",
"oUpperBoundaryParameter",
".",
"getName",
"(",
")",
"]",
";",
"}",
"else",
"{",
"this",
".",
"_oParameterValueAssignment",
"[",
"oUpperBoundaryParameter",
".",
"getName",
"(",
")",
"]",
"=",
"sToValue",
";",
"}",
"}",
"return",
";",
"}"
] |
Assign a value to a parameter
@param {String}
sParameterName Name of the parameter. In case of a range
value, provide the name of the lower boundary parameter.
@param {String}
sValue Assigned value. Pass null to remove a value assignment.
@param {String}
sToValue Omit it or set it to null for single values. If set,
it will be assigned to the upper boundary parameter
@public
@function
@name sap.ui.model.analytics.odata4analytics.ParameterizationRequest#setParameterValue
|
[
"Assign",
"a",
"value",
"to",
"a",
"parameter"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3898-L3941
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sServiceRootURI) {
var oDefinedParameters = this._oParameterization.getAllParameters();
for ( var sDefinedParameterName in oDefinedParameters) {
// check that all parameters have a value assigned. This is also
// true for those marked as optional, because the
// omitted value is conveyed by some default value, e.g. as empty
// string.
if (this._oParameterValueAssignment[sDefinedParameterName] == undefined) {
throw "Parameter " + sDefinedParameterName + " has no value assigned"; // TODO
}
}
var sKeyIdentification = "", bFirst = true;
for ( var sParameterName in this._oParameterValueAssignment) {
sKeyIdentification += (bFirst ? "" : ",")
+ sParameterName
+ "="
+ this._renderParameterKeyValue(this._oParameterValueAssignment[sParameterName],
oDefinedParameters[sParameterName].getProperty().type);
bFirst = false;
}
return (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oParameterization.getEntitySet().getQName() + "("
+ sKeyIdentification + ")";
}
|
javascript
|
function(sServiceRootURI) {
var oDefinedParameters = this._oParameterization.getAllParameters();
for ( var sDefinedParameterName in oDefinedParameters) {
// check that all parameters have a value assigned. This is also
// true for those marked as optional, because the
// omitted value is conveyed by some default value, e.g. as empty
// string.
if (this._oParameterValueAssignment[sDefinedParameterName] == undefined) {
throw "Parameter " + sDefinedParameterName + " has no value assigned"; // TODO
}
}
var sKeyIdentification = "", bFirst = true;
for ( var sParameterName in this._oParameterValueAssignment) {
sKeyIdentification += (bFirst ? "" : ",")
+ sParameterName
+ "="
+ this._renderParameterKeyValue(this._oParameterValueAssignment[sParameterName],
oDefinedParameters[sParameterName].getProperty().type);
bFirst = false;
}
return (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oParameterization.getEntitySet().getQName() + "("
+ sKeyIdentification + ")";
}
|
[
"function",
"(",
"sServiceRootURI",
")",
"{",
"var",
"oDefinedParameters",
"=",
"this",
".",
"_oParameterization",
".",
"getAllParameters",
"(",
")",
";",
"for",
"(",
"var",
"sDefinedParameterName",
"in",
"oDefinedParameters",
")",
"{",
"if",
"(",
"this",
".",
"_oParameterValueAssignment",
"[",
"sDefinedParameterName",
"]",
"==",
"undefined",
")",
"{",
"throw",
"\"Parameter \"",
"+",
"sDefinedParameterName",
"+",
"\" has no value assigned\"",
";",
"}",
"}",
"var",
"sKeyIdentification",
"=",
"\"\"",
",",
"bFirst",
"=",
"true",
";",
"for",
"(",
"var",
"sParameterName",
"in",
"this",
".",
"_oParameterValueAssignment",
")",
"{",
"sKeyIdentification",
"+=",
"(",
"bFirst",
"?",
"\"\"",
":",
"\",\"",
")",
"+",
"sParameterName",
"+",
"\"=\"",
"+",
"this",
".",
"_renderParameterKeyValue",
"(",
"this",
".",
"_oParameterValueAssignment",
"[",
"sParameterName",
"]",
",",
"oDefinedParameters",
"[",
"sParameterName",
"]",
".",
"getProperty",
"(",
")",
".",
"type",
")",
";",
"bFirst",
"=",
"false",
";",
"}",
"return",
"(",
"sServiceRootURI",
"?",
"sServiceRootURI",
":",
"\"\"",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oParameterization",
".",
"getEntitySet",
"(",
")",
".",
"getQName",
"(",
")",
"+",
"\"(\"",
"+",
"sKeyIdentification",
"+",
"\")\"",
";",
"}"
] |
Get the URI to locate the parameterization entity for the values assigned
to all parameters beforehand. Notice that a value must be supplied for
every parameter including those marked as optional. For optional
parameters, assign the special value that the service provider uses as an
"omitted" value. For example, for services based on BW Easy Queries, this
would be an empty string.
@param {String}
sServiceRootURI (optional) Identifies the root of the OData
service
@returns The resource path of the URI pointing to the entity set. It is a
relative URI unless a service root is given, which would then
prefixed in order to return a complete URL.
@public
@function
@name sap.ui.model.analytics.odata4analytics.ParameterizationRequest#getURIToParameterizationEntry
|
[
"Get",
"the",
"URI",
"to",
"locate",
"the",
"parameterization",
"entity",
"for",
"the",
"values",
"assigned",
"to",
"all",
"parameters",
"beforehand",
".",
"Notice",
"that",
"a",
"value",
"must",
"be",
"supplied",
"for",
"every",
"parameter",
"including",
"those",
"marked",
"as",
"optional",
".",
"For",
"optional",
"parameters",
"assign",
"the",
"special",
"value",
"that",
"the",
"service",
"provider",
"uses",
"as",
"an",
"omitted",
"value",
".",
"For",
"example",
"for",
"services",
"based",
"on",
"BW",
"Easy",
"Queries",
"this",
"would",
"be",
"an",
"empty",
"string",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3978-L4001
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function (sHierarchyDimensionName, bIncludeExternalKey,
bIncludeText) {
var oDimension;
if (!sHierarchyDimensionName) {
return;
}
// sHierarchyDimensionName is the name of a dimension property (and not e.g. of a
// dimension's text property), findDimensionByName can be used instead of
// findDimensionByPropertyName
oDimension = this._oQueryResult.findDimensionByName(sHierarchyDimensionName);
if (!oDimension) {
throw new Error("'" + sHierarchyDimensionName + "' is not a dimension property");
}
if (!oDimension.getHierarchy()) {
throw new Error("Dimension '" + sHierarchyDimensionName
+ "' does not have a hierarchy");
}
// reset previously compiled list of selected properties
this._oSelectedPropertyNames = null;
this._oDimensionHierarchies[sHierarchyDimensionName] = {
externalKey : bIncludeExternalKey,
id: true,
text : bIncludeText
};
}
|
javascript
|
function (sHierarchyDimensionName, bIncludeExternalKey,
bIncludeText) {
var oDimension;
if (!sHierarchyDimensionName) {
return;
}
// sHierarchyDimensionName is the name of a dimension property (and not e.g. of a
// dimension's text property), findDimensionByName can be used instead of
// findDimensionByPropertyName
oDimension = this._oQueryResult.findDimensionByName(sHierarchyDimensionName);
if (!oDimension) {
throw new Error("'" + sHierarchyDimensionName + "' is not a dimension property");
}
if (!oDimension.getHierarchy()) {
throw new Error("Dimension '" + sHierarchyDimensionName
+ "' does not have a hierarchy");
}
// reset previously compiled list of selected properties
this._oSelectedPropertyNames = null;
this._oDimensionHierarchies[sHierarchyDimensionName] = {
externalKey : bIncludeExternalKey,
id: true,
text : bIncludeText
};
}
|
[
"function",
"(",
"sHierarchyDimensionName",
",",
"bIncludeExternalKey",
",",
"bIncludeText",
")",
"{",
"var",
"oDimension",
";",
"if",
"(",
"!",
"sHierarchyDimensionName",
")",
"{",
"return",
";",
"}",
"oDimension",
"=",
"this",
".",
"_oQueryResult",
".",
"findDimensionByName",
"(",
"sHierarchyDimensionName",
")",
";",
"if",
"(",
"!",
"oDimension",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"'\"",
"+",
"sHierarchyDimensionName",
"+",
"\"' is not a dimension property\"",
")",
";",
"}",
"if",
"(",
"!",
"oDimension",
".",
"getHierarchy",
"(",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Dimension '\"",
"+",
"sHierarchyDimensionName",
"+",
"\"' does not have a hierarchy\"",
")",
";",
"}",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"this",
".",
"_oDimensionHierarchies",
"[",
"sHierarchyDimensionName",
"]",
"=",
"{",
"externalKey",
":",
"bIncludeExternalKey",
",",
"id",
":",
"true",
",",
"text",
":",
"bIncludeText",
"}",
";",
"}"
] |
Adds a recursive hierarchy to the aggregation level.
@param {string} sHierarchyDimensionName
Name of dimension whose hierarchy shall be part of the aggregation level
@param {boolean} bIncludeExternalKey
Indicator whether or not to include the external node key (if available) in the query
result
@param {boolean} bIncludeText
Indicator whether or not to include the node text (if available) in the query result
@throws {Error}
If the given name is not a name of a dimension or the corresponding dimension does not
have a hierarchy.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#addRecursiveHierarchy
|
[
"Adds",
"a",
"recursive",
"hierarchy",
"to",
"the",
"aggregation",
"level",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4065-L4091
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sResourcePath) {
this._sResourcePath = sResourcePath;
if (this._sResourcePath.indexOf("/") != 0) {
throw "Missing leading / (slash) for resource path";
}
if (this._oQueryResult.getParameterization()) {
var iLastPathSep = sResourcePath.lastIndexOf("/");
if (iLastPathSep == -1) {
throw "Missing navigation from parameter entity set to query result in resource path";
}
var sNavPropName = sResourcePath.substring(iLastPathSep + 1);
if (sNavPropName != this._oQueryResult.getParameterization().getNavigationPropertyToQueryResult()) {
throw "Invalid navigation property from parameter entity set to query result in resource path";
}
}
}
|
javascript
|
function(sResourcePath) {
this._sResourcePath = sResourcePath;
if (this._sResourcePath.indexOf("/") != 0) {
throw "Missing leading / (slash) for resource path";
}
if (this._oQueryResult.getParameterization()) {
var iLastPathSep = sResourcePath.lastIndexOf("/");
if (iLastPathSep == -1) {
throw "Missing navigation from parameter entity set to query result in resource path";
}
var sNavPropName = sResourcePath.substring(iLastPathSep + 1);
if (sNavPropName != this._oQueryResult.getParameterization().getNavigationPropertyToQueryResult()) {
throw "Invalid navigation property from parameter entity set to query result in resource path";
}
}
}
|
[
"function",
"(",
"sResourcePath",
")",
"{",
"this",
".",
"_sResourcePath",
"=",
"sResourcePath",
";",
"if",
"(",
"this",
".",
"_sResourcePath",
".",
"indexOf",
"(",
"\"/\"",
")",
"!=",
"0",
")",
"{",
"throw",
"\"Missing leading / (slash) for resource path\"",
";",
"}",
"if",
"(",
"this",
".",
"_oQueryResult",
".",
"getParameterization",
"(",
")",
")",
"{",
"var",
"iLastPathSep",
"=",
"sResourcePath",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"iLastPathSep",
"==",
"-",
"1",
")",
"{",
"throw",
"\"Missing navigation from parameter entity set to query result in resource path\"",
";",
"}",
"var",
"sNavPropName",
"=",
"sResourcePath",
".",
"substring",
"(",
"iLastPathSep",
"+",
"1",
")",
";",
"if",
"(",
"sNavPropName",
"!=",
"this",
".",
"_oQueryResult",
".",
"getParameterization",
"(",
")",
".",
"getNavigationPropertyToQueryResult",
"(",
")",
")",
"{",
"throw",
"\"Invalid navigation property from parameter entity set to query result in resource path\"",
";",
"}",
"}",
"}"
] |
Set the resource path to be considered for the OData request URI of this
query request object. This method provides an alternative way to assign a
path comprising a parameterization. If a path is provided, it overwrites
any parameterization object that might have been specified separately.
@param {string} sResourcePath
Resource path pointing to the entity set of the query result.
Must include a valid parameterization if query contains
parameters.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setResourcePath
|
[
"Set",
"the",
"resource",
"path",
"to",
"be",
"considered",
"for",
"the",
"OData",
"request",
"URI",
"of",
"this",
"query",
"request",
"object",
".",
"This",
"method",
"provides",
"an",
"alternative",
"way",
"to",
"assign",
"a",
"path",
"comprising",
"a",
"parameterization",
".",
"If",
"a",
"path",
"is",
"provided",
"it",
"overwrites",
"any",
"parameterization",
"object",
"that",
"might",
"have",
"been",
"specified",
"separately",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4123-L4138
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(aDimensionName) {
this._oAggregationLevel = {};
if (!aDimensionName) {
aDimensionName = this._oQueryResult.getAllDimensionNames();
}
this.addToAggregationLevel(aDimensionName);
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
}
|
javascript
|
function(aDimensionName) {
this._oAggregationLevel = {};
if (!aDimensionName) {
aDimensionName = this._oQueryResult.getAllDimensionNames();
}
this.addToAggregationLevel(aDimensionName);
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
}
|
[
"function",
"(",
"aDimensionName",
")",
"{",
"this",
".",
"_oAggregationLevel",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"aDimensionName",
")",
"{",
"aDimensionName",
"=",
"this",
".",
"_oQueryResult",
".",
"getAllDimensionNames",
"(",
")",
";",
"}",
"this",
".",
"addToAggregationLevel",
"(",
"aDimensionName",
")",
";",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"}"
] |
Set the aggregation level for the query result request. By default, the
query result will include the properties holding the keys of the given
dimensions. This setting can be changed using
includeDimensionKeyTextAttributes.
@param aDimensionName
Array of dimension names to be part of the aggregation level.
If null, the aggregation level includes all dimensions, if
empty, no dimension is included.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setAggregationLevel
|
[
"Set",
"the",
"aggregation",
"level",
"for",
"the",
"query",
"result",
"request",
".",
"By",
"default",
"the",
"query",
"result",
"will",
"include",
"the",
"properties",
"holding",
"the",
"keys",
"of",
"the",
"given",
"dimensions",
".",
"This",
"setting",
"can",
"be",
"changed",
"using",
"includeDimensionKeyTextAttributes",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4180-L4187
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(aDimensionName) {
if (!aDimensionName) {
return;
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) {
if (!this._oQueryResult.findDimensionByName(sDimName)) {
throw sDimName + " is not a valid dimension name"; // TODO
}
this._oAggregationLevel[sDimName] = {
key : true,
text : false,
attributes : null
};
}
}
|
javascript
|
function(aDimensionName) {
if (!aDimensionName) {
return;
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) {
if (!this._oQueryResult.findDimensionByName(sDimName)) {
throw sDimName + " is not a valid dimension name"; // TODO
}
this._oAggregationLevel[sDimName] = {
key : true,
text : false,
attributes : null
};
}
}
|
[
"function",
"(",
"aDimensionName",
")",
"{",
"if",
"(",
"!",
"aDimensionName",
")",
"{",
"return",
";",
"}",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"sDimName",
";",
"(",
"sDimName",
"=",
"aDimensionName",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_oQueryResult",
".",
"findDimensionByName",
"(",
"sDimName",
")",
")",
"{",
"throw",
"sDimName",
"+",
"\" is not a valid dimension name\"",
";",
"}",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
"=",
"{",
"key",
":",
"true",
",",
"text",
":",
"false",
",",
"attributes",
":",
"null",
"}",
";",
"}",
"}"
] |
Add one or more dimensions to the aggregation level
@param aDimensionName
Array of dimension names to be added to the already defined
aggregation level.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#addToAggregationLevel
|
[
"Add",
"one",
"or",
"more",
"dimensions",
"to",
"the",
"aggregation",
"level"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4200-L4217
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(aDimensionName) {
if (!aDimensionName) {
return;
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) {
if (!this._oQueryResult.findDimensionByName(sDimName)) {
throw sDimName + " is not a valid dimension name"; // TODO
}
if (this._oAggregationLevel[sDimName] != undefined) {
delete this._oAggregationLevel[sDimName];
// remove potential sort expression on this dimension
this.getSortExpression().removeSorter(sDimName);
}
}
}
|
javascript
|
function(aDimensionName) {
if (!aDimensionName) {
return;
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) {
if (!this._oQueryResult.findDimensionByName(sDimName)) {
throw sDimName + " is not a valid dimension name"; // TODO
}
if (this._oAggregationLevel[sDimName] != undefined) {
delete this._oAggregationLevel[sDimName];
// remove potential sort expression on this dimension
this.getSortExpression().removeSorter(sDimName);
}
}
}
|
[
"function",
"(",
"aDimensionName",
")",
"{",
"if",
"(",
"!",
"aDimensionName",
")",
"{",
"return",
";",
"}",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"sDimName",
";",
"(",
"sDimName",
"=",
"aDimensionName",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_oQueryResult",
".",
"findDimensionByName",
"(",
"sDimName",
")",
")",
"{",
"throw",
"sDimName",
"+",
"\" is not a valid dimension name\"",
";",
"}",
"if",
"(",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
"!=",
"undefined",
")",
"{",
"delete",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
";",
"this",
".",
"getSortExpression",
"(",
")",
".",
"removeSorter",
"(",
"sDimName",
")",
";",
"}",
"}",
"}"
] |
Remove one or more dimensions from the aggregation level. The method also
removed a potential sort expression on the dimension.
@param aDimensionName
Array of dimension names to be removed from the already
defined aggregation level.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#removeFromAggregationLevel
|
[
"Remove",
"one",
"or",
"more",
"dimensions",
"from",
"the",
"aggregation",
"level",
".",
"The",
"method",
"also",
"removed",
"a",
"potential",
"sort",
"expression",
"on",
"the",
"dimension",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4230-L4247
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(aMeasureName) {
if (!aMeasureName) {
aMeasureName = this._oQueryResult.getAllMeasureNames();
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
this._oMeasures = {};
for (var i = -1, sMeasName; (sMeasName = aMeasureName[++i]) !== undefined;) {
if (!this._oQueryResult.findMeasureByName(sMeasName)) {
throw sMeasName + " is not a valid measure name"; // TODO
}
this._oMeasures[sMeasName] = {
value : true,
text : false,
unit : false
};
}
}
|
javascript
|
function(aMeasureName) {
if (!aMeasureName) {
aMeasureName = this._oQueryResult.getAllMeasureNames();
}
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
this._oMeasures = {};
for (var i = -1, sMeasName; (sMeasName = aMeasureName[++i]) !== undefined;) {
if (!this._oQueryResult.findMeasureByName(sMeasName)) {
throw sMeasName + " is not a valid measure name"; // TODO
}
this._oMeasures[sMeasName] = {
value : true,
text : false,
unit : false
};
}
}
|
[
"function",
"(",
"aMeasureName",
")",
"{",
"if",
"(",
"!",
"aMeasureName",
")",
"{",
"aMeasureName",
"=",
"this",
".",
"_oQueryResult",
".",
"getAllMeasureNames",
"(",
")",
";",
"}",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"this",
".",
"_oMeasures",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"sMeasName",
";",
"(",
"sMeasName",
"=",
"aMeasureName",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_oQueryResult",
".",
"findMeasureByName",
"(",
"sMeasName",
")",
")",
"{",
"throw",
"sMeasName",
"+",
"\" is not a valid measure name\"",
";",
"}",
"this",
".",
"_oMeasures",
"[",
"sMeasName",
"]",
"=",
"{",
"value",
":",
"true",
",",
"text",
":",
"false",
",",
"unit",
":",
"false",
"}",
";",
"}",
"}"
] |
Set the measures to be included in the query result request. By default,
the query result will include the properties holding the raw values of
the given measures. This setting can be changed using
includeMeasureRawFormattedValueUnit.
@param aMeasureName
Array of measure names to be part of the query result request.
If null, the request includes all measures, if empty, no
measure is included.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setMeasures
|
[
"Set",
"the",
"measures",
"to",
"be",
"included",
"in",
"the",
"query",
"result",
"request",
".",
"By",
"default",
"the",
"query",
"result",
"will",
"include",
"the",
"properties",
"holding",
"the",
"raw",
"values",
"of",
"the",
"given",
"measures",
".",
"This",
"setting",
"can",
"be",
"changed",
"using",
"includeMeasureRawFormattedValueUnit",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4302-L4320
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sDimensionName, bIncludeKey, bIncludeText, aAttributeName) {
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
var aDimName = [];
if (sDimensionName) {
if (this._oAggregationLevel[sDimensionName] == undefined) {
throw sDimensionName + " is not included in the aggregation level";
}
aDimName.push(sDimensionName);
} else {
for ( var sName in this._oAggregationLevel) {
aDimName.push(sName);
}
aAttributeName = null;
}
for (var i = -1, sDimName; (sDimName = aDimName[++i]) !== undefined;) {
if (bIncludeKey != null) {
this._oAggregationLevel[sDimName].key = bIncludeKey;
}
if (bIncludeText != null) {
this._oAggregationLevel[sDimName].text = bIncludeText;
}
if (aAttributeName != null) {
this._oAggregationLevel[sDimName].attributes = aAttributeName;
}
}
}
|
javascript
|
function(sDimensionName, bIncludeKey, bIncludeText, aAttributeName) {
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
var aDimName = [];
if (sDimensionName) {
if (this._oAggregationLevel[sDimensionName] == undefined) {
throw sDimensionName + " is not included in the aggregation level";
}
aDimName.push(sDimensionName);
} else {
for ( var sName in this._oAggregationLevel) {
aDimName.push(sName);
}
aAttributeName = null;
}
for (var i = -1, sDimName; (sDimName = aDimName[++i]) !== undefined;) {
if (bIncludeKey != null) {
this._oAggregationLevel[sDimName].key = bIncludeKey;
}
if (bIncludeText != null) {
this._oAggregationLevel[sDimName].text = bIncludeText;
}
if (aAttributeName != null) {
this._oAggregationLevel[sDimName].attributes = aAttributeName;
}
}
}
|
[
"function",
"(",
"sDimensionName",
",",
"bIncludeKey",
",",
"bIncludeText",
",",
"aAttributeName",
")",
"{",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"var",
"aDimName",
"=",
"[",
"]",
";",
"if",
"(",
"sDimensionName",
")",
"{",
"if",
"(",
"this",
".",
"_oAggregationLevel",
"[",
"sDimensionName",
"]",
"==",
"undefined",
")",
"{",
"throw",
"sDimensionName",
"+",
"\" is not included in the aggregation level\"",
";",
"}",
"aDimName",
".",
"push",
"(",
"sDimensionName",
")",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oAggregationLevel",
")",
"{",
"aDimName",
".",
"push",
"(",
"sName",
")",
";",
"}",
"aAttributeName",
"=",
"null",
";",
"}",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"sDimName",
";",
"(",
"sDimName",
"=",
"aDimName",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"bIncludeKey",
"!=",
"null",
")",
"{",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
".",
"key",
"=",
"bIncludeKey",
";",
"}",
"if",
"(",
"bIncludeText",
"!=",
"null",
")",
"{",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
".",
"text",
"=",
"bIncludeText",
";",
"}",
"if",
"(",
"aAttributeName",
"!=",
"null",
")",
"{",
"this",
".",
"_oAggregationLevel",
"[",
"sDimName",
"]",
".",
"attributes",
"=",
"aAttributeName",
";",
"}",
"}",
"}"
] |
Specify which dimension components shall be included in the query result.
The settings get applied to the currently defined aggregation level.
@param {string} sDimensionName
Name of the dimension for which the settings get applied.
Specify null to apply the settings to all dimensions in the
aggregation level.
@param {boolean} bIncludeKey
Indicator whether or not to include the dimension key in the
query result. Pass null to keep current setting.
@param {boolean} bIncludeText
Indicator whether or not to include the dimension text (if
available) in the query result. Pass null to keep current
setting.
@param aAttributeName
Array of dimension attribute names to be included in the
result. Pass null to keep current setting. This argument is
ignored if sDimensionName is null.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#includeDimensionKeyTextAttributes
|
[
"Specify",
"which",
"dimension",
"components",
"shall",
"be",
"included",
"in",
"the",
"query",
"result",
".",
"The",
"settings",
"get",
"applied",
"to",
"the",
"currently",
"defined",
"aggregation",
"level",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4361-L4387
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sMeasureName, bIncludeRawValue, bIncludeFormattedValue, bIncludeUnit) {
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
var aMeasName = [];
if (sMeasureName) {
if (this._oMeasures[sMeasureName] == undefined) {
throw sMeasureName + " is not part of the query result";
}
aMeasName.push(sMeasureName);
} else {
for ( var sName in this._oMeasures) {
aMeasName.push(sName);
}
}
for (var i = -1, sMeasName; (sMeasName = aMeasName[++i]) !== undefined;) {
if (bIncludeRawValue != null) {
this._oMeasures[sMeasName].value = bIncludeRawValue;
}
if (bIncludeFormattedValue != null) {
this._oMeasures[sMeasName].text = bIncludeFormattedValue;
}
if (bIncludeUnit != null) {
this._oMeasures[sMeasName].unit = bIncludeUnit;
}
}
}
|
javascript
|
function(sMeasureName, bIncludeRawValue, bIncludeFormattedValue, bIncludeUnit) {
this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties
var aMeasName = [];
if (sMeasureName) {
if (this._oMeasures[sMeasureName] == undefined) {
throw sMeasureName + " is not part of the query result";
}
aMeasName.push(sMeasureName);
} else {
for ( var sName in this._oMeasures) {
aMeasName.push(sName);
}
}
for (var i = -1, sMeasName; (sMeasName = aMeasName[++i]) !== undefined;) {
if (bIncludeRawValue != null) {
this._oMeasures[sMeasName].value = bIncludeRawValue;
}
if (bIncludeFormattedValue != null) {
this._oMeasures[sMeasName].text = bIncludeFormattedValue;
}
if (bIncludeUnit != null) {
this._oMeasures[sMeasName].unit = bIncludeUnit;
}
}
}
|
[
"function",
"(",
"sMeasureName",
",",
"bIncludeRawValue",
",",
"bIncludeFormattedValue",
",",
"bIncludeUnit",
")",
"{",
"this",
".",
"_oSelectedPropertyNames",
"=",
"null",
";",
"var",
"aMeasName",
"=",
"[",
"]",
";",
"if",
"(",
"sMeasureName",
")",
"{",
"if",
"(",
"this",
".",
"_oMeasures",
"[",
"sMeasureName",
"]",
"==",
"undefined",
")",
"{",
"throw",
"sMeasureName",
"+",
"\" is not part of the query result\"",
";",
"}",
"aMeasName",
".",
"push",
"(",
"sMeasureName",
")",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oMeasures",
")",
"{",
"aMeasName",
".",
"push",
"(",
"sName",
")",
";",
"}",
"}",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"sMeasName",
";",
"(",
"sMeasName",
"=",
"aMeasName",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
"{",
"if",
"(",
"bIncludeRawValue",
"!=",
"null",
")",
"{",
"this",
".",
"_oMeasures",
"[",
"sMeasName",
"]",
".",
"value",
"=",
"bIncludeRawValue",
";",
"}",
"if",
"(",
"bIncludeFormattedValue",
"!=",
"null",
")",
"{",
"this",
".",
"_oMeasures",
"[",
"sMeasName",
"]",
".",
"text",
"=",
"bIncludeFormattedValue",
";",
"}",
"if",
"(",
"bIncludeUnit",
"!=",
"null",
")",
"{",
"this",
".",
"_oMeasures",
"[",
"sMeasName",
"]",
".",
"unit",
"=",
"bIncludeUnit",
";",
"}",
"}",
"}"
] |
Specify which measure components shall be included in the query result.
The settings get applied to the currently set measures.
@param {string} sMeasureName
Name of the measure for which the settings get applied.
Specify null to apply the settings to all currently set
measures.
@param {boolean} bIncludeRawValue
Indicator whether or not to include the raw value in the query
result. Pass null to keep current setting.
@param {boolean} bIncludeFormattedValue
Indicator whether or not to include the formatted value (if
available) in the query result. Pass null to keep current
setting.
@param {boolean} bIncludeUnit
Indicator whether or not to include the unit (if available) in
the query result. Pass null to keep current setting.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#includeMeasureRawFormattedValueUnit
|
[
"Specify",
"which",
"measure",
"components",
"shall",
"be",
"included",
"in",
"the",
"query",
"result",
".",
"The",
"settings",
"get",
"applied",
"to",
"the",
"currently",
"set",
"measures",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4411-L4436
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(bIncludeEntityKey, bIncludeCount, bReturnNoEntities) {
if (bIncludeEntityKey != null) {
this._bIncludeEntityKey = bIncludeEntityKey;
}
if (bIncludeCount != null) {
this._bIncludeCount = bIncludeCount;
}
if (bReturnNoEntities != null) {
this._bReturnNoEntities = bReturnNoEntities;
}
}
|
javascript
|
function(bIncludeEntityKey, bIncludeCount, bReturnNoEntities) {
if (bIncludeEntityKey != null) {
this._bIncludeEntityKey = bIncludeEntityKey;
}
if (bIncludeCount != null) {
this._bIncludeCount = bIncludeCount;
}
if (bReturnNoEntities != null) {
this._bReturnNoEntities = bReturnNoEntities;
}
}
|
[
"function",
"(",
"bIncludeEntityKey",
",",
"bIncludeCount",
",",
"bReturnNoEntities",
")",
"{",
"if",
"(",
"bIncludeEntityKey",
"!=",
"null",
")",
"{",
"this",
".",
"_bIncludeEntityKey",
"=",
"bIncludeEntityKey",
";",
"}",
"if",
"(",
"bIncludeCount",
"!=",
"null",
")",
"{",
"this",
".",
"_bIncludeCount",
"=",
"bIncludeCount",
";",
"}",
"if",
"(",
"bReturnNoEntities",
"!=",
"null",
")",
"{",
"this",
".",
"_bReturnNoEntities",
"=",
"bReturnNoEntities",
";",
"}",
"}"
] |
Set further options to be applied for the OData request to fetch the
query result
@param {Boolean}
bIncludeEntityKey Indicates whether or not the entity key
should be returned for every entry in the query result.
Default is not to include it. Pass null to keep current
setting.
@param {Boolean}
bIncludeCount Indicates whether or not the result shall
include a count for the returned entities. Default is not to
include it. Pass null to keep current setting.
@param {Boolean}
bReturnNoEntities Indicates whether or not the result shall
be empty. This will translate to $top=0 in the OData request and override
any setting done with setResultPageBoundaries. The default is not to
suppress entities in the result. Pass null to keep current setting.
The main use case for this option is to create a request
with $inlinecount returning an entity count.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setRequestOptions
|
[
"Set",
"further",
"options",
"to",
"be",
"applied",
"for",
"the",
"OData",
"request",
"to",
"fetch",
"the",
"query",
"result"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4536-L4546
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(start, end) {
if (start != null && typeof start !== "number") {
throw "Start value must be null or numeric"; // TODO
}
if (end !== null && typeof end !== "number") {
throw "End value must be null or numeric"; // TODO
}
if (start == null) {
start = 1;
}
if (start < 1 || start > (end == null ? start : end)) {
throw "Invalid values for requested page boundaries"; // TODO
}
this._iSkipRequestOption = (start > 1) ? start - 1 : null;
this._iTopRequestOption = (end != null) ? (end - start + 1) : null;
}
|
javascript
|
function(start, end) {
if (start != null && typeof start !== "number") {
throw "Start value must be null or numeric"; // TODO
}
if (end !== null && typeof end !== "number") {
throw "End value must be null or numeric"; // TODO
}
if (start == null) {
start = 1;
}
if (start < 1 || start > (end == null ? start : end)) {
throw "Invalid values for requested page boundaries"; // TODO
}
this._iSkipRequestOption = (start > 1) ? start - 1 : null;
this._iTopRequestOption = (end != null) ? (end - start + 1) : null;
}
|
[
"function",
"(",
"start",
",",
"end",
")",
"{",
"if",
"(",
"start",
"!=",
"null",
"&&",
"typeof",
"start",
"!==",
"\"number\"",
")",
"{",
"throw",
"\"Start value must be null or numeric\"",
";",
"}",
"if",
"(",
"end",
"!==",
"null",
"&&",
"typeof",
"end",
"!==",
"\"number\"",
")",
"{",
"throw",
"\"End value must be null or numeric\"",
";",
"}",
"if",
"(",
"start",
"==",
"null",
")",
"{",
"start",
"=",
"1",
";",
"}",
"if",
"(",
"start",
"<",
"1",
"||",
"start",
">",
"(",
"end",
"==",
"null",
"?",
"start",
":",
"end",
")",
")",
"{",
"throw",
"\"Invalid values for requested page boundaries\"",
";",
"}",
"this",
".",
"_iSkipRequestOption",
"=",
"(",
"start",
">",
"1",
")",
"?",
"start",
"-",
"1",
":",
"null",
";",
"this",
".",
"_iTopRequestOption",
"=",
"(",
"end",
"!=",
"null",
")",
"?",
"(",
"end",
"-",
"start",
"+",
"1",
")",
":",
"null",
";",
"}"
] |
Specify that only a page of the query result shall be returned. A page is
described by its boundaries, that are row numbers for the first and last
rows in the query result to be returned.
@param {Number}
start The first row of the query result to be returned.
Numbering starts at 1. Passing null is equivalent to start
with the first row.
@param {Number}
end The last row of the query result to be returned. Passing
null is equivalent to get all rows up to the end of the query
result.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setResultPageBoundaries
|
[
"Specify",
"that",
"only",
"a",
"page",
"of",
"the",
"query",
"result",
"shall",
"be",
"returned",
".",
"A",
"page",
"is",
"described",
"by",
"its",
"boundaries",
"that",
"are",
"row",
"numbers",
"for",
"the",
"first",
"and",
"last",
"rows",
"in",
"the",
"query",
"result",
"to",
"be",
"returned",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4565-L4583
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sServiceRootURI) {
var sURI = null;
if (this._sResourcePath != null) {
sURI = (sServiceRootURI ? sServiceRootURI : "") + this._sResourcePath;
} else if (this._oQueryResult.getParameterization()) {
if (!this._oParameterizationRequest) {
throw "Missing parameterization request";
} else {
sURI = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/"
+ this._oQueryResult.getParameterization().getNavigationPropertyToQueryResult();
}
} else {
sURI = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oQueryResult.getEntitySet().getQName();
}
return sURI;
}
|
javascript
|
function(sServiceRootURI) {
var sURI = null;
if (this._sResourcePath != null) {
sURI = (sServiceRootURI ? sServiceRootURI : "") + this._sResourcePath;
} else if (this._oQueryResult.getParameterization()) {
if (!this._oParameterizationRequest) {
throw "Missing parameterization request";
} else {
sURI = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/"
+ this._oQueryResult.getParameterization().getNavigationPropertyToQueryResult();
}
} else {
sURI = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oQueryResult.getEntitySet().getQName();
}
return sURI;
}
|
[
"function",
"(",
"sServiceRootURI",
")",
"{",
"var",
"sURI",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_sResourcePath",
"!=",
"null",
")",
"{",
"sURI",
"=",
"(",
"sServiceRootURI",
"?",
"sServiceRootURI",
":",
"\"\"",
")",
"+",
"this",
".",
"_sResourcePath",
";",
"}",
"else",
"if",
"(",
"this",
".",
"_oQueryResult",
".",
"getParameterization",
"(",
")",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_oParameterizationRequest",
")",
"{",
"throw",
"\"Missing parameterization request\"",
";",
"}",
"else",
"{",
"sURI",
"=",
"this",
".",
"_oParameterizationRequest",
".",
"getURIToParameterizationEntry",
"(",
"sServiceRootURI",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oQueryResult",
".",
"getParameterization",
"(",
")",
".",
"getNavigationPropertyToQueryResult",
"(",
")",
";",
"}",
"}",
"else",
"{",
"sURI",
"=",
"(",
"sServiceRootURI",
"?",
"sServiceRootURI",
":",
"\"\"",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oQueryResult",
".",
"getEntitySet",
"(",
")",
".",
"getQName",
"(",
")",
";",
"}",
"return",
"sURI",
";",
"}"
] |
Get the URI to locate the entity set for the query result.
@param {String}
sServiceRootURI (optional) Identifies the root of the OData
service
@returns {String} The resource path of the URI pointing to the entity
set. It is a relative URI unless a service root is given, which
would then prefixed in order to return a complete URL.
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResultRequest#getURIToQueryResultEntitySet
|
[
"Get",
"the",
"URI",
"to",
"locate",
"the",
"entity",
"set",
"for",
"the",
"query",
"result",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4624-L4639
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sServiceRootURI) {
// construct resource path
var sResourcePath = null;
sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/"
+ this._oParameter.getContainingParameterization().getEntitySet().getQName();
// check if request is compliant with filter constraints expressed in
// metadata
this.getFilterExpression().checkValidity();
// construct query options
var sSelectOption = this.getURIQueryOptionValue("$select");
var sFilterOption = this.getURIQueryOptionValue("$filter");
var sSortOption = this.getURIQueryOptionValue("$orderby");
var sURI = sResourcePath;
var bQuestionmark = false;
if (sSelectOption) {
sURI += "?$select=" + sSelectOption;
bQuestionmark = true;
}
if (this._oFilterExpression && sFilterOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$filter=" + sFilterOption;
}
if (this._oSortExpression && sSortOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$orderby=" + sSortOption;
}
return sURI;
}
|
javascript
|
function(sServiceRootURI) {
// construct resource path
var sResourcePath = null;
sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/"
+ this._oParameter.getContainingParameterization().getEntitySet().getQName();
// check if request is compliant with filter constraints expressed in
// metadata
this.getFilterExpression().checkValidity();
// construct query options
var sSelectOption = this.getURIQueryOptionValue("$select");
var sFilterOption = this.getURIQueryOptionValue("$filter");
var sSortOption = this.getURIQueryOptionValue("$orderby");
var sURI = sResourcePath;
var bQuestionmark = false;
if (sSelectOption) {
sURI += "?$select=" + sSelectOption;
bQuestionmark = true;
}
if (this._oFilterExpression && sFilterOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$filter=" + sFilterOption;
}
if (this._oSortExpression && sSortOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$orderby=" + sSortOption;
}
return sURI;
}
|
[
"function",
"(",
"sServiceRootURI",
")",
"{",
"var",
"sResourcePath",
"=",
"null",
";",
"sResourcePath",
"=",
"(",
"sServiceRootURI",
"?",
"sServiceRootURI",
":",
"\"\"",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oParameter",
".",
"getContainingParameterization",
"(",
")",
".",
"getEntitySet",
"(",
")",
".",
"getQName",
"(",
")",
";",
"this",
".",
"getFilterExpression",
"(",
")",
".",
"checkValidity",
"(",
")",
";",
"var",
"sSelectOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$select\"",
")",
";",
"var",
"sFilterOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$filter\"",
")",
";",
"var",
"sSortOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$orderby\"",
")",
";",
"var",
"sURI",
"=",
"sResourcePath",
";",
"var",
"bQuestionmark",
"=",
"false",
";",
"if",
"(",
"sSelectOption",
")",
"{",
"sURI",
"+=",
"\"?$select=\"",
"+",
"sSelectOption",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"if",
"(",
"this",
".",
"_oFilterExpression",
"&&",
"sFilterOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$filter=\"",
"+",
"sFilterOption",
";",
"}",
"if",
"(",
"this",
".",
"_oSortExpression",
"&&",
"sSortOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$orderby=\"",
"+",
"sSortOption",
";",
"}",
"return",
"sURI",
";",
"}"
] |
Get the unescaped URI to fetch the parameter value set.
@param {String}
sServiceRootURI (optional) Identifies the root of the OData
service
@returns {String} The unescaped URI that contains the OData resource path
and OData system query options to express the request for the
parameter value set..
@public
@function
@name sap.ui.model.analytics.odata4analytics.ParameterValueSetRequest#getURIToParameterValueSetEntries
|
[
"Get",
"the",
"unescaped",
"URI",
"to",
"fetch",
"the",
"parameter",
"value",
"set",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5100-L5143
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(bIncludeText, bIncludeAttributes) {
this._oValueSetResult.text = {
text : false,
attributes : false
};
if (bIncludeText == true) {
this._oValueSetResult.text = true;
}
if (bIncludeAttributes == true) {
this._oValueSetResult.attributes = true;
}
}
|
javascript
|
function(bIncludeText, bIncludeAttributes) {
this._oValueSetResult.text = {
text : false,
attributes : false
};
if (bIncludeText == true) {
this._oValueSetResult.text = true;
}
if (bIncludeAttributes == true) {
this._oValueSetResult.attributes = true;
}
}
|
[
"function",
"(",
"bIncludeText",
",",
"bIncludeAttributes",
")",
"{",
"this",
".",
"_oValueSetResult",
".",
"text",
"=",
"{",
"text",
":",
"false",
",",
"attributes",
":",
"false",
"}",
";",
"if",
"(",
"bIncludeText",
"==",
"true",
")",
"{",
"this",
".",
"_oValueSetResult",
".",
"text",
"=",
"true",
";",
"}",
"if",
"(",
"bIncludeAttributes",
"==",
"true",
")",
"{",
"this",
".",
"_oValueSetResult",
".",
"attributes",
"=",
"true",
";",
"}",
"}"
] |
Specify which components of the dimension shall be included in the value
set.
@param {boolean} bIncludeText
Indicator whether or not to include the dimension text (if
available) in the value set.
@param {boolean} bIncludeAttributes
Indicator whether or not to include all dimension attributes
(if available) in the value set.
@public
@function
@name sap.ui.model.analytics.odata4analytics.includeDimensionTextAttributes
|
[
"Specify",
"which",
"components",
"of",
"the",
"dimension",
"shall",
"be",
"included",
"in",
"the",
"value",
"set",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5238-L5249
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sServiceRootURI) {
var sResourcePath = null;
if (!this._bUseMasterData && this._oParameterizationRequest) {
sResourcePath = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/"
+ this._oDimension.getContainingQueryResult().getParameterization().getNavigationPropertyToQueryResult();
} else {
sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oEntitySet.getQName();
}
return sResourcePath;
}
|
javascript
|
function(sServiceRootURI) {
var sResourcePath = null;
if (!this._bUseMasterData && this._oParameterizationRequest) {
sResourcePath = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/"
+ this._oDimension.getContainingQueryResult().getParameterization().getNavigationPropertyToQueryResult();
} else {
sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oEntitySet.getQName();
}
return sResourcePath;
}
|
[
"function",
"(",
"sServiceRootURI",
")",
"{",
"var",
"sResourcePath",
"=",
"null",
";",
"if",
"(",
"!",
"this",
".",
"_bUseMasterData",
"&&",
"this",
".",
"_oParameterizationRequest",
")",
"{",
"sResourcePath",
"=",
"this",
".",
"_oParameterizationRequest",
".",
"getURIToParameterizationEntry",
"(",
"sServiceRootURI",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oDimension",
".",
"getContainingQueryResult",
"(",
")",
".",
"getParameterization",
"(",
")",
".",
"getNavigationPropertyToQueryResult",
"(",
")",
";",
"}",
"else",
"{",
"sResourcePath",
"=",
"(",
"sServiceRootURI",
"?",
"sServiceRootURI",
":",
"\"\"",
")",
"+",
"\"/\"",
"+",
"this",
".",
"_oEntitySet",
".",
"getQName",
"(",
")",
";",
"}",
"return",
"sResourcePath",
";",
"}"
] |
Get the URI to locate the entity set for the dimension memebers.
@param {String}
sServiceRootURI (optional) Identifies the root of the OData
service
@returns {String} The resource path of the URI pointing to the entity
set. It is a relative URI unless a service root is given, which
would then prefixed in order to return a complete URL.
@public
@function
@name sap.ui.model.analytics.odata4analytics.DimensionMemberSetRequest#getURIToDimensionMemberEntitySet
|
[
"Get",
"the",
"URI",
"to",
"locate",
"the",
"entity",
"set",
"for",
"the",
"dimension",
"memebers",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5536-L5545
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
|
function(sServiceRootURI) {
// construct resource path
var sResourcePath = this.getURIToDimensionMemberEntitySet(sServiceRootURI);
// check if request is compliant with filter constraints expressed in
// metadata
this.getFilterExpression().checkValidity();
// construct query options
var sSelectOption = this.getURIQueryOptionValue("$select");
var sFilterOption = this.getURIQueryOptionValue("$filter");
var sSortOption = this.getURIQueryOptionValue("$orderby");
var sTopOption = this.getURIQueryOptionValue("$top");
var sSkipOption = this.getURIQueryOptionValue("$skip");
var sInlineCountOption = this.getURIQueryOptionValue("$inlinecount");
var sURI = sResourcePath;
var bQuestionmark = false;
if (sSelectOption) {
sURI += "?$select=" + sSelectOption;
bQuestionmark = true;
}
if (this._oFilterExpression && sFilterOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$filter=" + sFilterOption;
}
if (this._oSortExpression && sSortOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$orderby=" + sSortOption;
}
if (this._iTopRequestOption && sTopOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$top=" + sTopOption;
}
if (this._iSkipRequestOption && sSkipOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$skip=" + sSkipOption;
}
if (this._bIncludeCount && sInlineCountOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$inlinecount=" + sInlineCountOption;
}
return sURI;
}
|
javascript
|
function(sServiceRootURI) {
// construct resource path
var sResourcePath = this.getURIToDimensionMemberEntitySet(sServiceRootURI);
// check if request is compliant with filter constraints expressed in
// metadata
this.getFilterExpression().checkValidity();
// construct query options
var sSelectOption = this.getURIQueryOptionValue("$select");
var sFilterOption = this.getURIQueryOptionValue("$filter");
var sSortOption = this.getURIQueryOptionValue("$orderby");
var sTopOption = this.getURIQueryOptionValue("$top");
var sSkipOption = this.getURIQueryOptionValue("$skip");
var sInlineCountOption = this.getURIQueryOptionValue("$inlinecount");
var sURI = sResourcePath;
var bQuestionmark = false;
if (sSelectOption) {
sURI += "?$select=" + sSelectOption;
bQuestionmark = true;
}
if (this._oFilterExpression && sFilterOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$filter=" + sFilterOption;
}
if (this._oSortExpression && sSortOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$orderby=" + sSortOption;
}
if (this._iTopRequestOption && sTopOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$top=" + sTopOption;
}
if (this._iSkipRequestOption && sSkipOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$skip=" + sSkipOption;
}
if (this._bIncludeCount && sInlineCountOption) {
if (!bQuestionmark) {
sURI += "?";
bQuestionmark = true;
} else {
sURI += "&";
}
sURI += "$inlinecount=" + sInlineCountOption;
}
return sURI;
}
|
[
"function",
"(",
"sServiceRootURI",
")",
"{",
"var",
"sResourcePath",
"=",
"this",
".",
"getURIToDimensionMemberEntitySet",
"(",
"sServiceRootURI",
")",
";",
"this",
".",
"getFilterExpression",
"(",
")",
".",
"checkValidity",
"(",
")",
";",
"var",
"sSelectOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$select\"",
")",
";",
"var",
"sFilterOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$filter\"",
")",
";",
"var",
"sSortOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$orderby\"",
")",
";",
"var",
"sTopOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$top\"",
")",
";",
"var",
"sSkipOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$skip\"",
")",
";",
"var",
"sInlineCountOption",
"=",
"this",
".",
"getURIQueryOptionValue",
"(",
"\"$inlinecount\"",
")",
";",
"var",
"sURI",
"=",
"sResourcePath",
";",
"var",
"bQuestionmark",
"=",
"false",
";",
"if",
"(",
"sSelectOption",
")",
"{",
"sURI",
"+=",
"\"?$select=\"",
"+",
"sSelectOption",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"if",
"(",
"this",
".",
"_oFilterExpression",
"&&",
"sFilterOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$filter=\"",
"+",
"sFilterOption",
";",
"}",
"if",
"(",
"this",
".",
"_oSortExpression",
"&&",
"sSortOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$orderby=\"",
"+",
"sSortOption",
";",
"}",
"if",
"(",
"this",
".",
"_iTopRequestOption",
"&&",
"sTopOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$top=\"",
"+",
"sTopOption",
";",
"}",
"if",
"(",
"this",
".",
"_iSkipRequestOption",
"&&",
"sSkipOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$skip=\"",
"+",
"sSkipOption",
";",
"}",
"if",
"(",
"this",
".",
"_bIncludeCount",
"&&",
"sInlineCountOption",
")",
"{",
"if",
"(",
"!",
"bQuestionmark",
")",
"{",
"sURI",
"+=",
"\"?\"",
";",
"bQuestionmark",
"=",
"true",
";",
"}",
"else",
"{",
"sURI",
"+=",
"\"&\"",
";",
"}",
"sURI",
"+=",
"\"$inlinecount=\"",
"+",
"sInlineCountOption",
";",
"}",
"return",
"sURI",
";",
"}"
] |
Get the unescaped URI to fetch the dimension members, optionally
augmented by text and attributes.
@param {String}
sServiceRootURI (optional) Identifies the root of the OData
service
@returns {String} The unescaped URI that contains the OData resource path
and OData system query options to express the request for the
parameter value set..
@public
@function
@name sap.ui.model.analytics.odata4analytics.DimensionMemberSetRequest#getURIToDimensionMemberEntries
|
[
"Get",
"the",
"unescaped",
"URI",
"to",
"fetch",
"the",
"dimension",
"members",
"optionally",
"augmented",
"by",
"text",
"and",
"attributes",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5561-L5631
|
train
|
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js
|
flattenBindings
|
function flattenBindings(oBinding, oParentDefaultModel) {
var aBindings = [];
var sModelName = oBinding.getMetadata().getName();
if (sModelName === "sap.ui.model.CompositeBinding") {
oBinding.getBindings().forEach(function (oBinding) {
aBindings = aBindings.concat(flattenBindings(oBinding, oParentDefaultModel));
});
} else if (
(
sModelName === "sap.ui.model.odata.ODataPropertyBinding"
|| sModelName === "sap.ui.model.odata.v2.ODataPropertyBinding"
|| sModelName === "sap.ui.model.odata.v4.ODataPropertyBinding"
|| sModelName === "sap.ui.model.json.JSONPropertyBinding"
|| sModelName === "sap.ui.model.json.XMLPropertyBinding"
|| sModelName === "sap.ui.model.resource.ResourcePropertyBinding"
)
&& oBinding.getModel() === oParentDefaultModel
&& oBinding.isRelative()
&& jQuery.isFunction(oBinding.getPath)
&& oBinding.getPath()
) {
aBindings.push(oBinding);
}
return aBindings;
}
|
javascript
|
function flattenBindings(oBinding, oParentDefaultModel) {
var aBindings = [];
var sModelName = oBinding.getMetadata().getName();
if (sModelName === "sap.ui.model.CompositeBinding") {
oBinding.getBindings().forEach(function (oBinding) {
aBindings = aBindings.concat(flattenBindings(oBinding, oParentDefaultModel));
});
} else if (
(
sModelName === "sap.ui.model.odata.ODataPropertyBinding"
|| sModelName === "sap.ui.model.odata.v2.ODataPropertyBinding"
|| sModelName === "sap.ui.model.odata.v4.ODataPropertyBinding"
|| sModelName === "sap.ui.model.json.JSONPropertyBinding"
|| sModelName === "sap.ui.model.json.XMLPropertyBinding"
|| sModelName === "sap.ui.model.resource.ResourcePropertyBinding"
)
&& oBinding.getModel() === oParentDefaultModel
&& oBinding.isRelative()
&& jQuery.isFunction(oBinding.getPath)
&& oBinding.getPath()
) {
aBindings.push(oBinding);
}
return aBindings;
}
|
[
"function",
"flattenBindings",
"(",
"oBinding",
",",
"oParentDefaultModel",
")",
"{",
"var",
"aBindings",
"=",
"[",
"]",
";",
"var",
"sModelName",
"=",
"oBinding",
".",
"getMetadata",
"(",
")",
".",
"getName",
"(",
")",
";",
"if",
"(",
"sModelName",
"===",
"\"sap.ui.model.CompositeBinding\"",
")",
"{",
"oBinding",
".",
"getBindings",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"oBinding",
")",
"{",
"aBindings",
"=",
"aBindings",
".",
"concat",
"(",
"flattenBindings",
"(",
"oBinding",
",",
"oParentDefaultModel",
")",
")",
";",
"}",
")",
";",
"}",
"else",
"if",
"(",
"(",
"sModelName",
"===",
"\"sap.ui.model.odata.ODataPropertyBinding\"",
"||",
"sModelName",
"===",
"\"sap.ui.model.odata.v2.ODataPropertyBinding\"",
"||",
"sModelName",
"===",
"\"sap.ui.model.odata.v4.ODataPropertyBinding\"",
"||",
"sModelName",
"===",
"\"sap.ui.model.json.JSONPropertyBinding\"",
"||",
"sModelName",
"===",
"\"sap.ui.model.json.XMLPropertyBinding\"",
"||",
"sModelName",
"===",
"\"sap.ui.model.resource.ResourcePropertyBinding\"",
")",
"&&",
"oBinding",
".",
"getModel",
"(",
")",
"===",
"oParentDefaultModel",
"&&",
"oBinding",
".",
"isRelative",
"(",
")",
"&&",
"jQuery",
".",
"isFunction",
"(",
"oBinding",
".",
"getPath",
")",
"&&",
"oBinding",
".",
"getPath",
"(",
")",
")",
"{",
"aBindings",
".",
"push",
"(",
"oBinding",
")",
";",
"}",
"return",
"aBindings",
";",
"}"
] |
Fetches all bindings for a specified binding model
@param {sap.ui.model.PropertyBinding} oBinding - Binding model to get paths from
@param {sap.ui.model.odata.XX.ODataModel} oParentDefaultModel - Data model (XX = '', v2, v4...)
@returns {Array} - Returns a flattened array of found bindings
@private
|
[
"Fetches",
"all",
"bindings",
"for",
"a",
"specified",
"binding",
"model"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L137-L163
|
train
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js
|
flattenBindingsFromTemplate
|
function flattenBindingsFromTemplate(mBinding) {
var aBindings = [];
var aParts = mBinding.parts;
// TODO: check if we need to filter bindings by modelName, relative indicator ("/")
aParts.forEach(function (mPart) {
aBindings.push({
parts: [mPart]
});
});
return aBindings;
}
|
javascript
|
function flattenBindingsFromTemplate(mBinding) {
var aBindings = [];
var aParts = mBinding.parts;
// TODO: check if we need to filter bindings by modelName, relative indicator ("/")
aParts.forEach(function (mPart) {
aBindings.push({
parts: [mPart]
});
});
return aBindings;
}
|
[
"function",
"flattenBindingsFromTemplate",
"(",
"mBinding",
")",
"{",
"var",
"aBindings",
"=",
"[",
"]",
";",
"var",
"aParts",
"=",
"mBinding",
".",
"parts",
";",
"aParts",
".",
"forEach",
"(",
"function",
"(",
"mPart",
")",
"{",
"aBindings",
".",
"push",
"(",
"{",
"parts",
":",
"[",
"mPart",
"]",
"}",
")",
";",
"}",
")",
";",
"return",
"aBindings",
";",
"}"
] |
Fetches all bindings from template
@param {object} mBinding - map of bindings from Control (mBindingsInfo)
@returns {Array} - Returns a flattened array of found bindings
@private
|
[
"Fetches",
"all",
"bindings",
"from",
"template"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L172-L184
|
train
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js
|
getBindingsFromProperties
|
function getBindingsFromProperties(oElement, oParentDefaultModel) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
// filter properties which are not bound
.filter(oElement.getBinding.bind(oElement))
.reduce(function (aBindings, sPropertyName) {
return aBindings.concat(
flattenBindings(
oElement.getBinding(sPropertyName),
oParentDefaultModel
)
);
}, []);
}
|
javascript
|
function getBindingsFromProperties(oElement, oParentDefaultModel) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
// filter properties which are not bound
.filter(oElement.getBinding.bind(oElement))
.reduce(function (aBindings, sPropertyName) {
return aBindings.concat(
flattenBindings(
oElement.getBinding(sPropertyName),
oParentDefaultModel
)
);
}, []);
}
|
[
"function",
"getBindingsFromProperties",
"(",
"oElement",
",",
"oParentDefaultModel",
")",
"{",
"var",
"aPropertiesKeys",
"=",
"Object",
".",
"keys",
"(",
"oElement",
".",
"getMetadata",
"(",
")",
".",
"getAllProperties",
"(",
")",
")",
";",
"return",
"aPropertiesKeys",
".",
"filter",
"(",
"oElement",
".",
"getBinding",
".",
"bind",
"(",
"oElement",
")",
")",
".",
"reduce",
"(",
"function",
"(",
"aBindings",
",",
"sPropertyName",
")",
"{",
"return",
"aBindings",
".",
"concat",
"(",
"flattenBindings",
"(",
"oElement",
".",
"getBinding",
"(",
"sPropertyName",
")",
",",
"oParentDefaultModel",
")",
")",
";",
"}",
",",
"[",
"]",
")",
";",
"}"
] |
Retrieving all bindings from all available properties for a specified element
@param {sap.ui.core.Control} oElement - element to get bindings from
@param {sap.ui.model.Model} oParentDefaultModel - parent model to filter irrelevant bindings
@return {Array} - returns found bindings
@private
|
[
"Retrieving",
"all",
"bindings",
"from",
"all",
"available",
"properties",
"for",
"a",
"specified",
"element"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L196-L210
|
train
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js
|
getBindingsFromTemplateProperties
|
function getBindingsFromTemplateProperties(oElement) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
.filter(function (sPropertyName) {
return sPropertyName in oElement.mBindingInfos;
})
.reduce(function (aBindings, sPropertyName) {
return aBindings.concat(
flattenBindingsFromTemplate(
oElement.mBindingInfos[sPropertyName]
)
);
}, []);
}
|
javascript
|
function getBindingsFromTemplateProperties(oElement) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
.filter(function (sPropertyName) {
return sPropertyName in oElement.mBindingInfos;
})
.reduce(function (aBindings, sPropertyName) {
return aBindings.concat(
flattenBindingsFromTemplate(
oElement.mBindingInfos[sPropertyName]
)
);
}, []);
}
|
[
"function",
"getBindingsFromTemplateProperties",
"(",
"oElement",
")",
"{",
"var",
"aPropertiesKeys",
"=",
"Object",
".",
"keys",
"(",
"oElement",
".",
"getMetadata",
"(",
")",
".",
"getAllProperties",
"(",
")",
")",
";",
"return",
"aPropertiesKeys",
".",
"filter",
"(",
"function",
"(",
"sPropertyName",
")",
"{",
"return",
"sPropertyName",
"in",
"oElement",
".",
"mBindingInfos",
";",
"}",
")",
".",
"reduce",
"(",
"function",
"(",
"aBindings",
",",
"sPropertyName",
")",
"{",
"return",
"aBindings",
".",
"concat",
"(",
"flattenBindingsFromTemplate",
"(",
"oElement",
".",
"mBindingInfos",
"[",
"sPropertyName",
"]",
")",
")",
";",
"}",
",",
"[",
"]",
")",
";",
"}"
] |
Retrieving all bindings from all available properties for a specified element of template
@param {sap.ui.core.Control} oElement - element to get bindings from
@return {Array} - returns found bindings
@private
|
[
"Retrieving",
"all",
"bindings",
"from",
"all",
"available",
"properties",
"for",
"a",
"specified",
"element",
"of",
"template"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L219-L233
|
train
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js
|
getBindingContextPath
|
function getBindingContextPath(oElement) {
if (oElement.getBindingContext() && oElement.getBindingContext().getPath) {
return oElement.getBindingContext().getPath();
}
return undefined;
}
|
javascript
|
function getBindingContextPath(oElement) {
if (oElement.getBindingContext() && oElement.getBindingContext().getPath) {
return oElement.getBindingContext().getPath();
}
return undefined;
}
|
[
"function",
"getBindingContextPath",
"(",
"oElement",
")",
"{",
"if",
"(",
"oElement",
".",
"getBindingContext",
"(",
")",
"&&",
"oElement",
".",
"getBindingContext",
"(",
")",
".",
"getPath",
")",
"{",
"return",
"oElement",
".",
"getBindingContext",
"(",
")",
".",
"getPath",
"(",
")",
";",
"}",
"return",
"undefined",
";",
"}"
] |
Retrieving context binding path from element
@param {sap.ui.core.Control} oElement - element to get context binding paths from
@return {boolean|string} - Returns the binding context path string from element. If not available <code>false</code> is returned.
@private
|
[
"Retrieving",
"context",
"binding",
"path",
"from",
"element"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L242-L247
|
train
|
SAP/openui5
|
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ReleaseNotes.controller.js
|
function (sVersionA, sVersionB) {
var oVA = Version(sVersionA),
oVB = Version(sVersionB);
return (oVA.getMajor() + "." + oVA.getMinor()) === (oVB.getMajor() + "." + oVB.getMinor());
}
|
javascript
|
function (sVersionA, sVersionB) {
var oVA = Version(sVersionA),
oVB = Version(sVersionB);
return (oVA.getMajor() + "." + oVA.getMinor()) === (oVB.getMajor() + "." + oVB.getMinor());
}
|
[
"function",
"(",
"sVersionA",
",",
"sVersionB",
")",
"{",
"var",
"oVA",
"=",
"Version",
"(",
"sVersionA",
")",
",",
"oVB",
"=",
"Version",
"(",
"sVersionB",
")",
";",
"return",
"(",
"oVA",
".",
"getMajor",
"(",
")",
"+",
"\".\"",
"+",
"oVA",
".",
"getMinor",
"(",
")",
")",
"===",
"(",
"oVB",
".",
"getMajor",
"(",
")",
"+",
"\".\"",
"+",
"oVB",
".",
"getMinor",
"(",
")",
")",
";",
"}"
] |
Compares 2 UI5 version strings taking into account only major and minor version info
@returns {boolean}
|
[
"Compares",
"2",
"UI5",
"version",
"strings",
"taking",
"into",
"account",
"only",
"major",
"and",
"minor",
"version",
"info"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ReleaseNotes.controller.js#L139-L144
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/dnd/DragAndDrop.js
|
addStyleClass
|
function addStyleClass(oElement, sStyleClass) {
if (!oElement) {
return;
}
if (oElement.addStyleClass) {
oElement.addStyleClass(sStyleClass);
} else {
oElement.$().addClass(sStyleClass);
}
}
|
javascript
|
function addStyleClass(oElement, sStyleClass) {
if (!oElement) {
return;
}
if (oElement.addStyleClass) {
oElement.addStyleClass(sStyleClass);
} else {
oElement.$().addClass(sStyleClass);
}
}
|
[
"function",
"addStyleClass",
"(",
"oElement",
",",
"sStyleClass",
")",
"{",
"if",
"(",
"!",
"oElement",
")",
"{",
"return",
";",
"}",
"if",
"(",
"oElement",
".",
"addStyleClass",
")",
"{",
"oElement",
".",
"addStyleClass",
"(",
"sStyleClass",
")",
";",
"}",
"else",
"{",
"oElement",
".",
"$",
"(",
")",
".",
"addClass",
"(",
"sStyleClass",
")",
";",
"}",
"}"
] |
timestamp of drag enter
|
[
"timestamp",
"of",
"drag",
"enter"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/dnd/DragAndDrop.js#L36-L46
|
train
|
SAP/openui5
|
src/sap.ui.dt/src/sap/ui/dt/enablement/report/Table.js
|
function(sFilter) {
var oModel = this._getTable().getModel();
if (oModel) {
if (sFilter.length > 0) {
// As UI5 does not support filtering on first level, we have to do it on our own
var aData = this.getData();
var aFilteredData = aData.children.filter(function(oEntry) {
if (sFilter.indexOf("status=") != -1) {
return oEntry.status.value == sFilter.substring(sFilter.indexOf("=") + 1);
} else {
return oEntry.name.toLowerCase().indexOf(sFilter.toLowerCase()) != -1;
}
});
oModel.setData(aFilteredData);
} else {
oModel.setData(this.getData());
}
}
}
|
javascript
|
function(sFilter) {
var oModel = this._getTable().getModel();
if (oModel) {
if (sFilter.length > 0) {
// As UI5 does not support filtering on first level, we have to do it on our own
var aData = this.getData();
var aFilteredData = aData.children.filter(function(oEntry) {
if (sFilter.indexOf("status=") != -1) {
return oEntry.status.value == sFilter.substring(sFilter.indexOf("=") + 1);
} else {
return oEntry.name.toLowerCase().indexOf(sFilter.toLowerCase()) != -1;
}
});
oModel.setData(aFilteredData);
} else {
oModel.setData(this.getData());
}
}
}
|
[
"function",
"(",
"sFilter",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_getTable",
"(",
")",
".",
"getModel",
"(",
")",
";",
"if",
"(",
"oModel",
")",
"{",
"if",
"(",
"sFilter",
".",
"length",
">",
"0",
")",
"{",
"var",
"aData",
"=",
"this",
".",
"getData",
"(",
")",
";",
"var",
"aFilteredData",
"=",
"aData",
".",
"children",
".",
"filter",
"(",
"function",
"(",
"oEntry",
")",
"{",
"if",
"(",
"sFilter",
".",
"indexOf",
"(",
"\"status=\"",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"oEntry",
".",
"status",
".",
"value",
"==",
"sFilter",
".",
"substring",
"(",
"sFilter",
".",
"indexOf",
"(",
"\"=\"",
")",
"+",
"1",
")",
";",
"}",
"else",
"{",
"return",
"oEntry",
".",
"name",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"sFilter",
".",
"toLowerCase",
"(",
")",
")",
"!=",
"-",
"1",
";",
"}",
"}",
")",
";",
"oModel",
".",
"setData",
"(",
"aFilteredData",
")",
";",
"}",
"else",
"{",
"oModel",
".",
"setData",
"(",
"this",
".",
"getData",
"(",
")",
")",
";",
"}",
"}",
"}"
] |
Filters the table.
@param {sString} sFilter The filter string.
@public
|
[
"Filters",
"the",
"table",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/enablement/report/Table.js#L124-L143
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/thirdparty/less.js
|
function(isRule) {
var elements, e, index = i, option, extendList, extend;
if (!(isRule ? $re(/^&:extend\(/) : $re(/^:extend\(/))) { return; }
do {
option = null;
elements = null;
while (! (option = $re(/^(all)(?=\s*(\)|,))/))) {
e = this.element();
if (!e) { break; }
if (elements) { elements.push(e); } else { elements = [ e ]; }
}
option = option && option[1];
extend = new(tree.Extend)(new(tree.Selector)(elements), option, index);
if (extendList) { extendList.push(extend); } else { extendList = [ extend ]; }
} while($char(","));
expect(/^\)/);
if (isRule) {
expect(/^;/);
}
return extendList;
}
|
javascript
|
function(isRule) {
var elements, e, index = i, option, extendList, extend;
if (!(isRule ? $re(/^&:extend\(/) : $re(/^:extend\(/))) { return; }
do {
option = null;
elements = null;
while (! (option = $re(/^(all)(?=\s*(\)|,))/))) {
e = this.element();
if (!e) { break; }
if (elements) { elements.push(e); } else { elements = [ e ]; }
}
option = option && option[1];
extend = new(tree.Extend)(new(tree.Selector)(elements), option, index);
if (extendList) { extendList.push(extend); } else { extendList = [ extend ]; }
} while($char(","));
expect(/^\)/);
if (isRule) {
expect(/^;/);
}
return extendList;
}
|
[
"function",
"(",
"isRule",
")",
"{",
"var",
"elements",
",",
"e",
",",
"index",
"=",
"i",
",",
"option",
",",
"extendList",
",",
"extend",
";",
"if",
"(",
"!",
"(",
"isRule",
"?",
"$re",
"(",
"/",
"^&:extend\\(",
"/",
")",
":",
"$re",
"(",
"/",
"^:extend\\(",
"/",
")",
")",
")",
"{",
"return",
";",
"}",
"do",
"{",
"option",
"=",
"null",
";",
"elements",
"=",
"null",
";",
"while",
"(",
"!",
"(",
"option",
"=",
"$re",
"(",
"/",
"^(all)(?=\\s*(\\)|,))",
"/",
")",
")",
")",
"{",
"e",
"=",
"this",
".",
"element",
"(",
")",
";",
"if",
"(",
"!",
"e",
")",
"{",
"break",
";",
"}",
"if",
"(",
"elements",
")",
"{",
"elements",
".",
"push",
"(",
"e",
")",
";",
"}",
"else",
"{",
"elements",
"=",
"[",
"e",
"]",
";",
"}",
"}",
"option",
"=",
"option",
"&&",
"option",
"[",
"1",
"]",
";",
"extend",
"=",
"new",
"(",
"tree",
".",
"Extend",
")",
"(",
"new",
"(",
"tree",
".",
"Selector",
")",
"(",
"elements",
")",
",",
"option",
",",
"index",
")",
";",
"if",
"(",
"extendList",
")",
"{",
"extendList",
".",
"push",
"(",
"extend",
")",
";",
"}",
"else",
"{",
"extendList",
"=",
"[",
"extend",
"]",
";",
"}",
"}",
"while",
"(",
"$char",
"(",
"\",\"",
")",
")",
";",
"expect",
"(",
"/",
"^\\)",
"/",
")",
";",
"if",
"(",
"isRule",
")",
"{",
"expect",
"(",
"/",
"^;",
"/",
")",
";",
"}",
"return",
"extendList",
";",
"}"
] |
extend syntax - used to extend selectors
|
[
"extend",
"syntax",
"-",
"used",
"to",
"extend",
"selectors"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1060-L1088
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/thirdparty/less.js
|
function () {
var entities = [], e, delim;
do {
e = this.addition() || this.entity();
if (e) {
entities.push(e);
// operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
if (!peek(/^\/[\/*]/)) {
delim = $char('/');
if (delim) {
entities.push(new(tree.Anonymous)(delim));
}
}
}
} while (e);
if (entities.length > 0) {
return new(tree.Expression)(entities);
}
}
|
javascript
|
function () {
var entities = [], e, delim;
do {
e = this.addition() || this.entity();
if (e) {
entities.push(e);
// operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
if (!peek(/^\/[\/*]/)) {
delim = $char('/');
if (delim) {
entities.push(new(tree.Anonymous)(delim));
}
}
}
} while (e);
if (entities.length > 0) {
return new(tree.Expression)(entities);
}
}
|
[
"function",
"(",
")",
"{",
"var",
"entities",
"=",
"[",
"]",
",",
"e",
",",
"delim",
";",
"do",
"{",
"e",
"=",
"this",
".",
"addition",
"(",
")",
"||",
"this",
".",
"entity",
"(",
")",
";",
"if",
"(",
"e",
")",
"{",
"entities",
".",
"push",
"(",
"e",
")",
";",
"if",
"(",
"!",
"peek",
"(",
"/",
"^\\/[\\/*]",
"/",
")",
")",
"{",
"delim",
"=",
"$char",
"(",
"'/'",
")",
";",
"if",
"(",
"delim",
")",
"{",
"entities",
".",
"push",
"(",
"new",
"(",
"tree",
".",
"Anonymous",
")",
"(",
"delim",
")",
")",
";",
"}",
"}",
"}",
"}",
"while",
"(",
"e",
")",
";",
"if",
"(",
"entities",
".",
"length",
">",
"0",
")",
"{",
"return",
"new",
"(",
"tree",
".",
"Expression",
")",
"(",
"entities",
")",
";",
"}",
"}"
] |
Expressions either represent mathematical operations, or white-space delimited Entities. 1px solid black @var * 2
|
[
"Expressions",
"either",
"represent",
"mathematical",
"operations",
"or",
"white",
"-",
"space",
"delimited",
"Entities",
".",
"1px",
"solid",
"black"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1933-L1952
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/thirdparty/less.js
|
function (env, op, other) {
/*jshint noempty:false */
var value = tree.operate(env, op, this.value, other.value),
unit = this.unit.clone();
if (op === '+' || op === '-') {
if (unit.numerator.length === 0 && unit.denominator.length === 0) {
unit.numerator = other.unit.numerator.slice(0);
unit.denominator = other.unit.denominator.slice(0);
} else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {
// do nothing
} else {
other = other.convertTo(this.unit.usedUnits());
if(env.strictUnits && other.unit.toString() !== unit.toString()) {
throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + unit.toString() +
"' and '" + other.unit.toString() + "'.");
}
value = tree.operate(env, op, this.value, other.value);
}
} else if (op === '*') {
unit.numerator = unit.numerator.concat(other.unit.numerator).sort();
unit.denominator = unit.denominator.concat(other.unit.denominator).sort();
unit.cancel();
} else if (op === '/') {
unit.numerator = unit.numerator.concat(other.unit.denominator).sort();
unit.denominator = unit.denominator.concat(other.unit.numerator).sort();
unit.cancel();
}
return new(tree.Dimension)(value, unit);
}
|
javascript
|
function (env, op, other) {
/*jshint noempty:false */
var value = tree.operate(env, op, this.value, other.value),
unit = this.unit.clone();
if (op === '+' || op === '-') {
if (unit.numerator.length === 0 && unit.denominator.length === 0) {
unit.numerator = other.unit.numerator.slice(0);
unit.denominator = other.unit.denominator.slice(0);
} else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {
// do nothing
} else {
other = other.convertTo(this.unit.usedUnits());
if(env.strictUnits && other.unit.toString() !== unit.toString()) {
throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + unit.toString() +
"' and '" + other.unit.toString() + "'.");
}
value = tree.operate(env, op, this.value, other.value);
}
} else if (op === '*') {
unit.numerator = unit.numerator.concat(other.unit.numerator).sort();
unit.denominator = unit.denominator.concat(other.unit.denominator).sort();
unit.cancel();
} else if (op === '/') {
unit.numerator = unit.numerator.concat(other.unit.denominator).sort();
unit.denominator = unit.denominator.concat(other.unit.numerator).sort();
unit.cancel();
}
return new(tree.Dimension)(value, unit);
}
|
[
"function",
"(",
"env",
",",
"op",
",",
"other",
")",
"{",
"var",
"value",
"=",
"tree",
".",
"operate",
"(",
"env",
",",
"op",
",",
"this",
".",
"value",
",",
"other",
".",
"value",
")",
",",
"unit",
"=",
"this",
".",
"unit",
".",
"clone",
"(",
")",
";",
"if",
"(",
"op",
"===",
"'+'",
"||",
"op",
"===",
"'-'",
")",
"{",
"if",
"(",
"unit",
".",
"numerator",
".",
"length",
"===",
"0",
"&&",
"unit",
".",
"denominator",
".",
"length",
"===",
"0",
")",
"{",
"unit",
".",
"numerator",
"=",
"other",
".",
"unit",
".",
"numerator",
".",
"slice",
"(",
"0",
")",
";",
"unit",
".",
"denominator",
"=",
"other",
".",
"unit",
".",
"denominator",
".",
"slice",
"(",
"0",
")",
";",
"}",
"else",
"if",
"(",
"other",
".",
"unit",
".",
"numerator",
".",
"length",
"===",
"0",
"&&",
"unit",
".",
"denominator",
".",
"length",
"===",
"0",
")",
"{",
"}",
"else",
"{",
"other",
"=",
"other",
".",
"convertTo",
"(",
"this",
".",
"unit",
".",
"usedUnits",
"(",
")",
")",
";",
"if",
"(",
"env",
".",
"strictUnits",
"&&",
"other",
".",
"unit",
".",
"toString",
"(",
")",
"!==",
"unit",
".",
"toString",
"(",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Incompatible units. Change the units or use the unit function. Bad units: '\"",
"+",
"unit",
".",
"toString",
"(",
")",
"+",
"\"' and '\"",
"+",
"other",
".",
"unit",
".",
"toString",
"(",
")",
"+",
"\"'.\"",
")",
";",
"}",
"value",
"=",
"tree",
".",
"operate",
"(",
"env",
",",
"op",
",",
"this",
".",
"value",
",",
"other",
".",
"value",
")",
";",
"}",
"}",
"else",
"if",
"(",
"op",
"===",
"'*'",
")",
"{",
"unit",
".",
"numerator",
"=",
"unit",
".",
"numerator",
".",
"concat",
"(",
"other",
".",
"unit",
".",
"numerator",
")",
".",
"sort",
"(",
")",
";",
"unit",
".",
"denominator",
"=",
"unit",
".",
"denominator",
".",
"concat",
"(",
"other",
".",
"unit",
".",
"denominator",
")",
".",
"sort",
"(",
")",
";",
"unit",
".",
"cancel",
"(",
")",
";",
"}",
"else",
"if",
"(",
"op",
"===",
"'/'",
")",
"{",
"unit",
".",
"numerator",
"=",
"unit",
".",
"numerator",
".",
"concat",
"(",
"other",
".",
"unit",
".",
"denominator",
")",
".",
"sort",
"(",
")",
";",
"unit",
".",
"denominator",
"=",
"unit",
".",
"denominator",
".",
"concat",
"(",
"other",
".",
"unit",
".",
"numerator",
")",
".",
"sort",
"(",
")",
";",
"unit",
".",
"cancel",
"(",
")",
";",
"}",
"return",
"new",
"(",
"tree",
".",
"Dimension",
")",
"(",
"value",
",",
"unit",
")",
";",
"}"
] |
In an operation between two Dimensions, we default to the first Dimension's unit, so `1px + 2` will yield `3px`.
|
[
"In",
"an",
"operation",
"between",
"two",
"Dimensions",
"we",
"default",
"to",
"the",
"first",
"Dimension",
"s",
"unit",
"so",
"1px",
"+",
"2",
"will",
"yield",
"3px",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L3480-L3511
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/thirdparty/less.js
|
function (args, env) {
var lastSelector = this.selectors[this.selectors.length-1];
if (!lastSelector.evaldCondition) {
return false;
}
if (lastSelector.condition &&
!lastSelector.condition.eval(
new(tree.evalEnv)(env,
env.frames))) {
return false;
}
return true;
}
|
javascript
|
function (args, env) {
var lastSelector = this.selectors[this.selectors.length-1];
if (!lastSelector.evaldCondition) {
return false;
}
if (lastSelector.condition &&
!lastSelector.condition.eval(
new(tree.evalEnv)(env,
env.frames))) {
return false;
}
return true;
}
|
[
"function",
"(",
"args",
",",
"env",
")",
"{",
"var",
"lastSelector",
"=",
"this",
".",
"selectors",
"[",
"this",
".",
"selectors",
".",
"length",
"-",
"1",
"]",
";",
"if",
"(",
"!",
"lastSelector",
".",
"evaldCondition",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"lastSelector",
".",
"condition",
"&&",
"!",
"lastSelector",
".",
"condition",
".",
"eval",
"(",
"new",
"(",
"tree",
".",
"evalEnv",
")",
"(",
"env",
",",
"env",
".",
"frames",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] |
lets you call a css selector with a guard
|
[
"lets",
"you",
"call",
"a",
"css",
"selector",
"with",
"a",
"guard"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L5089-L5101
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/type/Time.js
|
getErrorMessage
|
function getErrorMessage(oType) {
return sap.ui.getCore().getLibraryResourceBundle().getText("EnterTime",
[oType.formatValue(oDemoTime, "string")]);
}
|
javascript
|
function getErrorMessage(oType) {
return sap.ui.getCore().getLibraryResourceBundle().getText("EnterTime",
[oType.formatValue(oDemoTime, "string")]);
}
|
[
"function",
"getErrorMessage",
"(",
"oType",
")",
"{",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getLibraryResourceBundle",
"(",
")",
".",
"getText",
"(",
"\"EnterTime\"",
",",
"[",
"oType",
".",
"formatValue",
"(",
"oDemoTime",
",",
"\"string\"",
")",
"]",
")",
";",
"}"
] |
Returns the locale-dependent error message.
@param {sap.ui.model.odata.type.Time} oType
the type
@returns {string}
the locale-dependent error message
@private
|
[
"Returns",
"the",
"locale",
"-",
"dependent",
"error",
"message",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Time.js#L36-L39
|
train
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/type/Time.js
|
toDate
|
function toDate(oTime) {
if (!isTime(oTime)) {
throw new FormatException("Illegal sap.ui.model.odata.type.Time value: "
+ toString(oTime));
}
return new Date(oTime.ms);
}
|
javascript
|
function toDate(oTime) {
if (!isTime(oTime)) {
throw new FormatException("Illegal sap.ui.model.odata.type.Time value: "
+ toString(oTime));
}
return new Date(oTime.ms);
}
|
[
"function",
"toDate",
"(",
"oTime",
")",
"{",
"if",
"(",
"!",
"isTime",
"(",
"oTime",
")",
")",
"{",
"throw",
"new",
"FormatException",
"(",
"\"Illegal sap.ui.model.odata.type.Time value: \"",
"+",
"toString",
"(",
"oTime",
")",
")",
";",
"}",
"return",
"new",
"Date",
"(",
"oTime",
".",
"ms",
")",
";",
"}"
] |
Converts the given time object to a Date.
@param {object} oTime
the <code>Time</code> object
@returns {Date}
a Date with hour, minute, second and milliseconds set according to the time object.
@throws FormatException if the time object's format does not match
|
[
"Converts",
"the",
"given",
"time",
"object",
"to",
"a",
"Date",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Time.js#L100-L106
|
train
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/type/Time.js
|
toModel
|
function toModel(oDate) {
return {
__edmType : "Edm.Time",
ms : ((oDate.getUTCHours() * 60 + oDate.getUTCMinutes()) * 60 + oDate.getUTCSeconds())
* 1000 + oDate.getUTCMilliseconds()
};
}
|
javascript
|
function toModel(oDate) {
return {
__edmType : "Edm.Time",
ms : ((oDate.getUTCHours() * 60 + oDate.getUTCMinutes()) * 60 + oDate.getUTCSeconds())
* 1000 + oDate.getUTCMilliseconds()
};
}
|
[
"function",
"toModel",
"(",
"oDate",
")",
"{",
"return",
"{",
"__edmType",
":",
"\"Edm.Time\"",
",",
"ms",
":",
"(",
"(",
"oDate",
".",
"getUTCHours",
"(",
")",
"*",
"60",
"+",
"oDate",
".",
"getUTCMinutes",
"(",
")",
")",
"*",
"60",
"+",
"oDate",
".",
"getUTCSeconds",
"(",
")",
")",
"*",
"1000",
"+",
"oDate",
".",
"getUTCMilliseconds",
"(",
")",
"}",
";",
"}"
] |
Converts the given Date to a time object.
@param {Date} oDate
the date (day, month and year are ignored)
@returns {object}
a time object with __edmType and ms
|
[
"Converts",
"the",
"given",
"Date",
"to",
"a",
"time",
"object",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Time.js#L115-L121
|
train
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function() {
this._oDialog.close();
this._oDialog.destroy();
this._oDialog = null;
if (this._oAssistantPopover) {
this._oAssistantPopover.destroy();
this._oAssistantPopover = null;
}
if (this._oDebugPopover) {
this._oDebugPopover.destroy();
this._oDebugPopover = null;
}
}
|
javascript
|
function() {
this._oDialog.close();
this._oDialog.destroy();
this._oDialog = null;
if (this._oAssistantPopover) {
this._oAssistantPopover.destroy();
this._oAssistantPopover = null;
}
if (this._oDebugPopover) {
this._oDebugPopover.destroy();
this._oDebugPopover = null;
}
}
|
[
"function",
"(",
")",
"{",
"this",
".",
"_oDialog",
".",
"close",
"(",
")",
";",
"this",
".",
"_oDialog",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oDialog",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_oAssistantPopover",
")",
"{",
"this",
".",
"_oAssistantPopover",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oAssistantPopover",
"=",
"null",
";",
"}",
"if",
"(",
"this",
".",
"_oDebugPopover",
")",
"{",
"this",
".",
"_oDebugPopover",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oDebugPopover",
"=",
"null",
";",
"}",
"}"
] |
Closes the technical information dialog
|
[
"Closes",
"the",
"technical",
"information",
"dialog"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L90-L104
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
oTree = oModel.getProperty("/DebugModules")[0],
sString = "sap-ui-debug=" + this._treeHelper.toDebugInfo(oTree);
this._copyToClipboard(sString, "TechInfo.DebugModulesCopyToClipboard");
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
oTree = oModel.getProperty("/DebugModules")[0],
sString = "sap-ui-debug=" + this._treeHelper.toDebugInfo(oTree);
this._copyToClipboard(sString, "TechInfo.DebugModulesCopyToClipboard");
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTree",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/DebugModules\"",
")",
"[",
"0",
"]",
",",
"sString",
"=",
"\"sap-ui-debug=\"",
"+",
"this",
".",
"_treeHelper",
".",
"toDebugInfo",
"(",
"oTree",
")",
";",
"this",
".",
"_copyToClipboard",
"(",
"sString",
",",
"\"TechInfo.DebugModulesCopyToClipboard\"",
")",
";",
"}"
] |
Copies the custom sap-ui-debug value to the clipboard
|
[
"Copies",
"the",
"custom",
"sap",
"-",
"ui",
"-",
"debug",
"value",
"to",
"the",
"clipboard"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L146-L152
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeResults;
// early out if already open
if (this._oDebugPopover && this._oDebugPopover.isOpen()) {
return;
}
// fill and bind the tree structure from the currently loaded modules
oTreeResults = this._treeHelper.toTreeModel(this._oModuleSystemInfo);
oModel.setProperty("/DebugModules", [oTreeResults.tree]);
this._updateTreeInfos();
// create dialog lazily
if (!this._oDebugPopover) {
this._oDebugPopover = sap.ui.xmlfragment(this._DEBUG_MODULES_ID, "sap.ui.core.support.techinfo.TechnicalInfoDebugDialog", this);
this._oDialog.addDependent(this._oDebugPopover);
syncStyleClass(this._getContentDensityClass(), this._oDialog, this._oDebugPopover);
var oControl = this._getControl("customDebugValue", this._DEBUG_MODULES_ID);
try {
this._validateCustomDebugValue(oControl.getValue());
} catch (oException) {
this._showError(oControl, oException.message);
return;
}
}
// adopt tree depth to the deepest currently selected module
this._getControl("tree", this._DEBUG_MODULES_ID).expandToLevel(Math.max(this._MIN_EXPAND_LEVEL_DEBUG_MODULES, oTreeResults.depth));
// open dialog
this._oDebugPopover.open();
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeResults;
// early out if already open
if (this._oDebugPopover && this._oDebugPopover.isOpen()) {
return;
}
// fill and bind the tree structure from the currently loaded modules
oTreeResults = this._treeHelper.toTreeModel(this._oModuleSystemInfo);
oModel.setProperty("/DebugModules", [oTreeResults.tree]);
this._updateTreeInfos();
// create dialog lazily
if (!this._oDebugPopover) {
this._oDebugPopover = sap.ui.xmlfragment(this._DEBUG_MODULES_ID, "sap.ui.core.support.techinfo.TechnicalInfoDebugDialog", this);
this._oDialog.addDependent(this._oDebugPopover);
syncStyleClass(this._getContentDensityClass(), this._oDialog, this._oDebugPopover);
var oControl = this._getControl("customDebugValue", this._DEBUG_MODULES_ID);
try {
this._validateCustomDebugValue(oControl.getValue());
} catch (oException) {
this._showError(oControl, oException.message);
return;
}
}
// adopt tree depth to the deepest currently selected module
this._getControl("tree", this._DEBUG_MODULES_ID).expandToLevel(Math.max(this._MIN_EXPAND_LEVEL_DEBUG_MODULES, oTreeResults.depth));
// open dialog
this._oDebugPopover.open();
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTreeResults",
";",
"if",
"(",
"this",
".",
"_oDebugPopover",
"&&",
"this",
".",
"_oDebugPopover",
".",
"isOpen",
"(",
")",
")",
"{",
"return",
";",
"}",
"oTreeResults",
"=",
"this",
".",
"_treeHelper",
".",
"toTreeModel",
"(",
"this",
".",
"_oModuleSystemInfo",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/DebugModules\"",
",",
"[",
"oTreeResults",
".",
"tree",
"]",
")",
";",
"this",
".",
"_updateTreeInfos",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"_oDebugPopover",
")",
"{",
"this",
".",
"_oDebugPopover",
"=",
"sap",
".",
"ui",
".",
"xmlfragment",
"(",
"this",
".",
"_DEBUG_MODULES_ID",
",",
"\"sap.ui.core.support.techinfo.TechnicalInfoDebugDialog\"",
",",
"this",
")",
";",
"this",
".",
"_oDialog",
".",
"addDependent",
"(",
"this",
".",
"_oDebugPopover",
")",
";",
"syncStyleClass",
"(",
"this",
".",
"_getContentDensityClass",
"(",
")",
",",
"this",
".",
"_oDialog",
",",
"this",
".",
"_oDebugPopover",
")",
";",
"var",
"oControl",
"=",
"this",
".",
"_getControl",
"(",
"\"customDebugValue\"",
",",
"this",
".",
"_DEBUG_MODULES_ID",
")",
";",
"try",
"{",
"this",
".",
"_validateCustomDebugValue",
"(",
"oControl",
".",
"getValue",
"(",
")",
")",
";",
"}",
"catch",
"(",
"oException",
")",
"{",
"this",
".",
"_showError",
"(",
"oControl",
",",
"oException",
".",
"message",
")",
";",
"return",
";",
"}",
"}",
"this",
".",
"_getControl",
"(",
"\"tree\"",
",",
"this",
".",
"_DEBUG_MODULES_ID",
")",
".",
"expandToLevel",
"(",
"Math",
".",
"max",
"(",
"this",
".",
"_MIN_EXPAND_LEVEL_DEBUG_MODULES",
",",
"oTreeResults",
".",
"depth",
")",
")",
";",
"this",
".",
"_oDebugPopover",
".",
"open",
"(",
")",
";",
"}"
] |
Opens a dialog with debug package selection options
|
[
"Opens",
"a",
"dialog",
"with",
"debug",
"package",
"selection",
"options"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L171-L204
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
oControl = this._getControl("customDebugValue", this._DEBUG_MODULES_ID),
oTreeResults;
try {
this._validateCustomDebugValue(oControl.getValue());
} catch (oException) {
this._showError(oControl, oException.message);
return;
}
// convert boolean string to boolean value
if (oModel.getProperty("/CustomDebugMode") === "true") {
oModel.setProperty("/CustomDebugMode", true);
}
if (oModel.getProperty("/CustomDebugMode") === "false") {
oModel.setProperty("/CustomDebugMode", false);
}
// set validated value and update tree accordingly
window["sap-ui-debug"] = oModel.getProperty("/CustomDebugMode");
oTreeResults = this._treeHelper.toTreeModel(this._oModuleSystemInfo);
oModel.setProperty("/DebugModules", [oTreeResults.tree]);
// adopt tree depth to the deepest currently selected module
this._getControl("tree", this._DEBUG_MODULES_ID).expandToLevel(Math.max(this._MIN_EXPAND_LEVEL_DEBUG_MODULES, oTreeResults.depth));
this._updateTreeInfos();
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
oControl = this._getControl("customDebugValue", this._DEBUG_MODULES_ID),
oTreeResults;
try {
this._validateCustomDebugValue(oControl.getValue());
} catch (oException) {
this._showError(oControl, oException.message);
return;
}
// convert boolean string to boolean value
if (oModel.getProperty("/CustomDebugMode") === "true") {
oModel.setProperty("/CustomDebugMode", true);
}
if (oModel.getProperty("/CustomDebugMode") === "false") {
oModel.setProperty("/CustomDebugMode", false);
}
// set validated value and update tree accordingly
window["sap-ui-debug"] = oModel.getProperty("/CustomDebugMode");
oTreeResults = this._treeHelper.toTreeModel(this._oModuleSystemInfo);
oModel.setProperty("/DebugModules", [oTreeResults.tree]);
// adopt tree depth to the deepest currently selected module
this._getControl("tree", this._DEBUG_MODULES_ID).expandToLevel(Math.max(this._MIN_EXPAND_LEVEL_DEBUG_MODULES, oTreeResults.depth));
this._updateTreeInfos();
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oControl",
"=",
"this",
".",
"_getControl",
"(",
"\"customDebugValue\"",
",",
"this",
".",
"_DEBUG_MODULES_ID",
")",
",",
"oTreeResults",
";",
"try",
"{",
"this",
".",
"_validateCustomDebugValue",
"(",
"oControl",
".",
"getValue",
"(",
")",
")",
";",
"}",
"catch",
"(",
"oException",
")",
"{",
"this",
".",
"_showError",
"(",
"oControl",
",",
"oException",
".",
"message",
")",
";",
"return",
";",
"}",
"if",
"(",
"oModel",
".",
"getProperty",
"(",
"\"/CustomDebugMode\"",
")",
"===",
"\"true\"",
")",
"{",
"oModel",
".",
"setProperty",
"(",
"\"/CustomDebugMode\"",
",",
"true",
")",
";",
"}",
"if",
"(",
"oModel",
".",
"getProperty",
"(",
"\"/CustomDebugMode\"",
")",
"===",
"\"false\"",
")",
"{",
"oModel",
".",
"setProperty",
"(",
"\"/CustomDebugMode\"",
",",
"false",
")",
";",
"}",
"window",
"[",
"\"sap-ui-debug\"",
"]",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/CustomDebugMode\"",
")",
";",
"oTreeResults",
"=",
"this",
".",
"_treeHelper",
".",
"toTreeModel",
"(",
"this",
".",
"_oModuleSystemInfo",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/DebugModules\"",
",",
"[",
"oTreeResults",
".",
"tree",
"]",
")",
";",
"this",
".",
"_getControl",
"(",
"\"tree\"",
",",
"this",
".",
"_DEBUG_MODULES_ID",
")",
".",
"expandToLevel",
"(",
"Math",
".",
"max",
"(",
"this",
".",
"_MIN_EXPAND_LEVEL_DEBUG_MODULES",
",",
"oTreeResults",
".",
"depth",
")",
")",
";",
"this",
".",
"_updateTreeInfos",
"(",
")",
";",
"}"
] |
Sets the validated value from the input field and re-evaluates the module tree according to the input
|
[
"Sets",
"the",
"validated",
"value",
"from",
"the",
"input",
"field",
"and",
"re",
"-",
"evaluates",
"the",
"module",
"tree",
"according",
"to",
"the",
"input"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L245-L274
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0];
this._treeHelper.recursiveSelect(oTreeData, false);
this._updateTreeInfos();
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0];
this._treeHelper.recursiveSelect(oTreeData, false);
this._updateTreeInfos();
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTreeData",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/DebugModules\"",
")",
"[",
"0",
"]",
";",
"this",
".",
"_treeHelper",
".",
"recursiveSelect",
"(",
"oTreeData",
",",
"false",
")",
";",
"this",
".",
"_updateTreeInfos",
"(",
")",
";",
"}"
] |
Resets the debug module tree
|
[
"Resets",
"the",
"debug",
"module",
"tree"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L279-L285
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oSupport = Support.getStub();
if (oSupport.getType() != Support.StubType.APPLICATION) {
return;
}
oSupport.openSupportTool();
this.close();
}
|
javascript
|
function () {
var oSupport = Support.getStub();
if (oSupport.getType() != Support.StubType.APPLICATION) {
return;
}
oSupport.openSupportTool();
this.close();
}
|
[
"function",
"(",
")",
"{",
"var",
"oSupport",
"=",
"Support",
".",
"getStub",
"(",
")",
";",
"if",
"(",
"oSupport",
".",
"getType",
"(",
")",
"!=",
"Support",
".",
"StubType",
".",
"APPLICATION",
")",
"{",
"return",
";",
"}",
"oSupport",
".",
"openSupportTool",
"(",
")",
";",
"this",
".",
"close",
"(",
")",
";",
"}"
] |
Opens the diagnostics window
|
[
"Opens",
"the",
"diagnostics",
"window"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L290-L297
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
sStandardUrl = oModel.getProperty("/StandardBootstrapURL"),
sCustomUrl = oModel.getProperty("/CustomBootstrapURL"),
aSupportedUrls = [],
sBootstrapURL;
oModel.getProperty("/SupportAssistantPopoverURLs").forEach(function (element) {
aSupportedUrls.push(element.Value);
});
if (aSupportedUrls.indexOf(sStandardUrl) === -1 && sSelectedLocation === "standard") {
sSelectedLocation = "custom";
sCustomUrl = sStandardUrl;
oModel.setProperty("/SelectedLocation", sSelectedLocation);
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, aSupportedUrls[0]);
oModel.setProperty("/StandardBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.STANDARD_URL));
}
if (sSelectedLocation === "standard") {
sBootstrapURL = sStandardUrl;
} else if (sCustomUrl) {
// this checks if selected location is custom and CustomBootstrapURL is filed
if (!sCustomUrl.match(/\/$/)) {
// checks if custom URL is missing / at the end and adds it if missing
sCustomUrl += "/";
}
this._storage.put(this._LOCAL_STORAGE_KEYS.CUSTOM_URL, sCustomUrl);
oModel.setProperty("/CustomBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.CUSTOM_URL));
sBootstrapURL = sCustomUrl;
}
this._startAssistant(sBootstrapURL);
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
sStandardUrl = oModel.getProperty("/StandardBootstrapURL"),
sCustomUrl = oModel.getProperty("/CustomBootstrapURL"),
aSupportedUrls = [],
sBootstrapURL;
oModel.getProperty("/SupportAssistantPopoverURLs").forEach(function (element) {
aSupportedUrls.push(element.Value);
});
if (aSupportedUrls.indexOf(sStandardUrl) === -1 && sSelectedLocation === "standard") {
sSelectedLocation = "custom";
sCustomUrl = sStandardUrl;
oModel.setProperty("/SelectedLocation", sSelectedLocation);
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, aSupportedUrls[0]);
oModel.setProperty("/StandardBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.STANDARD_URL));
}
if (sSelectedLocation === "standard") {
sBootstrapURL = sStandardUrl;
} else if (sCustomUrl) {
// this checks if selected location is custom and CustomBootstrapURL is filed
if (!sCustomUrl.match(/\/$/)) {
// checks if custom URL is missing / at the end and adds it if missing
sCustomUrl += "/";
}
this._storage.put(this._LOCAL_STORAGE_KEYS.CUSTOM_URL, sCustomUrl);
oModel.setProperty("/CustomBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.CUSTOM_URL));
sBootstrapURL = sCustomUrl;
}
this._startAssistant(sBootstrapURL);
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"sSelectedLocation",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/SelectedLocation\"",
")",
",",
"sStandardUrl",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/StandardBootstrapURL\"",
")",
",",
"sCustomUrl",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/CustomBootstrapURL\"",
")",
",",
"aSupportedUrls",
"=",
"[",
"]",
",",
"sBootstrapURL",
";",
"oModel",
".",
"getProperty",
"(",
"\"/SupportAssistantPopoverURLs\"",
")",
".",
"forEach",
"(",
"function",
"(",
"element",
")",
"{",
"aSupportedUrls",
".",
"push",
"(",
"element",
".",
"Value",
")",
";",
"}",
")",
";",
"if",
"(",
"aSupportedUrls",
".",
"indexOf",
"(",
"sStandardUrl",
")",
"===",
"-",
"1",
"&&",
"sSelectedLocation",
"===",
"\"standard\"",
")",
"{",
"sSelectedLocation",
"=",
"\"custom\"",
";",
"sCustomUrl",
"=",
"sStandardUrl",
";",
"oModel",
".",
"setProperty",
"(",
"\"/SelectedLocation\"",
",",
"sSelectedLocation",
")",
";",
"this",
".",
"_storage",
".",
"put",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"STANDARD_URL",
",",
"aSupportedUrls",
"[",
"0",
"]",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/StandardBootstrapURL\"",
",",
"this",
".",
"_storage",
".",
"get",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"STANDARD_URL",
")",
")",
";",
"}",
"if",
"(",
"sSelectedLocation",
"===",
"\"standard\"",
")",
"{",
"sBootstrapURL",
"=",
"sStandardUrl",
";",
"}",
"else",
"if",
"(",
"sCustomUrl",
")",
"{",
"if",
"(",
"!",
"sCustomUrl",
".",
"match",
"(",
"/",
"\\/$",
"/",
")",
")",
"{",
"sCustomUrl",
"+=",
"\"/\"",
";",
"}",
"this",
".",
"_storage",
".",
"put",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"CUSTOM_URL",
",",
"sCustomUrl",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/CustomBootstrapURL\"",
",",
"this",
".",
"_storage",
".",
"get",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"CUSTOM_URL",
")",
")",
";",
"sBootstrapURL",
"=",
"sCustomUrl",
";",
"}",
"this",
".",
"_startAssistant",
"(",
"sBootstrapURL",
")",
";",
"}"
] |
Opens the support assistant with the given configuration
|
[
"Opens",
"the",
"support",
"assistant",
"with",
"the",
"given",
"configuration"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L302-L335
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (oEvent) {
var sValue = oEvent.getParameter("selectedItem").getKey(),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, sValue);
this._resetValueState(oControl);
this._pingUrl(sValue, oControl)
.then(function success() {
oControl.setValueState("Success");
}, function error() {
var sMessage = this._getText("TechInfo.SupportAssistantConfigPopup.NotAvailableAtTheMoment");
this._showError(oControl, sMessage);
Log.error("Support Assistant could not be loaded from the URL you entered");
});
}
|
javascript
|
function (oEvent) {
var sValue = oEvent.getParameter("selectedItem").getKey(),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, sValue);
this._resetValueState(oControl);
this._pingUrl(sValue, oControl)
.then(function success() {
oControl.setValueState("Success");
}, function error() {
var sMessage = this._getText("TechInfo.SupportAssistantConfigPopup.NotAvailableAtTheMoment");
this._showError(oControl, sMessage);
Log.error("Support Assistant could not be loaded from the URL you entered");
});
}
|
[
"function",
"(",
"oEvent",
")",
"{",
"var",
"sValue",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"selectedItem\"",
")",
".",
"getKey",
"(",
")",
",",
"oControl",
"=",
"oEvent",
".",
"getSource",
"(",
")",
";",
"this",
".",
"_storage",
".",
"put",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"STANDARD_URL",
",",
"sValue",
")",
";",
"this",
".",
"_resetValueState",
"(",
"oControl",
")",
";",
"this",
".",
"_pingUrl",
"(",
"sValue",
",",
"oControl",
")",
".",
"then",
"(",
"function",
"success",
"(",
")",
"{",
"oControl",
".",
"setValueState",
"(",
"\"Success\"",
")",
";",
"}",
",",
"function",
"error",
"(",
")",
"{",
"var",
"sMessage",
"=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.NotAvailableAtTheMoment\"",
")",
";",
"this",
".",
"_showError",
"(",
"oControl",
",",
"sMessage",
")",
";",
"Log",
".",
"error",
"(",
"\"Support Assistant could not be loaded from the URL you entered\"",
")",
";",
"}",
")",
";",
"}"
] |
Writes the custom bootstrap URL to local storage
@param {sap.ui.base.Event} oEvent The select change event
|
[
"Writes",
"the",
"custom",
"bootstrap",
"URL",
"to",
"local",
"storage"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L350-L363
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (oEvent) {
var sValue = oEvent.getParameter("value"),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.CUSTOM_URL, sValue);
try {
this._validateValue(oControl.getValue());
this._resetValueState(oControl);
} catch (oException) {
this._showError(oControl, oException.message);
}
}
|
javascript
|
function (oEvent) {
var sValue = oEvent.getParameter("value"),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.CUSTOM_URL, sValue);
try {
this._validateValue(oControl.getValue());
this._resetValueState(oControl);
} catch (oException) {
this._showError(oControl, oException.message);
}
}
|
[
"function",
"(",
"oEvent",
")",
"{",
"var",
"sValue",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"value\"",
")",
",",
"oControl",
"=",
"oEvent",
".",
"getSource",
"(",
")",
";",
"this",
".",
"_storage",
".",
"put",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"CUSTOM_URL",
",",
"sValue",
")",
";",
"try",
"{",
"this",
".",
"_validateValue",
"(",
"oControl",
".",
"getValue",
"(",
")",
")",
";",
"this",
".",
"_resetValueState",
"(",
"oControl",
")",
";",
"}",
"catch",
"(",
"oException",
")",
"{",
"this",
".",
"_showError",
"(",
"oControl",
",",
"oException",
".",
"message",
")",
";",
"}",
"}"
] |
Handler for liveChange event fired by custom bootstrap URL.
@param oEvent
|
[
"Handler",
"for",
"liveChange",
"event",
"fired",
"by",
"custom",
"bootstrap",
"URL",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L369-L379
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (oEvent) {
// early out if already open
if (this._oAssistantPopover && this._oAssistantPopover.isOpen()) {
return;
}
// create dialog lazily
if (!this._oAssistantPopover) {
this._oAssistantPopover = sap.ui.xmlfragment(this._SUPPORT_ASSISTANT_POPOVER_ID, "sap.ui.core.support.techinfo.TechnicalInfoAssistantPopover", this);
this._oAssistantPopover.attachAfterOpen(this._onAssistantPopoverOpened, this);
this._oDialog.addDependent(this._oAssistantPopover);
syncStyleClass(this._getContentDensityClass(), this._oDialog, this._oAssistantPopover);
// register message validation and trigger it once to validate the value coming from local storage
var oCustomBootstrapURL = this._getControl("customBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID);
sap.ui.getCore().getMessageManager().registerObject(oCustomBootstrapURL, true);
}
// enable or disable default option for version >= 1.48
var oCurrentItem = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID).getItems()[0];
if (this._isVersionBiggerThanMinSupported()) {
var sAppVersion = sap.ui.getCore().getConfiguration().getVersion().toString();
oCurrentItem.setText(oCurrentItem.getText().replace("[[version]]", sAppVersion));
oCurrentItem.setEnabled(true);
} else {
oCurrentItem.setText(oCurrentItem.getText().replace("[[version]]", "not supported"));
oCurrentItem.setEnabled(false);
}
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation");
this._setActiveLocations(sSelectedLocation);
var oSupportAssistantSettingsButton = this._getControl("supportAssistantSettingsButton", this._TECHNICAL_INFO_DIALOG_ID);
this._oAssistantPopover.openBy(oSupportAssistantSettingsButton);
}
|
javascript
|
function (oEvent) {
// early out if already open
if (this._oAssistantPopover && this._oAssistantPopover.isOpen()) {
return;
}
// create dialog lazily
if (!this._oAssistantPopover) {
this._oAssistantPopover = sap.ui.xmlfragment(this._SUPPORT_ASSISTANT_POPOVER_ID, "sap.ui.core.support.techinfo.TechnicalInfoAssistantPopover", this);
this._oAssistantPopover.attachAfterOpen(this._onAssistantPopoverOpened, this);
this._oDialog.addDependent(this._oAssistantPopover);
syncStyleClass(this._getContentDensityClass(), this._oDialog, this._oAssistantPopover);
// register message validation and trigger it once to validate the value coming from local storage
var oCustomBootstrapURL = this._getControl("customBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID);
sap.ui.getCore().getMessageManager().registerObject(oCustomBootstrapURL, true);
}
// enable or disable default option for version >= 1.48
var oCurrentItem = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID).getItems()[0];
if (this._isVersionBiggerThanMinSupported()) {
var sAppVersion = sap.ui.getCore().getConfiguration().getVersion().toString();
oCurrentItem.setText(oCurrentItem.getText().replace("[[version]]", sAppVersion));
oCurrentItem.setEnabled(true);
} else {
oCurrentItem.setText(oCurrentItem.getText().replace("[[version]]", "not supported"));
oCurrentItem.setEnabled(false);
}
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation");
this._setActiveLocations(sSelectedLocation);
var oSupportAssistantSettingsButton = this._getControl("supportAssistantSettingsButton", this._TECHNICAL_INFO_DIALOG_ID);
this._oAssistantPopover.openBy(oSupportAssistantSettingsButton);
}
|
[
"function",
"(",
"oEvent",
")",
"{",
"if",
"(",
"this",
".",
"_oAssistantPopover",
"&&",
"this",
".",
"_oAssistantPopover",
".",
"isOpen",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"_oAssistantPopover",
")",
"{",
"this",
".",
"_oAssistantPopover",
"=",
"sap",
".",
"ui",
".",
"xmlfragment",
"(",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
",",
"\"sap.ui.core.support.techinfo.TechnicalInfoAssistantPopover\"",
",",
"this",
")",
";",
"this",
".",
"_oAssistantPopover",
".",
"attachAfterOpen",
"(",
"this",
".",
"_onAssistantPopoverOpened",
",",
"this",
")",
";",
"this",
".",
"_oDialog",
".",
"addDependent",
"(",
"this",
".",
"_oAssistantPopover",
")",
";",
"syncStyleClass",
"(",
"this",
".",
"_getContentDensityClass",
"(",
")",
",",
"this",
".",
"_oDialog",
",",
"this",
".",
"_oAssistantPopover",
")",
";",
"var",
"oCustomBootstrapURL",
"=",
"this",
".",
"_getControl",
"(",
"\"customBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
";",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getMessageManager",
"(",
")",
".",
"registerObject",
"(",
"oCustomBootstrapURL",
",",
"true",
")",
";",
"}",
"var",
"oCurrentItem",
"=",
"this",
".",
"_getControl",
"(",
"\"standardBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
".",
"getItems",
"(",
")",
"[",
"0",
"]",
";",
"if",
"(",
"this",
".",
"_isVersionBiggerThanMinSupported",
"(",
")",
")",
"{",
"var",
"sAppVersion",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getVersion",
"(",
")",
".",
"toString",
"(",
")",
";",
"oCurrentItem",
".",
"setText",
"(",
"oCurrentItem",
".",
"getText",
"(",
")",
".",
"replace",
"(",
"\"[[version]]\"",
",",
"sAppVersion",
")",
")",
";",
"oCurrentItem",
".",
"setEnabled",
"(",
"true",
")",
";",
"}",
"else",
"{",
"oCurrentItem",
".",
"setText",
"(",
"oCurrentItem",
".",
"getText",
"(",
")",
".",
"replace",
"(",
"\"[[version]]\"",
",",
"\"not supported\"",
")",
")",
";",
"oCurrentItem",
".",
"setEnabled",
"(",
"false",
")",
";",
"}",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"sSelectedLocation",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/SelectedLocation\"",
")",
";",
"this",
".",
"_setActiveLocations",
"(",
"sSelectedLocation",
")",
";",
"var",
"oSupportAssistantSettingsButton",
"=",
"this",
".",
"_getControl",
"(",
"\"supportAssistantSettingsButton\"",
",",
"this",
".",
"_TECHNICAL_INFO_DIALOG_ID",
")",
";",
"this",
".",
"_oAssistantPopover",
".",
"openBy",
"(",
"oSupportAssistantSettingsButton",
")",
";",
"}"
] |
Opens a popover with extended configuration options
@param {sap.ui.base.Event} oEvent The button press event
|
[
"Opens",
"a",
"popover",
"with",
"extended",
"configuration",
"options"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L394-L430
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (sBootstrapURL) {
var oModel = this._oDialog.getModel("view"),
oSettings = {
// start the application in support mode
support: "true",
// open in new window
window: oModel.getProperty("/OpenSupportAssistantInNewWindow")
};
this._loadAssistant(sBootstrapURL, oSettings);
}
|
javascript
|
function (sBootstrapURL) {
var oModel = this._oDialog.getModel("view"),
oSettings = {
// start the application in support mode
support: "true",
// open in new window
window: oModel.getProperty("/OpenSupportAssistantInNewWindow")
};
this._loadAssistant(sBootstrapURL, oSettings);
}
|
[
"function",
"(",
"sBootstrapURL",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oSettings",
"=",
"{",
"support",
":",
"\"true\"",
",",
"window",
":",
"oModel",
".",
"getProperty",
"(",
"\"/OpenSupportAssistantInNewWindow\"",
")",
"}",
";",
"this",
".",
"_loadAssistant",
"(",
"sBootstrapURL",
",",
"oSettings",
")",
";",
"}"
] |
Start the support assistant with the given bootstrap URL
By default, it is started with the current version for >=1.48 release or SAPUI5 CDN version for lower releases.
This behavior can be overridden by specifying a custom bootstrap URL where the support assistant is loaded from
@param {string} [sBootstrapURL] If specified, the support assistant will be started with a custom bootstrap URL.
@private
|
[
"Start",
"the",
"support",
"assistant",
"with",
"the",
"given",
"bootstrap",
"URL",
"By",
"default",
"it",
"is",
"started",
"with",
"the",
"current",
"version",
"for",
">",
"=",
"1",
".",
"48",
"release",
"or",
"SAPUI5",
"CDN",
"version",
"for",
"lower",
"releases",
".",
"This",
"behavior",
"can",
"be",
"overridden",
"by",
"specifying",
"a",
"custom",
"bootstrap",
"URL",
"where",
"the",
"support",
"assistant",
"is",
"loaded",
"from"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L511-L521
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (sUrl, oSettings) {
this._pingUrl(sUrl)
.then(function success() {
this.close();
var aSettings = [oSettings.support];
sap.ui.getCore().loadLibrary("sap.ui.support", { async: true, url: sUrl })
.then(function () {
if (oSettings.window) {
aSettings.push("window");
}
if (aSettings[0].toLowerCase() === "true" || aSettings[0].toLowerCase() === "silent") {
sap.ui.require(["sap/ui/support/Bootstrap"], function (oBootstrap) {
oBootstrap.initSupportRules(aSettings);
});
}
});
}, function error(jqXHR, exception) {
var msg = this._getText("TechInfo.SupportAssistantConfigPopup.SupportAssistantNotFound");
if (jqXHR.status === 0) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorTryingToGetRecourse");
} else if (jqXHR.status === 404) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorNotFound");
} else if (jqXHR.status === 500) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.InternalServerError");
} else if (exception === 'parsererror') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorOnJsonParse");
} else if (exception === 'timeout') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorOnTimeout");
} else if (exception === 'abort') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorWhenAborted");
} else {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.UncaughtError") + jqXHR.responseText;
}
this._sErrorMessage = msg;
this.onConfigureAssistantBootstrap();
Log.error("Support Assistant could not be loaded from the URL you entered");
});
}
|
javascript
|
function (sUrl, oSettings) {
this._pingUrl(sUrl)
.then(function success() {
this.close();
var aSettings = [oSettings.support];
sap.ui.getCore().loadLibrary("sap.ui.support", { async: true, url: sUrl })
.then(function () {
if (oSettings.window) {
aSettings.push("window");
}
if (aSettings[0].toLowerCase() === "true" || aSettings[0].toLowerCase() === "silent") {
sap.ui.require(["sap/ui/support/Bootstrap"], function (oBootstrap) {
oBootstrap.initSupportRules(aSettings);
});
}
});
}, function error(jqXHR, exception) {
var msg = this._getText("TechInfo.SupportAssistantConfigPopup.SupportAssistantNotFound");
if (jqXHR.status === 0) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorTryingToGetRecourse");
} else if (jqXHR.status === 404) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorNotFound");
} else if (jqXHR.status === 500) {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.InternalServerError");
} else if (exception === 'parsererror') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorOnJsonParse");
} else if (exception === 'timeout') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorOnTimeout");
} else if (exception === 'abort') {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.ErrorWhenAborted");
} else {
msg += this._getText("TechInfo.SupportAssistantConfigPopup.UncaughtError") + jqXHR.responseText;
}
this._sErrorMessage = msg;
this.onConfigureAssistantBootstrap();
Log.error("Support Assistant could not be loaded from the URL you entered");
});
}
|
[
"function",
"(",
"sUrl",
",",
"oSettings",
")",
"{",
"this",
".",
"_pingUrl",
"(",
"sUrl",
")",
".",
"then",
"(",
"function",
"success",
"(",
")",
"{",
"this",
".",
"close",
"(",
")",
";",
"var",
"aSettings",
"=",
"[",
"oSettings",
".",
"support",
"]",
";",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"loadLibrary",
"(",
"\"sap.ui.support\"",
",",
"{",
"async",
":",
"true",
",",
"url",
":",
"sUrl",
"}",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"oSettings",
".",
"window",
")",
"{",
"aSettings",
".",
"push",
"(",
"\"window\"",
")",
";",
"}",
"if",
"(",
"aSettings",
"[",
"0",
"]",
".",
"toLowerCase",
"(",
")",
"===",
"\"true\"",
"||",
"aSettings",
"[",
"0",
"]",
".",
"toLowerCase",
"(",
")",
"===",
"\"silent\"",
")",
"{",
"sap",
".",
"ui",
".",
"require",
"(",
"[",
"\"sap/ui/support/Bootstrap\"",
"]",
",",
"function",
"(",
"oBootstrap",
")",
"{",
"oBootstrap",
".",
"initSupportRules",
"(",
"aSettings",
")",
";",
"}",
")",
";",
"}",
"}",
")",
";",
"}",
",",
"function",
"error",
"(",
"jqXHR",
",",
"exception",
")",
"{",
"var",
"msg",
"=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.SupportAssistantNotFound\"",
")",
";",
"if",
"(",
"jqXHR",
".",
"status",
"===",
"0",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.ErrorTryingToGetRecourse\"",
")",
";",
"}",
"else",
"if",
"(",
"jqXHR",
".",
"status",
"===",
"404",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.ErrorNotFound\"",
")",
";",
"}",
"else",
"if",
"(",
"jqXHR",
".",
"status",
"===",
"500",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.InternalServerError\"",
")",
";",
"}",
"else",
"if",
"(",
"exception",
"===",
"'parsererror'",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.ErrorOnJsonParse\"",
")",
";",
"}",
"else",
"if",
"(",
"exception",
"===",
"'timeout'",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.ErrorOnTimeout\"",
")",
";",
"}",
"else",
"if",
"(",
"exception",
"===",
"'abort'",
")",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.ErrorWhenAborted\"",
")",
";",
"}",
"else",
"{",
"msg",
"+=",
"this",
".",
"_getText",
"(",
"\"TechInfo.SupportAssistantConfigPopup.UncaughtError\"",
")",
"+",
"jqXHR",
".",
"responseText",
";",
"}",
"this",
".",
"_sErrorMessage",
"=",
"msg",
";",
"this",
".",
"onConfigureAssistantBootstrap",
"(",
")",
";",
"Log",
".",
"error",
"(",
"\"Support Assistant could not be loaded from the URL you entered\"",
")",
";",
"}",
")",
";",
"}"
] |
Try to load Support Assistant with passed sUrl and aParams by making ajax request to Bootstrap.js.
If Bootsrap.js is missing error occurs in the console otherwise starts Support Assistant.
@param {string} sUrl Url where to load Support Assistant from.
@param {object} oSettings Parameters that needs to be passed to Support Assistant.
@private
|
[
"Try",
"to",
"load",
"Support",
"Assistant",
"with",
"passed",
"sUrl",
"and",
"aParams",
"by",
"making",
"ajax",
"request",
"to",
"Bootstrap",
".",
"js",
".",
"If",
"Bootsrap",
".",
"js",
"is",
"missing",
"error",
"occurs",
"in",
"the",
"console",
"otherwise",
"starts",
"Support",
"Assistant",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L530-L568
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
// create i18n model
var oI18nModel = new ResourceModel({
bundleName: "sap.ui.core.messagebundle"
});
this._oDialog.setModel(oI18nModel, "i18n");
this._oDialog.setModel(this._createViewModel(), "view");
// set compact/cozy style class
this._oDialog.addStyleClass(this._getContentDensityClass());
}
|
javascript
|
function () {
// create i18n model
var oI18nModel = new ResourceModel({
bundleName: "sap.ui.core.messagebundle"
});
this._oDialog.setModel(oI18nModel, "i18n");
this._oDialog.setModel(this._createViewModel(), "view");
// set compact/cozy style class
this._oDialog.addStyleClass(this._getContentDensityClass());
}
|
[
"function",
"(",
")",
"{",
"var",
"oI18nModel",
"=",
"new",
"ResourceModel",
"(",
"{",
"bundleName",
":",
"\"sap.ui.core.messagebundle\"",
"}",
")",
";",
"this",
".",
"_oDialog",
".",
"setModel",
"(",
"oI18nModel",
",",
"\"i18n\"",
")",
";",
"this",
".",
"_oDialog",
".",
"setModel",
"(",
"this",
".",
"_createViewModel",
"(",
")",
",",
"\"view\"",
")",
";",
"this",
".",
"_oDialog",
".",
"addStyleClass",
"(",
"this",
".",
"_getContentDensityClass",
"(",
")",
")",
";",
"}"
] |
Initalizes the technical information dialog
@private
|
[
"Initalizes",
"the",
"technical",
"information",
"dialog"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L574-L584
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oVersion = sap.ui.getCore().getConfiguration().getVersion();
if (oVersion && oVersion.compareTo(this._MIN_UI5VERSION_SUPPORT_ASSISTANT) >= 0) {
return true;
}
return false;
}
|
javascript
|
function () {
var oVersion = sap.ui.getCore().getConfiguration().getVersion();
if (oVersion && oVersion.compareTo(this._MIN_UI5VERSION_SUPPORT_ASSISTANT) >= 0) {
return true;
}
return false;
}
|
[
"function",
"(",
")",
"{",
"var",
"oVersion",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getVersion",
"(",
")",
";",
"if",
"(",
"oVersion",
"&&",
"oVersion",
".",
"compareTo",
"(",
"this",
".",
"_MIN_UI5VERSION_SUPPORT_ASSISTANT",
")",
">=",
"0",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] |
Checks if current version of UI5 is equal or higher than minimum UI5 version
that Support Assistant is available at.
@returns {boolean}
@private
|
[
"Checks",
"if",
"current",
"version",
"of",
"UI5",
"is",
"equal",
"or",
"higher",
"than",
"minimum",
"UI5",
"version",
"that",
"Support",
"Assistant",
"is",
"available",
"at",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L703-L709
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (sBuildTimestamp) {
var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern: "dd.MM.yyyy HH:mm:ss"}),
sBuildDate = oDateFormat.format(this._convertBuildDate(sBuildTimestamp));
return this._getText("TechInfo.VersionBuildTime.Text", sBuildDate);
}
|
javascript
|
function (sBuildTimestamp) {
var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern: "dd.MM.yyyy HH:mm:ss"}),
sBuildDate = oDateFormat.format(this._convertBuildDate(sBuildTimestamp));
return this._getText("TechInfo.VersionBuildTime.Text", sBuildDate);
}
|
[
"function",
"(",
"sBuildTimestamp",
")",
"{",
"var",
"oDateFormat",
"=",
"sap",
".",
"ui",
".",
"core",
".",
"format",
".",
"DateFormat",
".",
"getDateInstance",
"(",
"{",
"pattern",
":",
"\"dd.MM.yyyy HH:mm:ss\"",
"}",
")",
",",
"sBuildDate",
"=",
"oDateFormat",
".",
"format",
"(",
"this",
".",
"_convertBuildDate",
"(",
"sBuildTimestamp",
")",
")",
";",
"return",
"this",
".",
"_getText",
"(",
"\"TechInfo.VersionBuildTime.Text\"",
",",
"sBuildDate",
")",
";",
"}"
] |
Generates formatted and localized text from passed timestamp
@param {string} sBuildTimestamp Timestamp as string
@private
|
[
"Generates",
"formatted",
"and",
"localized",
"text",
"from",
"passed",
"timestamp"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L716-L721
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (sValue) {
var oModel = this._oDialog.getModel("view"),
oRadioBtnStandart = this._getControl("standard", this._SUPPORT_ASSISTANT_POPOVER_ID),
oRadioBtnCustom = this._getControl("custom", this._SUPPORT_ASSISTANT_POPOVER_ID),
oCustom = this._getControl("customBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID),
oStandard = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID),
bStandardLocationEnabled;
this._resetValueState(oCustom);
this._resetValueState(oStandard);
if (sValue === "standard") {
bStandardLocationEnabled = true;
oModel.setProperty("/StandardBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.STANDARD_URL));
oStandard.setSelectedKey(oModel.getProperty("/StandardBootstrapURL"));
} else {
bStandardLocationEnabled = false;
}
oStandard.setEnabled(bStandardLocationEnabled);
oRadioBtnStandart.setSelected(bStandardLocationEnabled);
oCustom.setEnabled(!bStandardLocationEnabled);
oRadioBtnCustom.setSelected(!bStandardLocationEnabled);
this._storage.put(this._LOCAL_STORAGE_KEYS.LOCATION, sValue);
oModel.setProperty("/SelectedLocation", this._storage.get(this._LOCAL_STORAGE_KEYS.LOCATION));
}
|
javascript
|
function (sValue) {
var oModel = this._oDialog.getModel("view"),
oRadioBtnStandart = this._getControl("standard", this._SUPPORT_ASSISTANT_POPOVER_ID),
oRadioBtnCustom = this._getControl("custom", this._SUPPORT_ASSISTANT_POPOVER_ID),
oCustom = this._getControl("customBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID),
oStandard = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID),
bStandardLocationEnabled;
this._resetValueState(oCustom);
this._resetValueState(oStandard);
if (sValue === "standard") {
bStandardLocationEnabled = true;
oModel.setProperty("/StandardBootstrapURL", this._storage.get(this._LOCAL_STORAGE_KEYS.STANDARD_URL));
oStandard.setSelectedKey(oModel.getProperty("/StandardBootstrapURL"));
} else {
bStandardLocationEnabled = false;
}
oStandard.setEnabled(bStandardLocationEnabled);
oRadioBtnStandart.setSelected(bStandardLocationEnabled);
oCustom.setEnabled(!bStandardLocationEnabled);
oRadioBtnCustom.setSelected(!bStandardLocationEnabled);
this._storage.put(this._LOCAL_STORAGE_KEYS.LOCATION, sValue);
oModel.setProperty("/SelectedLocation", this._storage.get(this._LOCAL_STORAGE_KEYS.LOCATION));
}
|
[
"function",
"(",
"sValue",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oRadioBtnStandart",
"=",
"this",
".",
"_getControl",
"(",
"\"standard\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
",",
"oRadioBtnCustom",
"=",
"this",
".",
"_getControl",
"(",
"\"custom\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
",",
"oCustom",
"=",
"this",
".",
"_getControl",
"(",
"\"customBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
",",
"oStandard",
"=",
"this",
".",
"_getControl",
"(",
"\"standardBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
",",
"bStandardLocationEnabled",
";",
"this",
".",
"_resetValueState",
"(",
"oCustom",
")",
";",
"this",
".",
"_resetValueState",
"(",
"oStandard",
")",
";",
"if",
"(",
"sValue",
"===",
"\"standard\"",
")",
"{",
"bStandardLocationEnabled",
"=",
"true",
";",
"oModel",
".",
"setProperty",
"(",
"\"/StandardBootstrapURL\"",
",",
"this",
".",
"_storage",
".",
"get",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"STANDARD_URL",
")",
")",
";",
"oStandard",
".",
"setSelectedKey",
"(",
"oModel",
".",
"getProperty",
"(",
"\"/StandardBootstrapURL\"",
")",
")",
";",
"}",
"else",
"{",
"bStandardLocationEnabled",
"=",
"false",
";",
"}",
"oStandard",
".",
"setEnabled",
"(",
"bStandardLocationEnabled",
")",
";",
"oRadioBtnStandart",
".",
"setSelected",
"(",
"bStandardLocationEnabled",
")",
";",
"oCustom",
".",
"setEnabled",
"(",
"!",
"bStandardLocationEnabled",
")",
";",
"oRadioBtnCustom",
".",
"setSelected",
"(",
"!",
"bStandardLocationEnabled",
")",
";",
"this",
".",
"_storage",
".",
"put",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"LOCATION",
",",
"sValue",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/SelectedLocation\"",
",",
"this",
".",
"_storage",
".",
"get",
"(",
"this",
".",
"_LOCAL_STORAGE_KEYS",
".",
"LOCATION",
")",
")",
";",
"}"
] |
Sets active location and toggle between "standard" and "custom" locations.
Saves last active location.
@param {string} sValue Possible values "standard" or "custom"
@private
|
[
"Sets",
"active",
"location",
"and",
"toggle",
"between",
"standard",
"and",
"custom",
"locations",
".",
"Saves",
"last",
"active",
"location",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L729-L755
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (fnConfirm, fnCancel) {
MessageBox.confirm(
this._getText("TechInfo.DebugSources.ConfirmMessage"), {
title: this._getText("TechInfo.DebugSources.ConfirmTitle"),
onClose: function (oAction) {
if (oAction === MessageBox.Action.OK) {
fnConfirm();
} else if (fnCancel) {
fnCancel();
}
}
}
);
}
|
javascript
|
function (fnConfirm, fnCancel) {
MessageBox.confirm(
this._getText("TechInfo.DebugSources.ConfirmMessage"), {
title: this._getText("TechInfo.DebugSources.ConfirmTitle"),
onClose: function (oAction) {
if (oAction === MessageBox.Action.OK) {
fnConfirm();
} else if (fnCancel) {
fnCancel();
}
}
}
);
}
|
[
"function",
"(",
"fnConfirm",
",",
"fnCancel",
")",
"{",
"MessageBox",
".",
"confirm",
"(",
"this",
".",
"_getText",
"(",
"\"TechInfo.DebugSources.ConfirmMessage\"",
")",
",",
"{",
"title",
":",
"this",
".",
"_getText",
"(",
"\"TechInfo.DebugSources.ConfirmTitle\"",
")",
",",
"onClose",
":",
"function",
"(",
"oAction",
")",
"{",
"if",
"(",
"oAction",
"===",
"MessageBox",
".",
"Action",
".",
"OK",
")",
"{",
"fnConfirm",
"(",
")",
";",
"}",
"else",
"if",
"(",
"fnCancel",
")",
"{",
"fnCancel",
"(",
")",
";",
"}",
"}",
"}",
")",
";",
"}"
] |
Called after CANCEL action is triggered
@name cancelActionCallback
@function
@private
Displays a confirmation message to reload the current page
@param {confirmActionCallback} fnConfirm Callback function to be executed after the "ok" action is triggered
@param {cancelActionCallback} [fnCancel] Callback function to be executed after the "cancel" action is triggered
@private
|
[
"Called",
"after",
"CANCEL",
"action",
"is",
"triggered"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L777-L790
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
oControl;
if (sSelectedLocation === "custom") {
oControl = this._getControl("customBootstrapURL",this._SUPPORT_ASSISTANT_POPOVER_ID);
var sValue = oControl.getValue();
try {
this._validateValue(sValue);
} catch (oException) {
this._showError(oControl, oException.message);
if (this._sErrorMessage) {
this._sErrorMessage = null;
}
return;
}
} else {
oControl = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID);
}
if (this._sErrorMessage) {
this._showError(oControl, this._sErrorMessage);
this._sErrorMessage = null;
}
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
oControl;
if (sSelectedLocation === "custom") {
oControl = this._getControl("customBootstrapURL",this._SUPPORT_ASSISTANT_POPOVER_ID);
var sValue = oControl.getValue();
try {
this._validateValue(sValue);
} catch (oException) {
this._showError(oControl, oException.message);
if (this._sErrorMessage) {
this._sErrorMessage = null;
}
return;
}
} else {
oControl = this._getControl("standardBootstrapURL", this._SUPPORT_ASSISTANT_POPOVER_ID);
}
if (this._sErrorMessage) {
this._showError(oControl, this._sErrorMessage);
this._sErrorMessage = null;
}
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"sSelectedLocation",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/SelectedLocation\"",
")",
",",
"oControl",
";",
"if",
"(",
"sSelectedLocation",
"===",
"\"custom\"",
")",
"{",
"oControl",
"=",
"this",
".",
"_getControl",
"(",
"\"customBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
";",
"var",
"sValue",
"=",
"oControl",
".",
"getValue",
"(",
")",
";",
"try",
"{",
"this",
".",
"_validateValue",
"(",
"sValue",
")",
";",
"}",
"catch",
"(",
"oException",
")",
"{",
"this",
".",
"_showError",
"(",
"oControl",
",",
"oException",
".",
"message",
")",
";",
"if",
"(",
"this",
".",
"_sErrorMessage",
")",
"{",
"this",
".",
"_sErrorMessage",
"=",
"null",
";",
"}",
"return",
";",
"}",
"}",
"else",
"{",
"oControl",
"=",
"this",
".",
"_getControl",
"(",
"\"standardBootstrapURL\"",
",",
"this",
".",
"_SUPPORT_ASSISTANT_POPOVER_ID",
")",
";",
"}",
"if",
"(",
"this",
".",
"_sErrorMessage",
")",
"{",
"this",
".",
"_showError",
"(",
"oControl",
",",
"this",
".",
"_sErrorMessage",
")",
";",
"this",
".",
"_sErrorMessage",
"=",
"null",
";",
"}",
"}"
] |
Handler for onAfterOpen event from popover
@private
|
[
"Handler",
"for",
"onAfterOpen",
"event",
"from",
"popover"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L795-L820
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function (sControlId, sFragmentId) {
if (sFragmentId) {
return sap.ui.getCore().byId(sFragmentId + "--" + sControlId);
}
return sap.ui.getCore().byId(sControlId);
}
|
javascript
|
function (sControlId, sFragmentId) {
if (sFragmentId) {
return sap.ui.getCore().byId(sFragmentId + "--" + sControlId);
}
return sap.ui.getCore().byId(sControlId);
}
|
[
"function",
"(",
"sControlId",
",",
"sFragmentId",
")",
"{",
"if",
"(",
"sFragmentId",
")",
"{",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"byId",
"(",
"sFragmentId",
"+",
"\"--\"",
"+",
"sControlId",
")",
";",
"}",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"byId",
"(",
"sControlId",
")",
";",
"}"
] |
Gets the instance of the control. If context such as fragment is provided the
function will search for id in provided context. If context is not provided the standard
@param {string} sControlId The id of the searched control.
@param {string} sFragmentId The id of the context where the searched control is located.
@private
|
[
"Gets",
"the",
"instance",
"of",
"the",
"control",
".",
"If",
"context",
"such",
"as",
"fragment",
"is",
"provided",
"the",
"function",
"will",
"search",
"for",
"id",
"in",
"provided",
"context",
".",
"If",
"context",
"is",
"not",
"provided",
"the",
"standard"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L863-L868
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function(sParameter, vValue) {
// fetch current parameters from URL
var sSearch = window.location.search,
sURLParameter = sParameter + "=" + vValue;
/// replace or append the new URL parameter
if (sSearch && sSearch !== "?") {
var oRegExp = new RegExp("(?:^|\\?|&)" + sParameter + "=[^&]+");
if (sSearch.match(oRegExp)) {
sSearch = sSearch.replace(oRegExp, sURLParameter);
} else {
sSearch += "&" + sURLParameter;
}
} else {
sSearch = "?" + sURLParameter;
}
// reload the page by setting the new parameters
window.location.search = sSearch;
}
|
javascript
|
function(sParameter, vValue) {
// fetch current parameters from URL
var sSearch = window.location.search,
sURLParameter = sParameter + "=" + vValue;
/// replace or append the new URL parameter
if (sSearch && sSearch !== "?") {
var oRegExp = new RegExp("(?:^|\\?|&)" + sParameter + "=[^&]+");
if (sSearch.match(oRegExp)) {
sSearch = sSearch.replace(oRegExp, sURLParameter);
} else {
sSearch += "&" + sURLParameter;
}
} else {
sSearch = "?" + sURLParameter;
}
// reload the page by setting the new parameters
window.location.search = sSearch;
}
|
[
"function",
"(",
"sParameter",
",",
"vValue",
")",
"{",
"var",
"sSearch",
"=",
"window",
".",
"location",
".",
"search",
",",
"sURLParameter",
"=",
"sParameter",
"+",
"\"=\"",
"+",
"vValue",
";",
"if",
"(",
"sSearch",
"&&",
"sSearch",
"!==",
"\"?\"",
")",
"{",
"var",
"oRegExp",
"=",
"new",
"RegExp",
"(",
"\"(?:^|\\\\?|&)\"",
"+",
"\\\\",
"+",
"sParameter",
")",
";",
"\"=[^&]+\"",
"}",
"else",
"if",
"(",
"sSearch",
".",
"match",
"(",
"oRegExp",
")",
")",
"{",
"sSearch",
"=",
"sSearch",
".",
"replace",
"(",
"oRegExp",
",",
"sURLParameter",
")",
";",
"}",
"else",
"{",
"sSearch",
"+=",
"\"&\"",
"+",
"sURLParameter",
";",
"}",
"{",
"sSearch",
"=",
"\"?\"",
"+",
"sURLParameter",
";",
"}",
"}"
] |
Replaces the URL parameter and triggers a reload of the current page
@param {string} sParameter Parameter name
@param {any} vValue Parameter value
@private
|
[
"Replaces",
"the",
"URL",
"parameter",
"and",
"triggers",
"a",
"reload",
"of",
"the",
"current",
"page"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L876-L895
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0],
sDisplayCount;
oModel.setProperty("/CustomDebugMode", this._treeHelper.toDebugInfo(oTreeData));
oModel.setProperty("/DebugModuleSelectionCount", this._treeHelper.getSelectionCount(oTreeData));
sDisplayCount = oModel.getProperty("/DebugModuleSelectionCount").toString();
oModel.setProperty("/DebugModulesTitle", this._getText("TechInfo.DebugModulesConfigPopup.SelectionCounter", sDisplayCount));
}
|
javascript
|
function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0],
sDisplayCount;
oModel.setProperty("/CustomDebugMode", this._treeHelper.toDebugInfo(oTreeData));
oModel.setProperty("/DebugModuleSelectionCount", this._treeHelper.getSelectionCount(oTreeData));
sDisplayCount = oModel.getProperty("/DebugModuleSelectionCount").toString();
oModel.setProperty("/DebugModulesTitle", this._getText("TechInfo.DebugModulesConfigPopup.SelectionCounter", sDisplayCount));
}
|
[
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTreeData",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/DebugModules\"",
")",
"[",
"0",
"]",
",",
"sDisplayCount",
";",
"oModel",
".",
"setProperty",
"(",
"\"/CustomDebugMode\"",
",",
"this",
".",
"_treeHelper",
".",
"toDebugInfo",
"(",
"oTreeData",
")",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/DebugModuleSelectionCount\"",
",",
"this",
".",
"_treeHelper",
".",
"getSelectionCount",
"(",
"oTreeData",
")",
")",
";",
"sDisplayCount",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/DebugModuleSelectionCount\"",
")",
".",
"toString",
"(",
")",
";",
"oModel",
".",
"setProperty",
"(",
"\"/DebugModulesTitle\"",
",",
"this",
".",
"_getText",
"(",
"\"TechInfo.DebugModulesConfigPopup.SelectionCounter\"",
",",
"sDisplayCount",
")",
")",
";",
"}"
] |
Updates the debug mode input field and the number of selected debug modules
@private
|
[
"Updates",
"the",
"debug",
"mode",
"input",
"field",
"and",
"the",
"number",
"of",
"selected",
"debug",
"modules"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L921-L929
|
train
|
|
SAP/openui5
|
src/sap.ui.layout/src/sap/ui/layout/Splitter.js
|
_preventTextSelection
|
function _preventTextSelection(bTouch) {
var fnPreventSelection = function(oEvent) {
oEvent.preventDefault();
};
var fnAllowSelection = null;
fnAllowSelection = function() {
document.removeEventListener("touchend", fnAllowSelection);
document.removeEventListener("touchmove", fnPreventSelection);
document.removeEventListener("mouseup", fnAllowSelection);
document.removeEventListener("mousemove", fnPreventSelection);
};
if (bTouch) {
this._ignoreMouse = true; // Ignore mouse-events until touch is done
document.addEventListener("touchend", fnAllowSelection);
document.addEventListener("touchmove", fnPreventSelection);
} else {
document.addEventListener("mouseup", fnAllowSelection);
document.addEventListener("mousemove", fnPreventSelection);
}
}
|
javascript
|
function _preventTextSelection(bTouch) {
var fnPreventSelection = function(oEvent) {
oEvent.preventDefault();
};
var fnAllowSelection = null;
fnAllowSelection = function() {
document.removeEventListener("touchend", fnAllowSelection);
document.removeEventListener("touchmove", fnPreventSelection);
document.removeEventListener("mouseup", fnAllowSelection);
document.removeEventListener("mousemove", fnPreventSelection);
};
if (bTouch) {
this._ignoreMouse = true; // Ignore mouse-events until touch is done
document.addEventListener("touchend", fnAllowSelection);
document.addEventListener("touchmove", fnPreventSelection);
} else {
document.addEventListener("mouseup", fnAllowSelection);
document.addEventListener("mousemove", fnPreventSelection);
}
}
|
[
"function",
"_preventTextSelection",
"(",
"bTouch",
")",
"{",
"var",
"fnPreventSelection",
"=",
"function",
"(",
"oEvent",
")",
"{",
"oEvent",
".",
"preventDefault",
"(",
")",
";",
"}",
";",
"var",
"fnAllowSelection",
"=",
"null",
";",
"fnAllowSelection",
"=",
"function",
"(",
")",
"{",
"document",
".",
"removeEventListener",
"(",
"\"touchend\"",
",",
"fnAllowSelection",
")",
";",
"document",
".",
"removeEventListener",
"(",
"\"touchmove\"",
",",
"fnPreventSelection",
")",
";",
"document",
".",
"removeEventListener",
"(",
"\"mouseup\"",
",",
"fnAllowSelection",
")",
";",
"document",
".",
"removeEventListener",
"(",
"\"mousemove\"",
",",
"fnPreventSelection",
")",
";",
"}",
";",
"if",
"(",
"bTouch",
")",
"{",
"this",
".",
"_ignoreMouse",
"=",
"true",
";",
"document",
".",
"addEventListener",
"(",
"\"touchend\"",
",",
"fnAllowSelection",
")",
";",
"document",
".",
"addEventListener",
"(",
"\"touchmove\"",
",",
"fnPreventSelection",
")",
";",
"}",
"else",
"{",
"document",
".",
"addEventListener",
"(",
"\"mouseup\"",
",",
"fnAllowSelection",
")",
";",
"document",
".",
"addEventListener",
"(",
"\"mousemove\"",
",",
"fnPreventSelection",
")",
";",
"}",
"}"
] |
Prevents the selection of text while the mouse is moving when pressed
@param {boolean} [bTouch] If set to true, touch events instead of mouse events are captured
|
[
"Prevents",
"the",
"selection",
"of",
"text",
"while",
"the",
"mouse",
"is",
"moving",
"when",
"pressed"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/Splitter.js#L1076-L1096
|
train
|
SAP/openui5
|
src/sap.ui.layout/src/sap/ui/layout/Splitter.js
|
_ensureLayoutData
|
function _ensureLayoutData(oContent) {
var oLd = oContent.getLayoutData();
// Make sure LayoutData is set on the content
// But this approach has the advantage that "compatible" LayoutData can be used.
if (oLd && (!oLd.getResizable || !oLd.getSize || !oLd.getMinSize)) {
Log.warning(
"Content \"" + oContent.getId() + "\" for the Splitter contained wrong LayoutData. " +
"The LayoutData has been replaced with default values."
);
oLd = null;
}
if (!oLd) {
oContent.setLayoutData(new sap.ui.layout.SplitterLayoutData());
}
}
|
javascript
|
function _ensureLayoutData(oContent) {
var oLd = oContent.getLayoutData();
// Make sure LayoutData is set on the content
// But this approach has the advantage that "compatible" LayoutData can be used.
if (oLd && (!oLd.getResizable || !oLd.getSize || !oLd.getMinSize)) {
Log.warning(
"Content \"" + oContent.getId() + "\" for the Splitter contained wrong LayoutData. " +
"The LayoutData has been replaced with default values."
);
oLd = null;
}
if (!oLd) {
oContent.setLayoutData(new sap.ui.layout.SplitterLayoutData());
}
}
|
[
"function",
"_ensureLayoutData",
"(",
"oContent",
")",
"{",
"var",
"oLd",
"=",
"oContent",
".",
"getLayoutData",
"(",
")",
";",
"if",
"(",
"oLd",
"&&",
"(",
"!",
"oLd",
".",
"getResizable",
"||",
"!",
"oLd",
".",
"getSize",
"||",
"!",
"oLd",
".",
"getMinSize",
")",
")",
"{",
"Log",
".",
"warning",
"(",
"\"Content \\\"\"",
"+",
"\\\"",
"+",
"oContent",
".",
"getId",
"(",
")",
"+",
"\"\\\" for the Splitter contained wrong LayoutData. \"",
")",
";",
"\\\"",
"}",
"\"The LayoutData has been replaced with default values.\"",
"}"
] |
Makes sure the LayoutData for the given control is set and compatible. In case nothing is set,
a default sap.ui.layout.SplitterLayoutData is set on the Element
@param {sap.ui.core.Element} [oContent] The Element for which the existance of LayoutData should be ensured
@private
|
[
"Makes",
"sure",
"the",
"LayoutData",
"for",
"the",
"given",
"control",
"is",
"set",
"and",
"compatible",
".",
"In",
"case",
"nothing",
"is",
"set",
"a",
"default",
"sap",
".",
"ui",
".",
"layout",
".",
"SplitterLayoutData",
"is",
"set",
"on",
"the",
"Element"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/Splitter.js#L1105-L1119
|
train
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/v4/ODataUtils.js
|
function (vValue1, vValue2, vEdmType) {
if (vEdmType === true || vEdmType === "Decimal") {
return BaseODataUtils.compare(vValue1, vValue2, true);
}
if (vEdmType === "DateTime") {
return BaseODataUtils.compare(
ODataUtils.parseDateTimeOffset(vValue1),
ODataUtils.parseDateTimeOffset(vValue2));
}
return BaseODataUtils.compare(vValue1, vValue2);
}
|
javascript
|
function (vValue1, vValue2, vEdmType) {
if (vEdmType === true || vEdmType === "Decimal") {
return BaseODataUtils.compare(vValue1, vValue2, true);
}
if (vEdmType === "DateTime") {
return BaseODataUtils.compare(
ODataUtils.parseDateTimeOffset(vValue1),
ODataUtils.parseDateTimeOffset(vValue2));
}
return BaseODataUtils.compare(vValue1, vValue2);
}
|
[
"function",
"(",
"vValue1",
",",
"vValue2",
",",
"vEdmType",
")",
"{",
"if",
"(",
"vEdmType",
"===",
"true",
"||",
"vEdmType",
"===",
"\"Decimal\"",
")",
"{",
"return",
"BaseODataUtils",
".",
"compare",
"(",
"vValue1",
",",
"vValue2",
",",
"true",
")",
";",
"}",
"if",
"(",
"vEdmType",
"===",
"\"DateTime\"",
")",
"{",
"return",
"BaseODataUtils",
".",
"compare",
"(",
"ODataUtils",
".",
"parseDateTimeOffset",
"(",
"vValue1",
")",
",",
"ODataUtils",
".",
"parseDateTimeOffset",
"(",
"vValue2",
")",
")",
";",
"}",
"return",
"BaseODataUtils",
".",
"compare",
"(",
"vValue1",
",",
"vValue2",
")",
";",
"}"
] |
Compares the given OData values.
@param {any} vValue1
The first value to compare
@param {any} vValue2
The second value to compare
@param {boolean|string} [vEdmType]
If <code>true</code> or "Decimal", the string values <code>vValue1</code> and
<code>vValue2</code> are assumed to be valid "Edm.Decimal" or "Edm.Int64" values
and are compared as a decimal number (only sign, integer and fraction digits; no
exponential format).
If "DateTime", the string values <code>vValue1</code> and <code>vValue2</code>
are assumed to be valid "Edm.DateTimeOffset" values and are compared based on the
corresponding number of milliseconds since 1 January, 1970 UTC.
Otherwise the values are compared with the JavaScript operators <code>===</code>
and <code>></code>.
@return {number}
The result of the comparison: <code>0</code> if the values are equal,
<code>1</code> if the first value is larger, <code>-1</code> if the second value
is larger, <code>NaN</code> if they cannot be compared
@public
@since 1.43.0
|
[
"Compares",
"the",
"given",
"OData",
"values",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataUtils.js#L55-L65
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (context, sDropPosition, oDraggedControl, oDroppedControl, bIgnoreRTL) {
var iBeginDragIndex = context.indexOfItem(oDraggedControl),
iDropIndex = context.indexOfItem(oDroppedControl),
$DraggedControl = oDraggedControl.$(),
$DroppedControl = oDroppedControl.$(),
iAggregationDropIndex = 0,
bRtl = sap.ui.getCore().getConfiguration().getRTL(),
bIsDropPositionBefore = sDropPosition === INSERT_POSITION_BEFORE;
if (bRtl && !bIgnoreRTL) {
if (bIsDropPositionBefore) {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex : iDropIndex + 1;
sInsertAfterBeforePosition = INSERT_AFTER;
} else {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex - 1 : iDropIndex;
sInsertAfterBeforePosition = INSERT_BEFORE;
}
} else {
if (bIsDropPositionBefore) {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex - 1 : iDropIndex;
sInsertAfterBeforePosition = INSERT_BEFORE;
} else {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex : iDropIndex + 1;
sInsertAfterBeforePosition = INSERT_AFTER;
}
}
IconTabBarDragAndDropUtil._insertControl(sInsertAfterBeforePosition, $DraggedControl, $DroppedControl);
IconTabBarDragAndDropUtil._handleConfigurationAfterDragAndDrop.call(context, oDraggedControl, iAggregationDropIndex);
}
|
javascript
|
function (context, sDropPosition, oDraggedControl, oDroppedControl, bIgnoreRTL) {
var iBeginDragIndex = context.indexOfItem(oDraggedControl),
iDropIndex = context.indexOfItem(oDroppedControl),
$DraggedControl = oDraggedControl.$(),
$DroppedControl = oDroppedControl.$(),
iAggregationDropIndex = 0,
bRtl = sap.ui.getCore().getConfiguration().getRTL(),
bIsDropPositionBefore = sDropPosition === INSERT_POSITION_BEFORE;
if (bRtl && !bIgnoreRTL) {
if (bIsDropPositionBefore) {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex : iDropIndex + 1;
sInsertAfterBeforePosition = INSERT_AFTER;
} else {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex - 1 : iDropIndex;
sInsertAfterBeforePosition = INSERT_BEFORE;
}
} else {
if (bIsDropPositionBefore) {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex - 1 : iDropIndex;
sInsertAfterBeforePosition = INSERT_BEFORE;
} else {
iAggregationDropIndex = iBeginDragIndex < iDropIndex ? iDropIndex : iDropIndex + 1;
sInsertAfterBeforePosition = INSERT_AFTER;
}
}
IconTabBarDragAndDropUtil._insertControl(sInsertAfterBeforePosition, $DraggedControl, $DroppedControl);
IconTabBarDragAndDropUtil._handleConfigurationAfterDragAndDrop.call(context, oDraggedControl, iAggregationDropIndex);
}
|
[
"function",
"(",
"context",
",",
"sDropPosition",
",",
"oDraggedControl",
",",
"oDroppedControl",
",",
"bIgnoreRTL",
")",
"{",
"var",
"iBeginDragIndex",
"=",
"context",
".",
"indexOfItem",
"(",
"oDraggedControl",
")",
",",
"iDropIndex",
"=",
"context",
".",
"indexOfItem",
"(",
"oDroppedControl",
")",
",",
"$DraggedControl",
"=",
"oDraggedControl",
".",
"$",
"(",
")",
",",
"$DroppedControl",
"=",
"oDroppedControl",
".",
"$",
"(",
")",
",",
"iAggregationDropIndex",
"=",
"0",
",",
"bRtl",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getRTL",
"(",
")",
",",
"bIsDropPositionBefore",
"=",
"sDropPosition",
"===",
"INSERT_POSITION_BEFORE",
";",
"if",
"(",
"bRtl",
"&&",
"!",
"bIgnoreRTL",
")",
"{",
"if",
"(",
"bIsDropPositionBefore",
")",
"{",
"iAggregationDropIndex",
"=",
"iBeginDragIndex",
"<",
"iDropIndex",
"?",
"iDropIndex",
":",
"iDropIndex",
"+",
"1",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_AFTER",
";",
"}",
"else",
"{",
"iAggregationDropIndex",
"=",
"iBeginDragIndex",
"<",
"iDropIndex",
"?",
"iDropIndex",
"-",
"1",
":",
"iDropIndex",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_BEFORE",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"bIsDropPositionBefore",
")",
"{",
"iAggregationDropIndex",
"=",
"iBeginDragIndex",
"<",
"iDropIndex",
"?",
"iDropIndex",
"-",
"1",
":",
"iDropIndex",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_BEFORE",
";",
"}",
"else",
"{",
"iAggregationDropIndex",
"=",
"iBeginDragIndex",
"<",
"iDropIndex",
"?",
"iDropIndex",
":",
"iDropIndex",
"+",
"1",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_AFTER",
";",
"}",
"}",
"IconTabBarDragAndDropUtil",
".",
"_insertControl",
"(",
"sInsertAfterBeforePosition",
",",
"$DraggedControl",
",",
"$DroppedControl",
")",
";",
"IconTabBarDragAndDropUtil",
".",
"_handleConfigurationAfterDragAndDrop",
".",
"call",
"(",
"context",
",",
"oDraggedControl",
",",
"iAggregationDropIndex",
")",
";",
"}"
] |
Handles drop event.
@param {object} context from which context function is called (sap.m.IconTabHeader or sap.m.IconTabSelectList)
@param {String} sDropPosition comes from drop event, it can be "Before" or "After"
@param {object} oDraggedControl control that is being dragged
@param {object} oDroppedControl control that the dragged control will be dropped on
@param {boolean} bIgnoreRTL should RTL configuration be ignored for drag and drop logic
|
[
"Handles",
"drop",
"event",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L47-L76
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function () {
var oIconTabHeaderItems = this.getItems(),
iAriaPointSet = 1,
oItemDom;
oIconTabHeaderItems.forEach(function (oItem) {
oItemDom = oItem.getDomRef();
if (oItemDom && oItemDom.getAttribute("aria-posinset") !== null) {
oItemDom.setAttribute("aria-posinset", iAriaPointSet++);
}
});
}
|
javascript
|
function () {
var oIconTabHeaderItems = this.getItems(),
iAriaPointSet = 1,
oItemDom;
oIconTabHeaderItems.forEach(function (oItem) {
oItemDom = oItem.getDomRef();
if (oItemDom && oItemDom.getAttribute("aria-posinset") !== null) {
oItemDom.setAttribute("aria-posinset", iAriaPointSet++);
}
});
}
|
[
"function",
"(",
")",
"{",
"var",
"oIconTabHeaderItems",
"=",
"this",
".",
"getItems",
"(",
")",
",",
"iAriaPointSet",
"=",
"1",
",",
"oItemDom",
";",
"oIconTabHeaderItems",
".",
"forEach",
"(",
"function",
"(",
"oItem",
")",
"{",
"oItemDom",
"=",
"oItem",
".",
"getDomRef",
"(",
")",
";",
"if",
"(",
"oItemDom",
"&&",
"oItemDom",
".",
"getAttribute",
"(",
"\"aria-posinset\"",
")",
"!==",
"null",
")",
"{",
"oItemDom",
".",
"setAttribute",
"(",
"\"aria-posinset\"",
",",
"iAriaPointSet",
"++",
")",
";",
"}",
"}",
")",
";",
"}"
] |
Recalculates and sets the correct aria-posinset attribute value.
@private
|
[
"Recalculates",
"and",
"sets",
"the",
"correct",
"aria",
"-",
"posinset",
"attribute",
"value",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L82-L93
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (oDraggedControl, iDropIndex) {
this.removeAggregation('items', oDraggedControl, true);
this.insertAggregation('items', oDraggedControl, iDropIndex, true);
IconTabBarDragAndDropUtil._updateAccessibilityInfo.call(this);
}
|
javascript
|
function (oDraggedControl, iDropIndex) {
this.removeAggregation('items', oDraggedControl, true);
this.insertAggregation('items', oDraggedControl, iDropIndex, true);
IconTabBarDragAndDropUtil._updateAccessibilityInfo.call(this);
}
|
[
"function",
"(",
"oDraggedControl",
",",
"iDropIndex",
")",
"{",
"this",
".",
"removeAggregation",
"(",
"'items'",
",",
"oDraggedControl",
",",
"true",
")",
";",
"this",
".",
"insertAggregation",
"(",
"'items'",
",",
"oDraggedControl",
",",
"iDropIndex",
",",
"true",
")",
";",
"IconTabBarDragAndDropUtil",
".",
"_updateAccessibilityInfo",
".",
"call",
"(",
"this",
")",
";",
"}"
] |
Handles aggregation of control after drag and drop.
@param {object} oDraggedControl Dragged control
@param {number} iDropIndex Drop index
@private
|
[
"Handles",
"aggregation",
"of",
"control",
"after",
"drag",
"and",
"drop",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L101-L105
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (iBeginDragIndex, iControlCount) {
if (iBeginDragIndex === iControlCount - 1) {
sInsertAfterBeforePosition = INSERT_BEFORE;
return iBeginDragIndex;
}
sInsertAfterBeforePosition = INSERT_AFTER;
return iBeginDragIndex + 1;
}
|
javascript
|
function (iBeginDragIndex, iControlCount) {
if (iBeginDragIndex === iControlCount - 1) {
sInsertAfterBeforePosition = INSERT_BEFORE;
return iBeginDragIndex;
}
sInsertAfterBeforePosition = INSERT_AFTER;
return iBeginDragIndex + 1;
}
|
[
"function",
"(",
"iBeginDragIndex",
",",
"iControlCount",
")",
"{",
"if",
"(",
"iBeginDragIndex",
"===",
"iControlCount",
"-",
"1",
")",
"{",
"sInsertAfterBeforePosition",
"=",
"INSERT_BEFORE",
";",
"return",
"iBeginDragIndex",
";",
"}",
"sInsertAfterBeforePosition",
"=",
"INSERT_AFTER",
";",
"return",
"iBeginDragIndex",
"+",
"1",
";",
"}"
] |
Increases the drop index.
@param {number} iBeginDragIndex Index of dragged control
@param {number} iControlCount Number of controls
@private
|
[
"Increases",
"the",
"drop",
"index",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L127-L134
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (oDraggedControl, iKeyCode) {
var $DraggedControl = oDraggedControl.$(),
aItems = this.getItems(),
iBeginDragIndex = this.indexOfItem(oDraggedControl),
bRtl = sap.ui.getCore().getConfiguration().getRTL(),
iNewDropIndex,
$DroppedControl,
oKeyCodes = KeyCodes;
switch (iKeyCode) {
//Handles Ctrl + Home
case oKeyCodes.HOME:
iNewDropIndex = 0;
sInsertAfterBeforePosition = INSERT_BEFORE;
break;
//Handles Ctrl + End
case oKeyCodes.END:
iNewDropIndex = aItems.length - 1;
sInsertAfterBeforePosition = INSERT_AFTER;
break;
// Handles Ctrl + Left Arrow
case oKeyCodes.ARROW_LEFT:
if (bRtl) {
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
} else {
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
}
break;
// Handles Ctrl + Right Arrow
case oKeyCodes.ARROW_RIGHT:
if (bRtl) {
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
} else {
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
}
break;
// Handles Ctrl + Arrow Down
case oKeyCodes.ARROW_DOWN:
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
break;
// Handles Ctrl + Arrow Up
case oKeyCodes.ARROW_UP:
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
break;
default:
return;
}
$DroppedControl = aItems[iNewDropIndex].$();
IconTabBarDragAndDropUtil._insertControl(sInsertAfterBeforePosition, $DraggedControl, $DroppedControl);
IconTabBarDragAndDropUtil._handleConfigurationAfterDragAndDrop.call(this, oDraggedControl, iNewDropIndex);
return true;
}
|
javascript
|
function (oDraggedControl, iKeyCode) {
var $DraggedControl = oDraggedControl.$(),
aItems = this.getItems(),
iBeginDragIndex = this.indexOfItem(oDraggedControl),
bRtl = sap.ui.getCore().getConfiguration().getRTL(),
iNewDropIndex,
$DroppedControl,
oKeyCodes = KeyCodes;
switch (iKeyCode) {
//Handles Ctrl + Home
case oKeyCodes.HOME:
iNewDropIndex = 0;
sInsertAfterBeforePosition = INSERT_BEFORE;
break;
//Handles Ctrl + End
case oKeyCodes.END:
iNewDropIndex = aItems.length - 1;
sInsertAfterBeforePosition = INSERT_AFTER;
break;
// Handles Ctrl + Left Arrow
case oKeyCodes.ARROW_LEFT:
if (bRtl) {
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
} else {
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
}
break;
// Handles Ctrl + Right Arrow
case oKeyCodes.ARROW_RIGHT:
if (bRtl) {
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
} else {
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
}
break;
// Handles Ctrl + Arrow Down
case oKeyCodes.ARROW_DOWN:
iNewDropIndex = IconTabBarDragAndDropUtil._increaseDropIndex(iBeginDragIndex, aItems.length);
break;
// Handles Ctrl + Arrow Up
case oKeyCodes.ARROW_UP:
iNewDropIndex = IconTabBarDragAndDropUtil._decreaseDropIndex(iBeginDragIndex);
break;
default:
return;
}
$DroppedControl = aItems[iNewDropIndex].$();
IconTabBarDragAndDropUtil._insertControl(sInsertAfterBeforePosition, $DraggedControl, $DroppedControl);
IconTabBarDragAndDropUtil._handleConfigurationAfterDragAndDrop.call(this, oDraggedControl, iNewDropIndex);
return true;
}
|
[
"function",
"(",
"oDraggedControl",
",",
"iKeyCode",
")",
"{",
"var",
"$DraggedControl",
"=",
"oDraggedControl",
".",
"$",
"(",
")",
",",
"aItems",
"=",
"this",
".",
"getItems",
"(",
")",
",",
"iBeginDragIndex",
"=",
"this",
".",
"indexOfItem",
"(",
"oDraggedControl",
")",
",",
"bRtl",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getRTL",
"(",
")",
",",
"iNewDropIndex",
",",
"$DroppedControl",
",",
"oKeyCodes",
"=",
"KeyCodes",
";",
"switch",
"(",
"iKeyCode",
")",
"{",
"case",
"oKeyCodes",
".",
"HOME",
":",
"iNewDropIndex",
"=",
"0",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_BEFORE",
";",
"break",
";",
"case",
"oKeyCodes",
".",
"END",
":",
"iNewDropIndex",
"=",
"aItems",
".",
"length",
"-",
"1",
";",
"sInsertAfterBeforePosition",
"=",
"INSERT_AFTER",
";",
"break",
";",
"case",
"oKeyCodes",
".",
"ARROW_LEFT",
":",
"if",
"(",
"bRtl",
")",
"{",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_increaseDropIndex",
"(",
"iBeginDragIndex",
",",
"aItems",
".",
"length",
")",
";",
"}",
"else",
"{",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_decreaseDropIndex",
"(",
"iBeginDragIndex",
")",
";",
"}",
"break",
";",
"case",
"oKeyCodes",
".",
"ARROW_RIGHT",
":",
"if",
"(",
"bRtl",
")",
"{",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_decreaseDropIndex",
"(",
"iBeginDragIndex",
")",
";",
"}",
"else",
"{",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_increaseDropIndex",
"(",
"iBeginDragIndex",
",",
"aItems",
".",
"length",
")",
";",
"}",
"break",
";",
"case",
"oKeyCodes",
".",
"ARROW_DOWN",
":",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_increaseDropIndex",
"(",
"iBeginDragIndex",
",",
"aItems",
".",
"length",
")",
";",
"break",
";",
"case",
"oKeyCodes",
".",
"ARROW_UP",
":",
"iNewDropIndex",
"=",
"IconTabBarDragAndDropUtil",
".",
"_decreaseDropIndex",
"(",
"iBeginDragIndex",
")",
";",
"break",
";",
"default",
":",
"return",
";",
"}",
"$DroppedControl",
"=",
"aItems",
"[",
"iNewDropIndex",
"]",
".",
"$",
"(",
")",
";",
"IconTabBarDragAndDropUtil",
".",
"_insertControl",
"(",
"sInsertAfterBeforePosition",
",",
"$DraggedControl",
",",
"$DroppedControl",
")",
";",
"IconTabBarDragAndDropUtil",
".",
"_handleConfigurationAfterDragAndDrop",
".",
"call",
"(",
"this",
",",
"oDraggedControl",
",",
"iNewDropIndex",
")",
";",
"return",
"true",
";",
"}"
] |
Moves focused control depending on the combinations of pressed keys.
@param {object} oDraggedControl Control that is going to be moved
@param {number} iKeyCode Key code
@returns {boolean} returns true is scrolling will be needed
|
[
"Moves",
"focused",
"control",
"depending",
"on",
"the",
"combinations",
"of",
"pressed",
"keys",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L143-L196
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (aItems, oDraggedControl, oDroppedControl) {
var oDroppedListControl,
oDraggedListControl,
sItemId,
sDroppedControlId,
sDraggedControlId;
sDraggedControlId = oDraggedControl._tabFilter ? oDraggedControl._tabFilter.getId() : oDraggedControl.getId();
sDroppedControlId = oDroppedControl._tabFilter ? oDroppedControl._tabFilter.getId() : oDroppedControl.getId();
if (!aItems && !oDraggedControl && !oDroppedControl) {
return;
}
aItems.forEach(function (oItem) {
sItemId = oItem._tabFilter.getId();
if (!sItemId) {
return;
}
if (sItemId === sDroppedControlId) {
oDroppedListControl = oItem;
}
if (sItemId === sDraggedControlId) {
oDraggedListControl = oItem;
}
});
return {oDraggedControlFromList: oDraggedListControl, oDroppedControlFromList: oDroppedListControl};
}
|
javascript
|
function (aItems, oDraggedControl, oDroppedControl) {
var oDroppedListControl,
oDraggedListControl,
sItemId,
sDroppedControlId,
sDraggedControlId;
sDraggedControlId = oDraggedControl._tabFilter ? oDraggedControl._tabFilter.getId() : oDraggedControl.getId();
sDroppedControlId = oDroppedControl._tabFilter ? oDroppedControl._tabFilter.getId() : oDroppedControl.getId();
if (!aItems && !oDraggedControl && !oDroppedControl) {
return;
}
aItems.forEach(function (oItem) {
sItemId = oItem._tabFilter.getId();
if (!sItemId) {
return;
}
if (sItemId === sDroppedControlId) {
oDroppedListControl = oItem;
}
if (sItemId === sDraggedControlId) {
oDraggedListControl = oItem;
}
});
return {oDraggedControlFromList: oDraggedListControl, oDroppedControlFromList: oDroppedListControl};
}
|
[
"function",
"(",
"aItems",
",",
"oDraggedControl",
",",
"oDroppedControl",
")",
"{",
"var",
"oDroppedListControl",
",",
"oDraggedListControl",
",",
"sItemId",
",",
"sDroppedControlId",
",",
"sDraggedControlId",
";",
"sDraggedControlId",
"=",
"oDraggedControl",
".",
"_tabFilter",
"?",
"oDraggedControl",
".",
"_tabFilter",
".",
"getId",
"(",
")",
":",
"oDraggedControl",
".",
"getId",
"(",
")",
";",
"sDroppedControlId",
"=",
"oDroppedControl",
".",
"_tabFilter",
"?",
"oDroppedControl",
".",
"_tabFilter",
".",
"getId",
"(",
")",
":",
"oDroppedControl",
".",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"aItems",
"&&",
"!",
"oDraggedControl",
"&&",
"!",
"oDroppedControl",
")",
"{",
"return",
";",
"}",
"aItems",
".",
"forEach",
"(",
"function",
"(",
"oItem",
")",
"{",
"sItemId",
"=",
"oItem",
".",
"_tabFilter",
".",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"sItemId",
")",
"{",
"return",
";",
"}",
"if",
"(",
"sItemId",
"===",
"sDroppedControlId",
")",
"{",
"oDroppedListControl",
"=",
"oItem",
";",
"}",
"if",
"(",
"sItemId",
"===",
"sDraggedControlId",
")",
"{",
"oDraggedListControl",
"=",
"oItem",
";",
"}",
"}",
")",
";",
"return",
"{",
"oDraggedControlFromList",
":",
"oDraggedListControl",
",",
"oDroppedControlFromList",
":",
"oDroppedListControl",
"}",
";",
"}"
] |
Retrieves drag and drop controls from sap.m.IconTabBarSelectList context.
@param {array} aItems items of sap.m.IconTabBarSelectList
@param {object} oDraggedControl item that is dragged
@param {object} oDroppedControl item that the dragged control will be dropped on
|
[
"Retrieves",
"drag",
"and",
"drop",
"controls",
"from",
"sap",
".",
"m",
".",
"IconTabBarSelectList",
"context",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L204-L232
|
train
|
|
SAP/openui5
|
src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js
|
function (context, sDropLayout) {
var oIconTabHeader = context._iconTabHeader ? context._iconTabHeader : context;
var sIconTabHeaderId = oIconTabHeader.getId();
//Adding Drag&Drop configuration to the dragDropConfig aggregation if needed
context.addDragDropConfig(new DragInfo({
sourceAggregation: "items",
groupName: DRAG_DROP_GROUP_NAME + sIconTabHeaderId
}));
context.addDragDropConfig(new DropInfo({
targetAggregation: "items",
dropPosition: "Between",
dropLayout: sDropLayout,
drop: context._handleDragAndDrop.bind(context),
groupName: DRAG_DROP_GROUP_NAME + sIconTabHeaderId
}));
}
|
javascript
|
function (context, sDropLayout) {
var oIconTabHeader = context._iconTabHeader ? context._iconTabHeader : context;
var sIconTabHeaderId = oIconTabHeader.getId();
//Adding Drag&Drop configuration to the dragDropConfig aggregation if needed
context.addDragDropConfig(new DragInfo({
sourceAggregation: "items",
groupName: DRAG_DROP_GROUP_NAME + sIconTabHeaderId
}));
context.addDragDropConfig(new DropInfo({
targetAggregation: "items",
dropPosition: "Between",
dropLayout: sDropLayout,
drop: context._handleDragAndDrop.bind(context),
groupName: DRAG_DROP_GROUP_NAME + sIconTabHeaderId
}));
}
|
[
"function",
"(",
"context",
",",
"sDropLayout",
")",
"{",
"var",
"oIconTabHeader",
"=",
"context",
".",
"_iconTabHeader",
"?",
"context",
".",
"_iconTabHeader",
":",
"context",
";",
"var",
"sIconTabHeaderId",
"=",
"oIconTabHeader",
".",
"getId",
"(",
")",
";",
"context",
".",
"addDragDropConfig",
"(",
"new",
"DragInfo",
"(",
"{",
"sourceAggregation",
":",
"\"items\"",
",",
"groupName",
":",
"DRAG_DROP_GROUP_NAME",
"+",
"sIconTabHeaderId",
"}",
")",
")",
";",
"context",
".",
"addDragDropConfig",
"(",
"new",
"DropInfo",
"(",
"{",
"targetAggregation",
":",
"\"items\"",
",",
"dropPosition",
":",
"\"Between\"",
",",
"dropLayout",
":",
"sDropLayout",
",",
"drop",
":",
"context",
".",
"_handleDragAndDrop",
".",
"bind",
"(",
"context",
")",
",",
"groupName",
":",
"DRAG_DROP_GROUP_NAME",
"+",
"sIconTabHeaderId",
"}",
")",
")",
";",
"}"
] |
Adding aggregations for drag and drop.
@param {object} context from which context function is called (sap.m.IconTabHeader or sap.m.IconTabSelectList)
@param {string} sDropLayout Depending on the control we are dragging in, it could be Vertical or Horizontal
|
[
"Adding",
"aggregations",
"for",
"drag",
"and",
"drop",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L239-L254
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/core/util/serializer/XMLViewSerializer.js
|
function (oControl) {
return oControl instanceof this._oWindow.sap.ui.core.mvc.View && oControl !== that._oView;
}
|
javascript
|
function (oControl) {
return oControl instanceof this._oWindow.sap.ui.core.mvc.View && oControl !== that._oView;
}
|
[
"function",
"(",
"oControl",
")",
"{",
"return",
"oControl",
"instanceof",
"this",
".",
"_oWindow",
".",
"sap",
".",
"ui",
".",
"core",
".",
"mvc",
".",
"View",
"&&",
"oControl",
"!==",
"that",
".",
"_oView",
";",
"}"
] |
a function to understand if to skip aggregations
|
[
"a",
"function",
"to",
"understand",
"if",
"to",
"skip",
"aggregations"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/serializer/XMLViewSerializer.js#L60-L62
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
|
function (oInterface, oPathValue, iIndex, sEdmType) {
var oParameter = Basics.descend(oPathValue, iIndex),
oResult;
oParameter.asExpression = true;
oResult = Expression.expression(oInterface, oParameter);
if (sEdmType && sEdmType !== oResult.type) {
Basics.error(oParameter,
"Expected " + sEdmType + " but instead saw " + oResult.type);
}
return oResult;
}
|
javascript
|
function (oInterface, oPathValue, iIndex, sEdmType) {
var oParameter = Basics.descend(oPathValue, iIndex),
oResult;
oParameter.asExpression = true;
oResult = Expression.expression(oInterface, oParameter);
if (sEdmType && sEdmType !== oResult.type) {
Basics.error(oParameter,
"Expected " + sEdmType + " but instead saw " + oResult.type);
}
return oResult;
}
|
[
"function",
"(",
"oInterface",
",",
"oPathValue",
",",
"iIndex",
",",
"sEdmType",
")",
"{",
"var",
"oParameter",
"=",
"Basics",
".",
"descend",
"(",
"oPathValue",
",",
"iIndex",
")",
",",
"oResult",
";",
"oParameter",
".",
"asExpression",
"=",
"true",
";",
"oResult",
"=",
"Expression",
".",
"expression",
"(",
"oInterface",
",",
"oParameter",
")",
";",
"if",
"(",
"sEdmType",
"&&",
"sEdmType",
"!==",
"oResult",
".",
"type",
")",
"{",
"Basics",
".",
"error",
"(",
"oParameter",
",",
"\"Expected \"",
"+",
"sEdmType",
"+",
"\" but instead saw \"",
"+",
"oResult",
".",
"type",
")",
";",
"}",
"return",
"oResult",
";",
"}"
] |
Evaluates a parameter and ensures that the result is of the given EDM type.
The function calls <code>expression</code> with <code>bExpression=true</code>. This will
cause any embedded <code>odata.concat</code> to generate an expression binding. This
should be correct in any case because only a standalone <code>concat</code> may generate
a composite binding.
@param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface
the callback interface related to the current formatter call
@param {object} oPathValue
path and value information pointing to the parameter array (see Expression object)
@param {number} iIndex
the parameter index
@param {string} [sEdmType]
the expected EDM type or <code>undefined</code> if any type is allowed
@returns {object}
the result object
|
[
"Evaluates",
"a",
"parameter",
"and",
"ensures",
"that",
"the",
"result",
"is",
"of",
"the",
"given",
"EDM",
"type",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L625-L637
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
|
function (sValue) {
return DateFormat.getDateInstance({
pattern : "yyyy-MM-dd",
strictParsing : true,
UTC : true
}).parse(sValue);
}
|
javascript
|
function (sValue) {
return DateFormat.getDateInstance({
pattern : "yyyy-MM-dd",
strictParsing : true,
UTC : true
}).parse(sValue);
}
|
[
"function",
"(",
"sValue",
")",
"{",
"return",
"DateFormat",
".",
"getDateInstance",
"(",
"{",
"pattern",
":",
"\"yyyy-MM-dd\"",
",",
"strictParsing",
":",
"true",
",",
"UTC",
":",
"true",
"}",
")",
".",
"parse",
"(",
"sValue",
")",
";",
"}"
] |
Parses an Edm.Date value and returns the corresponding JavaScript Date value.
@param {string} sValue
the Edm.Date value to parse
@returns {Date}
the JavaScript Date value or <code>null</code> in case the input could not be parsed
|
[
"Parses",
"an",
"Edm",
".",
"Date",
"value",
"and",
"returns",
"the",
"corresponding",
"JavaScript",
"Date",
"value",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L647-L653
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
|
function (sValue) {
var aMatches = mEdmType2RegExp.DateTimeOffset.exec(sValue);
if (aMatches && aMatches[1] && aMatches[1].length > 4) {
// "round" to millis, BEWARE of the dot!
sValue = sValue.replace(aMatches[1], aMatches[1].slice(0, 4));
}
return DateFormat.getDateTimeInstance({
pattern : "yyyy-MM-dd'T'HH:mm:ss.SSSX",
strictParsing : true
}).parse(sValue.toUpperCase());
}
|
javascript
|
function (sValue) {
var aMatches = mEdmType2RegExp.DateTimeOffset.exec(sValue);
if (aMatches && aMatches[1] && aMatches[1].length > 4) {
// "round" to millis, BEWARE of the dot!
sValue = sValue.replace(aMatches[1], aMatches[1].slice(0, 4));
}
return DateFormat.getDateTimeInstance({
pattern : "yyyy-MM-dd'T'HH:mm:ss.SSSX",
strictParsing : true
}).parse(sValue.toUpperCase());
}
|
[
"function",
"(",
"sValue",
")",
"{",
"var",
"aMatches",
"=",
"mEdmType2RegExp",
".",
"DateTimeOffset",
".",
"exec",
"(",
"sValue",
")",
";",
"if",
"(",
"aMatches",
"&&",
"aMatches",
"[",
"1",
"]",
"&&",
"aMatches",
"[",
"1",
"]",
".",
"length",
">",
"4",
")",
"{",
"sValue",
"=",
"sValue",
".",
"replace",
"(",
"aMatches",
"[",
"1",
"]",
",",
"aMatches",
"[",
"1",
"]",
".",
"slice",
"(",
"0",
",",
"4",
")",
")",
";",
"}",
"return",
"DateFormat",
".",
"getDateTimeInstance",
"(",
"{",
"pattern",
":",
"\"yyyy-MM-dd'T'HH:mm:ss.SSSX\"",
",",
"strictParsing",
":",
"true",
"}",
")",
".",
"parse",
"(",
"sValue",
".",
"toUpperCase",
"(",
")",
")",
";",
"}"
] |
Parses an Edm.DateTimeOffset value and returns the corresponding JavaScript Date value.
@param {string} sValue
the Edm.DateTimeOffset value to parse
@returns {Date}
the JavaScript Date value or <code>null</code> in case the input could not be parsed
|
[
"Parses",
"an",
"Edm",
".",
"DateTimeOffset",
"value",
"and",
"returns",
"the",
"corresponding",
"JavaScript",
"Date",
"value",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L663-L674
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
|
function (sValue) {
if (sValue.length > 12) {
// "round" to millis: "HH:mm:ss.SSS"
sValue = sValue.slice(0, 12);
}
return DateFormat.getTimeInstance({
pattern : "HH:mm:ss.SSS",
strictParsing : true,
UTC : true
}).parse(sValue);
}
|
javascript
|
function (sValue) {
if (sValue.length > 12) {
// "round" to millis: "HH:mm:ss.SSS"
sValue = sValue.slice(0, 12);
}
return DateFormat.getTimeInstance({
pattern : "HH:mm:ss.SSS",
strictParsing : true,
UTC : true
}).parse(sValue);
}
|
[
"function",
"(",
"sValue",
")",
"{",
"if",
"(",
"sValue",
".",
"length",
">",
"12",
")",
"{",
"sValue",
"=",
"sValue",
".",
"slice",
"(",
"0",
",",
"12",
")",
";",
"}",
"return",
"DateFormat",
".",
"getTimeInstance",
"(",
"{",
"pattern",
":",
"\"HH:mm:ss.SSS\"",
",",
"strictParsing",
":",
"true",
",",
"UTC",
":",
"true",
"}",
")",
".",
"parse",
"(",
"sValue",
")",
";",
"}"
] |
Parses an Edm.TimeOfDay value and returns the corresponding JavaScript Date value.
@param {string} sValue
the Edm.TimeOfDay value to parse
@returns {Date}
the JavaScript Date value or <code>null</code> in case the input could not be parsed
|
[
"Parses",
"an",
"Edm",
".",
"TimeOfDay",
"value",
"and",
"returns",
"the",
"corresponding",
"JavaScript",
"Date",
"value",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L684-L695
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/base/Metadata.js
|
function(sClassName, oClassInfo) {
assert(typeof sClassName === "string" && sClassName, "Metadata: sClassName must be a non-empty string");
assert(typeof oClassInfo === "object", "Metadata: oClassInfo must be empty or an object");
// support for old usage of Metadata
if ( !oClassInfo || typeof oClassInfo.metadata !== "object" ) {
oClassInfo = {
metadata : oClassInfo || {},
// retrieve class by its name. Using a lookup costs time but avoids the need for redundant arguments to this function
constructor : ObjectPath.get(sClassName)
};
oClassInfo.metadata.__version = 1.0;
}
oClassInfo.metadata.__version = oClassInfo.metadata.__version || 2.0;
if ( typeof oClassInfo.constructor !== "function" ) {
throw Error("constructor for class " + sClassName + " must have been declared before creating metadata for it");
}
// invariant: oClassInfo exists, oClassInfo.metadata exists, oClassInfo.constructor exists
this._sClassName = sClassName;
this._oClass = oClassInfo.constructor;
this.extend(oClassInfo);
}
|
javascript
|
function(sClassName, oClassInfo) {
assert(typeof sClassName === "string" && sClassName, "Metadata: sClassName must be a non-empty string");
assert(typeof oClassInfo === "object", "Metadata: oClassInfo must be empty or an object");
// support for old usage of Metadata
if ( !oClassInfo || typeof oClassInfo.metadata !== "object" ) {
oClassInfo = {
metadata : oClassInfo || {},
// retrieve class by its name. Using a lookup costs time but avoids the need for redundant arguments to this function
constructor : ObjectPath.get(sClassName)
};
oClassInfo.metadata.__version = 1.0;
}
oClassInfo.metadata.__version = oClassInfo.metadata.__version || 2.0;
if ( typeof oClassInfo.constructor !== "function" ) {
throw Error("constructor for class " + sClassName + " must have been declared before creating metadata for it");
}
// invariant: oClassInfo exists, oClassInfo.metadata exists, oClassInfo.constructor exists
this._sClassName = sClassName;
this._oClass = oClassInfo.constructor;
this.extend(oClassInfo);
}
|
[
"function",
"(",
"sClassName",
",",
"oClassInfo",
")",
"{",
"assert",
"(",
"typeof",
"sClassName",
"===",
"\"string\"",
"&&",
"sClassName",
",",
"\"Metadata: sClassName must be a non-empty string\"",
")",
";",
"assert",
"(",
"typeof",
"oClassInfo",
"===",
"\"object\"",
",",
"\"Metadata: oClassInfo must be empty or an object\"",
")",
";",
"if",
"(",
"!",
"oClassInfo",
"||",
"typeof",
"oClassInfo",
".",
"metadata",
"!==",
"\"object\"",
")",
"{",
"oClassInfo",
"=",
"{",
"metadata",
":",
"oClassInfo",
"||",
"{",
"}",
",",
"constructor",
":",
"ObjectPath",
".",
"get",
"(",
"sClassName",
")",
"}",
";",
"oClassInfo",
".",
"metadata",
".",
"__version",
"=",
"1.0",
";",
"}",
"oClassInfo",
".",
"metadata",
".",
"__version",
"=",
"oClassInfo",
".",
"metadata",
".",
"__version",
"||",
"2.0",
";",
"if",
"(",
"typeof",
"oClassInfo",
".",
"constructor",
"!==",
"\"function\"",
")",
"{",
"throw",
"Error",
"(",
"\"constructor for class \"",
"+",
"sClassName",
"+",
"\" must have been declared before creating metadata for it\"",
")",
";",
"}",
"this",
".",
"_sClassName",
"=",
"sClassName",
";",
"this",
".",
"_oClass",
"=",
"oClassInfo",
".",
"constructor",
";",
"this",
".",
"extend",
"(",
"oClassInfo",
")",
";",
"}"
] |
Creates a new metadata object from the given static infos.
Note: throughout this class documentation, the described subclass of Object
is referenced as <i>the described class</i>.
@param {string} sClassName fully qualified name of the described class
@param {object} oClassInfo info to construct the class and its metadata from
@class Metadata for a class.
@author Frank Weigel
@version ${version}
@since 0.8.6
@public
@alias sap.ui.base.Metadata
|
[
"Creates",
"a",
"new",
"metadata",
"object",
"from",
"the",
"given",
"static",
"infos",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/Metadata.js#L33-L56
|
train
|
|
SAP/openui5
|
src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js
|
function (oEvent) {
oEvent.getParameters().itemsBinding.filter([
new Filter("name", FilterOperator.Contains, oEvent.getParameters().value)
]);
}
|
javascript
|
function (oEvent) {
oEvent.getParameters().itemsBinding.filter([
new Filter("name", FilterOperator.Contains, oEvent.getParameters().value)
]);
}
|
[
"function",
"(",
"oEvent",
")",
"{",
"oEvent",
".",
"getParameters",
"(",
")",
".",
"itemsBinding",
".",
"filter",
"(",
"[",
"new",
"Filter",
"(",
"\"name\"",
",",
"FilterOperator",
".",
"Contains",
",",
"oEvent",
".",
"getParameters",
"(",
")",
".",
"value",
")",
"]",
")",
";",
"}"
] |
Filters the download dialog
@param {sap.ui.base.Event} oEvent the SearchField liveChange event
@public
|
[
"Filters",
"the",
"download",
"dialog"
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js#L47-L51
|
train
|
|
SAP/openui5
|
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js
|
function (oData, sFileType) {
// code extension and properties files do not need formation
if ((sFileType === "js") || (sFileType === "properties")) {
return oData;
}
// other files should be formatted to JSON
try {
oData = JSON.parse(oData);
return JSON.stringify(oData, null, '\t');
} catch (oError){
var ErrorUtils = sap.ui.require("sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils");
ErrorUtils.displayError("Error", oError.name, oError.message);
return oData;
}
}
|
javascript
|
function (oData, sFileType) {
// code extension and properties files do not need formation
if ((sFileType === "js") || (sFileType === "properties")) {
return oData;
}
// other files should be formatted to JSON
try {
oData = JSON.parse(oData);
return JSON.stringify(oData, null, '\t');
} catch (oError){
var ErrorUtils = sap.ui.require("sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils");
ErrorUtils.displayError("Error", oError.name, oError.message);
return oData;
}
}
|
[
"function",
"(",
"oData",
",",
"sFileType",
")",
"{",
"if",
"(",
"(",
"sFileType",
"===",
"\"js\"",
")",
"||",
"(",
"sFileType",
"===",
"\"properties\"",
")",
")",
"{",
"return",
"oData",
";",
"}",
"try",
"{",
"oData",
"=",
"JSON",
".",
"parse",
"(",
"oData",
")",
";",
"return",
"JSON",
".",
"stringify",
"(",
"oData",
",",
"null",
",",
"'\\t'",
")",
";",
"}",
"\\t",
"}"
] |
Pretty printer for specific file types.
@param {Object} oData - data to be formatted
@param {String} sFileType - file type of data
@returns {Object} oData - data after formatting
@public
|
[
"Pretty",
"printer",
"for",
"specific",
"file",
"types",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L38-L52
|
train
|
|
SAP/openui5
|
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js
|
function (oGroup) {
var sTitle = "{i18n>systemData}";
if (oGroup.key === "custom") {
sTitle = "{i18n>externalReferences}";
}
return new GroupHeaderListItem({
title: sTitle,
upperCase: false
});
}
|
javascript
|
function (oGroup) {
var sTitle = "{i18n>systemData}";
if (oGroup.key === "custom") {
sTitle = "{i18n>externalReferences}";
}
return new GroupHeaderListItem({
title: sTitle,
upperCase: false
});
}
|
[
"function",
"(",
"oGroup",
")",
"{",
"var",
"sTitle",
"=",
"\"{i18n>systemData}\"",
";",
"if",
"(",
"oGroup",
".",
"key",
"===",
"\"custom\"",
")",
"{",
"sTitle",
"=",
"\"{i18n>externalReferences}\"",
";",
"}",
"return",
"new",
"GroupHeaderListItem",
"(",
"{",
"title",
":",
"sTitle",
",",
"upperCase",
":",
"false",
"}",
")",
";",
"}"
] |
Factory for creating list group header objects for the metadata list.
@param {Object} oGroup - group data passed from the lists model binding
@returns {sap.m.GroupHeaderListItem}
@public
|
[
"Factory",
"for",
"creating",
"list",
"group",
"header",
"objects",
"for",
"the",
"metadata",
"list",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L60-L71
|
train
|
|
SAP/openui5
|
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js
|
function (oContentItem) {
var bNotBlacklisted = true;
jQuery.each(this.aBlacklist, function (index, mBlacklistedElement) {
var bAllPropertiesMatched = true;
jQuery.each(mBlacklistedElement, function (sProperty, sValue) {
bAllPropertiesMatched = bAllPropertiesMatched && oContentItem[sProperty] === sValue;
});
if (bAllPropertiesMatched) {
bNotBlacklisted = false;
return false; // break each
}
});
return bNotBlacklisted;
}
|
javascript
|
function (oContentItem) {
var bNotBlacklisted = true;
jQuery.each(this.aBlacklist, function (index, mBlacklistedElement) {
var bAllPropertiesMatched = true;
jQuery.each(mBlacklistedElement, function (sProperty, sValue) {
bAllPropertiesMatched = bAllPropertiesMatched && oContentItem[sProperty] === sValue;
});
if (bAllPropertiesMatched) {
bNotBlacklisted = false;
return false; // break each
}
});
return bNotBlacklisted;
}
|
[
"function",
"(",
"oContentItem",
")",
"{",
"var",
"bNotBlacklisted",
"=",
"true",
";",
"jQuery",
".",
"each",
"(",
"this",
".",
"aBlacklist",
",",
"function",
"(",
"index",
",",
"mBlacklistedElement",
")",
"{",
"var",
"bAllPropertiesMatched",
"=",
"true",
";",
"jQuery",
".",
"each",
"(",
"mBlacklistedElement",
",",
"function",
"(",
"sProperty",
",",
"sValue",
")",
"{",
"bAllPropertiesMatched",
"=",
"bAllPropertiesMatched",
"&&",
"oContentItem",
"[",
"sProperty",
"]",
"===",
"sValue",
";",
"}",
")",
";",
"if",
"(",
"bAllPropertiesMatched",
")",
"{",
"bNotBlacklisted",
"=",
"false",
";",
"return",
"false",
";",
"}",
"}",
")",
";",
"return",
"bNotBlacklisted",
";",
"}"
] |
Verifies if item content is not in the black list.
@param {Object} oContentItem - content item needs to be verified
@returns {Boolean} - <code>true</code> if not in the black list
@public
|
[
"Verifies",
"if",
"item",
"content",
"is",
"not",
"in",
"the",
"black",
"list",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L79-L94
|
train
|
|
SAP/openui5
|
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js
|
function (sNamespace) {
if (!sNamespace) {
return "";
}
if (sNamespace[0] === "/") {
var sNamespaceWithoutLeadingSlash = sNamespace.substring(1, sNamespace.length);
return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutLeadingSlash);
}
if (sNamespace[sNamespace.length - 1] === "/") {
var sNamespaceWithoutTrailingSlash = sNamespace.substring(0, sNamespace.length - 1);
return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutTrailingSlash);
}
return sNamespace;
}
|
javascript
|
function (sNamespace) {
if (!sNamespace) {
return "";
}
if (sNamespace[0] === "/") {
var sNamespaceWithoutLeadingSlash = sNamespace.substring(1, sNamespace.length);
return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutLeadingSlash);
}
if (sNamespace[sNamespace.length - 1] === "/") {
var sNamespaceWithoutTrailingSlash = sNamespace.substring(0, sNamespace.length - 1);
return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutTrailingSlash);
}
return sNamespace;
}
|
[
"function",
"(",
"sNamespace",
")",
"{",
"if",
"(",
"!",
"sNamespace",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"sNamespace",
"[",
"0",
"]",
"===",
"\"/\"",
")",
"{",
"var",
"sNamespaceWithoutLeadingSlash",
"=",
"sNamespace",
".",
"substring",
"(",
"1",
",",
"sNamespace",
".",
"length",
")",
";",
"return",
"this",
".",
"cleanLeadingAndTrailingSlashes",
"(",
"sNamespaceWithoutLeadingSlash",
")",
";",
"}",
"if",
"(",
"sNamespace",
"[",
"sNamespace",
".",
"length",
"-",
"1",
"]",
"===",
"\"/\"",
")",
"{",
"var",
"sNamespaceWithoutTrailingSlash",
"=",
"sNamespace",
".",
"substring",
"(",
"0",
",",
"sNamespace",
".",
"length",
"-",
"1",
")",
";",
"return",
"this",
".",
"cleanLeadingAndTrailingSlashes",
"(",
"sNamespaceWithoutTrailingSlash",
")",
";",
"}",
"return",
"sNamespace",
";",
"}"
] |
Removes leading and trailing slashes from a string.
@param {String} sNamespace - input string
@returns {String} - string after removing leading and trailing slashes
@public
|
[
"Removes",
"leading",
"and",
"trailing",
"slashes",
"from",
"a",
"string",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L102-L115
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/jquery.sap.global.js
|
function(key, type, callback) {
return function(value) {
try {
if ( value != null || type === 'string' ) {
if (value) {
localStorage.setItem(key, type === 'boolean' ? 'X' : value);
} else {
localStorage.removeItem(key);
}
callback(value);
}
value = localStorage.getItem(key);
return type === 'boolean' ? value === 'X' : value;
} catch (e) {
Log.warning("Could not access localStorage while accessing '" + key + "' (value: '" + value + "', are cookies disabled?): " + e.message);
}
};
}
|
javascript
|
function(key, type, callback) {
return function(value) {
try {
if ( value != null || type === 'string' ) {
if (value) {
localStorage.setItem(key, type === 'boolean' ? 'X' : value);
} else {
localStorage.removeItem(key);
}
callback(value);
}
value = localStorage.getItem(key);
return type === 'boolean' ? value === 'X' : value;
} catch (e) {
Log.warning("Could not access localStorage while accessing '" + key + "' (value: '" + value + "', are cookies disabled?): " + e.message);
}
};
}
|
[
"function",
"(",
"key",
",",
"type",
",",
"callback",
")",
"{",
"return",
"function",
"(",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"value",
"!=",
"null",
"||",
"type",
"===",
"'string'",
")",
"{",
"if",
"(",
"value",
")",
"{",
"localStorage",
".",
"setItem",
"(",
"key",
",",
"type",
"===",
"'boolean'",
"?",
"'X'",
":",
"value",
")",
";",
"}",
"else",
"{",
"localStorage",
".",
"removeItem",
"(",
"key",
")",
";",
"}",
"callback",
"(",
"value",
")",
";",
"}",
"value",
"=",
"localStorage",
".",
"getItem",
"(",
"key",
")",
";",
"return",
"type",
"===",
"'boolean'",
"?",
"value",
"===",
"'X'",
":",
"value",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"Log",
".",
"warning",
"(",
"\"Could not access localStorage while accessing '\"",
"+",
"key",
"+",
"\"' (value: '\"",
"+",
"value",
"+",
"\"', are cookies disabled?): \"",
"+",
"e",
".",
"message",
")",
";",
"}",
"}",
";",
"}"
] |
Reads the value for the given key from the localStorage or writes a new value to it.
|
[
"Reads",
"the",
"value",
"for",
"the",
"given",
"key",
"from",
"the",
"localStorage",
"or",
"writes",
"a",
"new",
"value",
"to",
"it",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/jquery.sap.global.js#L563-L580
|
train
|
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/service/ControllerExtension.js
|
function(sCodeRef, sViewId) {
var oFlexSettings = oRta.getFlexSettings();
if (!oFlexSettings.developerMode) {
throw DtUtil.createError("service.ControllerExtension#add", "code extensions can only be created in developer mode", "sap.ui.rta");
}
if (!sCodeRef) {
throw DtUtil.createError("service.ControllerExtension#add", "can't create controller extension without codeRef", "sap.ui.rta");
}
if (!sCodeRef.endsWith(".js")) {
throw DtUtil.createError("service.ControllerExtension#add", "codeRef has to end with 'js'");
}
var oFlexController = oRta._getFlexController();
var oView = sap.ui.getCore().byId(sViewId);
var oAppComponent = FlexUtils.getAppComponentForControl(oView);
var sControllerName = oView.getControllerName && oView.getControllerName() || oView.getController() && oView.getController().getMetadata().getName();
var oChangeSpecificData = {
content: {
codeRef: sCodeRef
},
selector: {
controllerName: sControllerName
},
changeType: "codeExt",
namespace: oFlexSettings.namespace,
developerMode: oFlexSettings.developerMode,
scenario: oFlexSettings.scenario
};
var oPreparedChange = oFlexController.createBaseChange(oChangeSpecificData, oAppComponent);
oFlexController.addPreparedChange(oPreparedChange, oAppComponent);
return oPreparedChange.getDefinition();
}
|
javascript
|
function(sCodeRef, sViewId) {
var oFlexSettings = oRta.getFlexSettings();
if (!oFlexSettings.developerMode) {
throw DtUtil.createError("service.ControllerExtension#add", "code extensions can only be created in developer mode", "sap.ui.rta");
}
if (!sCodeRef) {
throw DtUtil.createError("service.ControllerExtension#add", "can't create controller extension without codeRef", "sap.ui.rta");
}
if (!sCodeRef.endsWith(".js")) {
throw DtUtil.createError("service.ControllerExtension#add", "codeRef has to end with 'js'");
}
var oFlexController = oRta._getFlexController();
var oView = sap.ui.getCore().byId(sViewId);
var oAppComponent = FlexUtils.getAppComponentForControl(oView);
var sControllerName = oView.getControllerName && oView.getControllerName() || oView.getController() && oView.getController().getMetadata().getName();
var oChangeSpecificData = {
content: {
codeRef: sCodeRef
},
selector: {
controllerName: sControllerName
},
changeType: "codeExt",
namespace: oFlexSettings.namespace,
developerMode: oFlexSettings.developerMode,
scenario: oFlexSettings.scenario
};
var oPreparedChange = oFlexController.createBaseChange(oChangeSpecificData, oAppComponent);
oFlexController.addPreparedChange(oPreparedChange, oAppComponent);
return oPreparedChange.getDefinition();
}
|
[
"function",
"(",
"sCodeRef",
",",
"sViewId",
")",
"{",
"var",
"oFlexSettings",
"=",
"oRta",
".",
"getFlexSettings",
"(",
")",
";",
"if",
"(",
"!",
"oFlexSettings",
".",
"developerMode",
")",
"{",
"throw",
"DtUtil",
".",
"createError",
"(",
"\"service.ControllerExtension#add\"",
",",
"\"code extensions can only be created in developer mode\"",
",",
"\"sap.ui.rta\"",
")",
";",
"}",
"if",
"(",
"!",
"sCodeRef",
")",
"{",
"throw",
"DtUtil",
".",
"createError",
"(",
"\"service.ControllerExtension#add\"",
",",
"\"can't create controller extension without codeRef\"",
",",
"\"sap.ui.rta\"",
")",
";",
"}",
"if",
"(",
"!",
"sCodeRef",
".",
"endsWith",
"(",
"\".js\"",
")",
")",
"{",
"throw",
"DtUtil",
".",
"createError",
"(",
"\"service.ControllerExtension#add\"",
",",
"\"codeRef has to end with 'js'\"",
")",
";",
"}",
"var",
"oFlexController",
"=",
"oRta",
".",
"_getFlexController",
"(",
")",
";",
"var",
"oView",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"byId",
"(",
"sViewId",
")",
";",
"var",
"oAppComponent",
"=",
"FlexUtils",
".",
"getAppComponentForControl",
"(",
"oView",
")",
";",
"var",
"sControllerName",
"=",
"oView",
".",
"getControllerName",
"&&",
"oView",
".",
"getControllerName",
"(",
")",
"||",
"oView",
".",
"getController",
"(",
")",
"&&",
"oView",
".",
"getController",
"(",
")",
".",
"getMetadata",
"(",
")",
".",
"getName",
"(",
")",
";",
"var",
"oChangeSpecificData",
"=",
"{",
"content",
":",
"{",
"codeRef",
":",
"sCodeRef",
"}",
",",
"selector",
":",
"{",
"controllerName",
":",
"sControllerName",
"}",
",",
"changeType",
":",
"\"codeExt\"",
",",
"namespace",
":",
"oFlexSettings",
".",
"namespace",
",",
"developerMode",
":",
"oFlexSettings",
".",
"developerMode",
",",
"scenario",
":",
"oFlexSettings",
".",
"scenario",
"}",
";",
"var",
"oPreparedChange",
"=",
"oFlexController",
".",
"createBaseChange",
"(",
"oChangeSpecificData",
",",
"oAppComponent",
")",
";",
"oFlexController",
".",
"addPreparedChange",
"(",
"oPreparedChange",
",",
"oAppComponent",
")",
";",
"return",
"oPreparedChange",
".",
"getDefinition",
"(",
")",
";",
"}"
] |
Creates a change that adds an extension to the controller associated with the given view.
Throws an error if the information is not complete.
As of now, this only creates the change with a reference to a file. The consumer has to take care of creating that file
and adding it to the backend.
@method sap.ui.rta.service.ControllerExtension.add
@param {object} sCodeRef Name of the file, without path, with the extension '.js'. Must comply to UI5 module naming convention.
Has to be unique and must not conflict with other already defined modules.
@param {string} sViewId ID of the view whose controller should be extended
@return {object} Returns the definition of the newly created change
@public
|
[
"Creates",
"a",
"change",
"that",
"adds",
"an",
"extension",
"to",
"the",
"controller",
"associated",
"with",
"the",
"given",
"view",
".",
"Throws",
"an",
"error",
"if",
"the",
"information",
"is",
"not",
"complete",
".",
"As",
"of",
"now",
"this",
"only",
"creates",
"the",
"change",
"with",
"a",
"reference",
"to",
"a",
"file",
".",
"The",
"consumer",
"has",
"to",
"take",
"care",
"of",
"creating",
"that",
"file",
"and",
"adding",
"it",
"to",
"the",
"backend",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/service/ControllerExtension.js#L69-L104
|
train
|
|
SAP/openui5
|
src/sap.ui.rta/src/sap/ui/rta/service/ControllerExtension.js
|
function(sViewId) {
var oViewOverlay = OverlayRegistry.getOverlay(sViewId);
if (!oViewOverlay) {
throw DtUtil.createError("service.ControllerExtension#getTemplate", "no overlay found for the given view ID", "sap.ui.rta");
}
var sControllerExtensionTemplatePath = oViewOverlay.getDesignTimeMetadata().getControllerExtensionTemplate();
return makeAjaxCall(sControllerExtensionTemplatePath + "-dbg")
.catch(function() {
return makeAjaxCall(sControllerExtensionTemplatePath);
});
}
|
javascript
|
function(sViewId) {
var oViewOverlay = OverlayRegistry.getOverlay(sViewId);
if (!oViewOverlay) {
throw DtUtil.createError("service.ControllerExtension#getTemplate", "no overlay found for the given view ID", "sap.ui.rta");
}
var sControllerExtensionTemplatePath = oViewOverlay.getDesignTimeMetadata().getControllerExtensionTemplate();
return makeAjaxCall(sControllerExtensionTemplatePath + "-dbg")
.catch(function() {
return makeAjaxCall(sControllerExtensionTemplatePath);
});
}
|
[
"function",
"(",
"sViewId",
")",
"{",
"var",
"oViewOverlay",
"=",
"OverlayRegistry",
".",
"getOverlay",
"(",
"sViewId",
")",
";",
"if",
"(",
"!",
"oViewOverlay",
")",
"{",
"throw",
"DtUtil",
".",
"createError",
"(",
"\"service.ControllerExtension#getTemplate\"",
",",
"\"no overlay found for the given view ID\"",
",",
"\"sap.ui.rta\"",
")",
";",
"}",
"var",
"sControllerExtensionTemplatePath",
"=",
"oViewOverlay",
".",
"getDesignTimeMetadata",
"(",
")",
".",
"getControllerExtensionTemplate",
"(",
")",
";",
"return",
"makeAjaxCall",
"(",
"sControllerExtensionTemplatePath",
"+",
"\"-dbg\"",
")",
".",
"catch",
"(",
"function",
"(",
")",
"{",
"return",
"makeAjaxCall",
"(",
"sControllerExtensionTemplatePath",
")",
";",
"}",
")",
";",
"}"
] |
Gets the Controller Extension template from the DesignTimeMetadata of the given view and returns it as a string wrapped in a promise.
If there is no template specified, a default template will be returned.
@method sap.ui.rta.service.ControllerExtension.getTemplate
@param {string} sViewId ID of the view whose template should be retrieved
@return {Promise} Returns a promise that resolves with the template as string or rejects when the file was not found
@public
|
[
"Gets",
"the",
"Controller",
"Extension",
"template",
"from",
"the",
"DesignTimeMetadata",
"of",
"the",
"given",
"view",
"and",
"returns",
"it",
"as",
"a",
"string",
"wrapped",
"in",
"a",
"promise",
".",
"If",
"there",
"is",
"no",
"template",
"specified",
"a",
"default",
"template",
"will",
"be",
"returned",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/service/ControllerExtension.js#L115-L126
|
train
|
|
SAP/openui5
|
src/sap.ui.core/src/sap/ui/dom/jquery/Focusable.js
|
findFocusableDomRef
|
function findFocusableDomRef(oContainer, bForward) {
var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
oFocusableDescendant;
while (oChild) {
if ( oChild.nodeType == 1 && !isHidden(oChild) ) {
if ( jQuery(oChild).hasTabIndex() ) {
return oChild;
}
oFocusableDescendant = findFocusableDomRef(oChild, bForward);
if (oFocusableDescendant) {
return oFocusableDescendant;
}
}
oChild = bForward ? oChild.nextSibling : oChild.previousSibling;
}
return null;
}
|
javascript
|
function findFocusableDomRef(oContainer, bForward) {
var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
oFocusableDescendant;
while (oChild) {
if ( oChild.nodeType == 1 && !isHidden(oChild) ) {
if ( jQuery(oChild).hasTabIndex() ) {
return oChild;
}
oFocusableDescendant = findFocusableDomRef(oChild, bForward);
if (oFocusableDescendant) {
return oFocusableDescendant;
}
}
oChild = bForward ? oChild.nextSibling : oChild.previousSibling;
}
return null;
}
|
[
"function",
"findFocusableDomRef",
"(",
"oContainer",
",",
"bForward",
")",
"{",
"var",
"oChild",
"=",
"bForward",
"?",
"oContainer",
".",
"firstChild",
":",
"oContainer",
".",
"lastChild",
",",
"oFocusableDescendant",
";",
"while",
"(",
"oChild",
")",
"{",
"if",
"(",
"oChild",
".",
"nodeType",
"==",
"1",
"&&",
"!",
"isHidden",
"(",
"oChild",
")",
")",
"{",
"if",
"(",
"jQuery",
"(",
"oChild",
")",
".",
"hasTabIndex",
"(",
")",
")",
"{",
"return",
"oChild",
";",
"}",
"oFocusableDescendant",
"=",
"findFocusableDomRef",
"(",
"oChild",
",",
"bForward",
")",
";",
"if",
"(",
"oFocusableDescendant",
")",
"{",
"return",
"oFocusableDescendant",
";",
"}",
"}",
"oChild",
"=",
"bForward",
"?",
"oChild",
".",
"nextSibling",
":",
"oChild",
".",
"previousSibling",
";",
"}",
"return",
"null",
";",
"}"
] |
Searches for a descendant of the given node that is an Element and focusable and visible.
The search is executed 'depth first'.
@param {Node} oContainer Node to search for a focusable descendant
@param {boolean} bForward Whether to search forward (true) or backwards (false)
@returns {Element} Element node that is focusable and visible or null
@private
|
[
"Searches",
"for",
"a",
"descendant",
"of",
"the",
"given",
"node",
"that",
"is",
"an",
"Element",
"and",
"focusable",
"and",
"visible",
"."
] |
8a832fca01cb1cdf8df589788e0c5723e2a33c70
|
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/Focusable.js#L49-L74
|
train
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.