Wrote something about enabling CORS with SAP Gateway on the server-side and disabling SOP with Google Chrome on the client side over at SCN.
Which will give you cross-domain requests and hopefully make you a happy developer.
Tuesday, September 23, 2014
Tuesday, August 26, 2014
Vergleich: BPMN Designer/Modeller (OS X)
Dieser Post begann bereits Mitte 2013 im Rahmen des extensiven Modellierens von Geschäftsprozessen mehrerer Unternehmungen; er wurde aber nie fertig gestellt - ist aber zu schade, um auf der digitalen Müllhalde zu landen. Daher hier as-is in quasi Rohversion.
Oftmals sind die Modeller ja nur das Extra, das mit einer BPMN-Engine mitkommt.
Auf der anderen Seite ist die reine BPMN-Visualisierung eine perfekte Mischung aus formaler Notation, intuitivem Verständnis und visueller Dokumentation.
Sowas wie die Mutter aller BPMN-Editoren: die verschiedenen Editionen von Visual Paradigm, z.B. http://www.visual-paradigm.com/product/bpva/provides/bpmodeling.jsp
Auswahl:
Alltags-Features:
Oftmals sind die Modeller ja nur das Extra, das mit einer BPMN-Engine mitkommt.
Auf der anderen Seite ist die reine BPMN-Visualisierung eine perfekte Mischung aus formaler Notation, intuitivem Verständnis und visueller Dokumentation.
Sowas wie die Mutter aller BPMN-Editoren: die verschiedenen Editionen von Visual Paradigm, z.B. http://www.visual-paradigm.com/product/bpva/provides/bpmodeling.jsp
Auswahl:
- Billfish BPM Studio http://www.billfishsoftware.com/studio.html
- Yaoqiang BPMN Editor http://sourceforge.net/projects/bpmn/
- Aris Express http://www.ariscommunity.com/aris-express/
- (doch nicht betrachtet) Intalio BPMS Designer http://www.intalio.com/bpms/designer
- (doch nicht betrachtet) Bonita Open Solution http://www.bonitasoft.com/products/bonita-open-solution-open-source-bpm
Alltags-Features:
- "stickiness": Elemente müssen in Lane haften bleiben, damit Verschieben der Lane alle Elemente mitnimmt
- assisted modeling: Vorschlag für nächste shape samt Konnektor dorthin
- semantic check: Verbindungen dürfen nur zwischen erlaubten Elementen möglich sein
Yaoqiang BPMN Editor
- speichert in eigenem Format (.bpmn), Export nach PNG möglich
- validate-as-you-model
- awkward: Tastenkombinationen sind mit ctrl/Steuerungs-Taste belegt...
- "Snippets": vorgefertigte Prozessschritte (XOR Gateway - split & Zusammenführung)
Billfish BPM Studio
- Speichert in eigenem Format (.bpa)
- Bedienung der Modellierung gewöhnungsbedürftig, kein Drag'n'Drop: zuerst Notationssymbol wählen, dann auf Modellierungsfläche klicken
- Validierung auf Knopfdruck
- assisted modelling: Klick auf Pfeilsymbol, weiterer Klick öffnet semantisch mögliche Anschlussnotation
- quick modelling (ctrl + N): schmale Prozesse "batch-input"-mäßig erzeugbar
- keine Lanes verschiebbar
- Activities fehlen
Aris Express 2.3
- massive Nacharbeiten für die Installation notwendig: die hosts-Datei (/private/etc/hosts) muss um einen Eintrag für das CDN der Software AG ergänzt werden wie hier beschrieben: http://www.ariscommunity.com/aris-express/installation-faq#pac - Ansonsten startet "Aris Express 2.3.app" bei jedem Aufruf einen erneuten Download aller Programmdateien, was eine Offline-Nutzung des Programms unmöglich macht
- ähnlich wie bei Billfish erfolgt die Modellierung nicht per Drag'n'Drop. Zuerst muss das Symbol ausgewählt, dann auf die Zeichenfläche bewegt und per Klick positioniert werden
- Beschriftungen von Verbindern (hier: "Kanten"), Start- und Endevents sowie Gateways nur über extra Klicks in den Eigenschaften des Symbols möglich. Lästig und zeitraubend.
- Unter Java 1.6.0_33 ist während der Beschriftung eines Objekts kein Text zu erkennen, nur eine dünne Linie erscheint. Sobald die Eingabe mit Enter bestätigt wird, erscheint der Text aber.
Monday, July 7, 2014
Primer on sap.m.table
I've written about the Visual Design Patterns and programming capabilities of UI5's sap.m.table over on SCN.
tl;dr: use .setMode() and attach*-functions to utilize m-tables interaction spectrum.
tl;dr: use .setMode() and attach*-functions to utilize m-tables interaction spectrum.
Sunday, June 8, 2014
working with JSON model dates in UI5
Update 2: Article now also available on SCN.
Update: included binding example.
Let's say you've designed an OData Service that returns an Entity with a Date-/Time-value (Edm.DateTime).
Let's also say that you're consuming the service with SAP UI5, particularly with the JSON Model (sap.ui.model.json.JSONModel).
And to top things off, you're binding that to a DateTime UI control (sap.m.DateTimeInput) to display a nice mobile datepicker.
Then you might have gone through a hell of a time already :)
No, seriously - making those three things play together nicely isn't difficult, but provides some obstacles. John Patterson has written an excellent article explaining the handling of OData DateTime with Gateway and UI5.
What didn't make it into the article was handling Edm.DateTime in the UI5 JSON model explicitly.
So off we go:
First, Gateway's Edm.DateTime are represented in the UI5 JSON Model as Strings à la
Strange?
Me thinks too.
But that's the way it is (with UI5 version 1.20.4 as of this writing at least).
Next, if you're trying to bind this to the DateTimeInput, this will fail - the UI control expects a JavaScript Date object: "Type Error: Expected JavaScript Date Object".
So the JSON model Date strings needs to be converted to a Date object at runtime in order to be usable in UI5 controls.
I've found two ways to do that.
The first extracts the numbers from the string, using them to construct a new Date object.
The second way uses the RegExp object. With its exec Method, all content between the two "/" of the Date string are extracted - the resulting Date(1402166783294) is auto-assigned to RegExp.$1 and subsequently used for a new call.
Both methods work: they result in converting the Gateway-JSON-Model "/Date(1402166783294)/" into its Date object representation, that can then be used for the sap.m.DateInput control.
Let's combine this with the proper DateInput "type" property and UI5's binding and formatting API.
The dateValue property of the UI control is bound to the path "/date" of the JSON model. The value the JSON model injects then gets formatted with one of the above two snippets.
And that's it - a working DatePicker UI control, bound to a JSON model that holds values from a Gateway OData call.
Good karma all around.
Hint: both ways take < 1ms in execution time - so no performance gain possible here, use the possibility of your liking.
A working example can be found on GitHub.
Update: included binding example.
Let's say you've designed an OData Service that returns an Entity with a Date-/Time-value (Edm.DateTime).
Let's also say that you're consuming the service with SAP UI5, particularly with the JSON Model (sap.ui.model.json.JSONModel).
And to top things off, you're binding that to a DateTime UI control (sap.m.DateTimeInput) to display a nice mobile datepicker.
Then you might have gone through a hell of a time already :)
No, seriously - making those three things play together nicely isn't difficult, but provides some obstacles. John Patterson has written an excellent article explaining the handling of OData DateTime with Gateway and UI5.
What didn't make it into the article was handling Edm.DateTime in the UI5 JSON model explicitly.
So off we go:
First, Gateway's Edm.DateTime are represented in the UI5 JSON Model as Strings à la
/Date(1402166783294)/This seems to represent a JavaScript timestamp object.
Strange?
Me thinks too.
But that's the way it is (with UI5 version 1.20.4 as of this writing at least).
Next, if you're trying to bind this to the DateTimeInput, this will fail - the UI control expects a JavaScript Date object: "Type Error: Expected JavaScript Date Object".
So the JSON model Date strings needs to be converted to a Date object at runtime in order to be usable in UI5 controls.
I've found two ways to do that.
The first extracts the numbers from the string, using them to construct a new Date object.
// this comes from SAP NW GatewayAttention: JS String.replace method returns a string that can't be used directly to construct a Date object. Multiplying it with 1 causes an implicit type cast to Integer - the latter goes directly into new Date() then.
// and is in the JSON model
var sJsonDate = "/Date(1402166783294)/";
var sNumber = sJsonDate.replace(/[^0-9]+/g,'');
var iNumber = sNumber * 1; //trick seventeen
var oDate = new Date(iNumber);
The second way uses the RegExp object. With its exec Method, all content between the two "/" of the Date string are extracted - the resulting Date(1402166783294) is auto-assigned to RegExp.$1 and subsequently used for a new call.
// this comes from SAP NW GatewayClue here is, that exec returns an Object - Date(1402166783294) resides in RegExp.$1 as an object representation. So with the help of eval(), it can directly be used with "new" for instantiating a Date object.
// and is in the JSON Model
var sJsonDate = "/Date(1402166783294)/";/\/(.+)\//.exec(sJsonDate);
var oDate = eval("new " + RegExp.$1);
Both methods work: they result in converting the Gateway-JSON-Model "/Date(1402166783294)/" into its Date object representation, that can then be used for the sap.m.DateInput control.
var oDateTimeInput1 = new sap.m.DateTimeInput({
dateValue: oDate,
displayFormat: "MMM yyyy",
valueFormat: "yyyy-MM-dd"
});
Let's combine this with the proper DateInput "type" property and UI5's binding and formatting API.
The dateValue property of the UI control is bound to the path "/date" of the JSON model. The value the JSON model injects then gets formatted with one of the above two snippets.
var oData = {
date: sJsonDate
};
var oJsonModel = new sap.ui.model.json.JSONModel();
oJsonModel.setData(oData);
var oDateTimeInput3 = new sap.m.DateTimeInput({
type: sap.m.DateTimeInputType.Date,
displayFormat: "dd - M - yy",
dateValue: {
path: "/date",
formatter: function(sDate) {
if(sDate) {
/\/(.+)\//.exec(sDate);
return eval("new " + RegExp.$1);
// var sNumber = sDate.replace(/[^0-9]+/g,'');
// var iNumber = sNumber * 1; //trick seventeen
// return new Date(iNumber);
}
}
}
});
oDateTimeInput3.setModel(oJsonModel);
date: sJsonDate
};
var oJsonModel = new sap.ui.model.json.JSONModel();
oJsonModel.setData(oData);
var oDateTimeInput3 = new sap.m.DateTimeInput({
type: sap.m.DateTimeInputType.Date,
displayFormat: "dd - M - yy",
dateValue: {
path: "/date",
formatter: function(sDate) {
if(sDate) {
/\/(.+)\//.exec(sDate);
return eval("new " + RegExp.$1);
// var sNumber = sDate.replace(/[^0-9]+/g,'');
// var iNumber = sNumber * 1; //trick seventeen
// return new Date(iNumber);
}
}
}
});
oDateTimeInput3.setModel(oJsonModel);
Good karma all around.
Hint: both ways take < 1ms in execution time - so no performance gain possible here, use the possibility of your liking.
A working example can be found on GitHub.
Friday, January 10, 2014
Apple Magic Mouse in Windows 8.1
Out of the box, pairing the magic mouse via bluetooth with the Windows 8.1 box works.
But scrolling by touch is missing.
So:
But scrolling by touch is missing.
So:
- Download both Mouse Driver Installer and Mouse Utility Setup from http://trackpadmagic.com/magic-mouse/download
- Run the Installer -> atencíon: the installer will download the 303 MB (!) Bootcamp 3.3
- installer automatically extracts the magic mouse driver from the bootcamp exe
- Run the Setup -> will launch a GUI config utility also showing the battery status for the magic mouse
- Pair magic mouse with Windows box via bluetooth (if paired previously, de-pair and re-pair)
Subscribe to:
Posts (Atom)