Skip to content

Instantly share code, notes, and snippets.

View cschuff's full-sized avatar

Christian Schuff cschuff

  • Christian Schuff IT-Consulting
  • Mannheim, Germany
View GitHub Profile
@cschuff
cschuff / XMLViewBindingContexts.xml
Last active December 1, 2017 11:38
This gist shows how to set a binding contexts in SAPUI5 resp. OpenUI5 right from a XMLView.
<!-- see sap.ui.core.XMLTemplateProcessor -->
<Control binding="{
model: 'modelName',
path: '/context/path'
}">
<Control objectBindings="{
model: 'modelName',
path: '/context/path'
}">
@cschuff
cschuff / package.json
Last active June 19, 2018 09:03
Minimal Express.js server for local SAPUI5 development. Proxies framework sources as well as backend services with no project source adjustments! Also works for SAP Web IDE projects. Run with '$ npm start'.
{
"name": "ui5-experts-servergist",
"version": "1.0.0",
"description": "",
"main": "server.js",
"author": {
"name": "Christian Schuff",
"email": "[email protected]",
"url": "http://www.ui5experts.com"
},
@cschuff
cschuff / CLDR.js
Created March 1, 2018 13:25
Accessing SAPUI5 CLDR Resources
// see https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.core.LocaleData.html
// see https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/cldr/de.json
var data = jQuery.sap.loadResource("sap/ui/core/cldr/de.json", {
dataType: "json",
failOnError : false
});
var hourNarrow = data.dateFields["hour-narrow"].displayName;
@cschuff
cschuff / SAPUI5ResourceBundles.js
Created March 1, 2018 13:27
Accessing SAPUI resource bundles
// see https://github.com/SAP/openui5/blob/83705d64d724275eb5bbba6d08bac91829b6a39f/src/sap.ui.core/test/sap/ui/core/qunit/Core.qunit.html
// see https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/messagebundle_de.properties
var sBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.core", "de");
var sText = oBundle.getText("SAPUI5_FRIDAY");
@cschuff
cschuff / ApiQuery
Created January 7, 2021 10:42
mimick nestjsx/crud query params
@ApiQuery({
isArray: true,
name: 'sort',
description: `Adds sort by field ('[field]||[ASC|DESC]'). <a href="https://github.com/nestjsx/crud/wiki/Requests#sort" target="_blank">Docs</a>`,
required: false,
schema: {
type: 'array',
items: {
example: 'createdAt||ASC',
type: 'string',