How to use a library on SAPWebIDE - sapui5

i am trying to use the openui5-googlemaps library, but the WebIDE looks at a different path than my SAP-System then the app is deployed.
libs: ["sap.m", "sap.ui.layout", "sap.ushell", "openui5.googlemaps"],
my SAP-System looks at path resources/openui5/googlemaps.
However this does not work in the WebIDE.
Any ideas why and how i can fix it?
Thanks

Either change the path, or load via your index.
API With Example
In Index
~ update may 2017 ~
You can now use the manifest to add libraries:
"resources": {
"css": [
{
"uri": "css/style.css"
},
{
"uri": "css/croppie.css"
}
],
"js": [
{
"uri": "library/croppie.min.js"
}
]

Related

SAPUI5 - HTML5 Application - Use function in manifest.json

I have this really basic SAPUI5 application created from the template available in SAP Business Application Studio.
I have defined a custom resource in the manifest.json which executes a javascript function:
{
"sap.ui5": {
"resources": {
"js": [
{
"uri": "lib/myFunction.js"
}
],
"css": [
{
"uri": "css/style.css"
}
]
}
},
"...": "..."
}
Is there a way to dynamically define the resource to be used in the application bootstrap?
For example, in my "lib" folder, I have different *.js files:
Is there a way to choose a single *.js to be used?

How to add configurations to user to a VSCode extension

I am trying to add a simple configuration to my VSCode extension, but I can't find the correct information.
I just want that the user have a string input field, that has a default value, and read it from my typescript code through the vscode library
Can someone provide me and example about which file should I add, where, and how to consume? also if more configurations are needed.
Thanks!
Ok, found
I need to add into my package.json
...
"contributes": {
"commands": [
...
],
"configuration": {
"title": "My Extension",
"properties": {
"myExtension.myProperty": {
"type": "string",
"default": "default",
"description": "description"
}
}
}
},
and consume
vscode.workspace.getConfiguration('myExtension').myProperty;

Writing a vscode plugin for adding snippets but only for file composer.json

Did you know if it's possible to write a vscode plugin to match only a given file?
My plugin already works but add snippets for all .json files. I wish to be able to add these snippets only if the current file is composer.json.
My current package.json (partial) is:
{
"contributes": {
"snippets": [
{
"language": "json",
"path": "./snippets/snippets.code-snippets"
}
]
}
}
The idea is to be able to having something like:
{
"contributes": {
"snippets": [
{
"filename": "composer.json", <-- JUST FOR ILLUSTRATION PURPOSE
"path": "./snippets/snippets.code-snippets"
}
]
}
}
Thanks.

Drawing an image from a cloudformation template

Is the any drawing / export tool that I can use to turn a cloudformation template into a diagram.
In need to export my cloudformation stack into an image, or a graphviz file.
Regards,
You can use the latest version of the cfn-lint tool to get a graph of resources from your template.
Use it like this:
pip3 install cfn-lint pydot
cfn-lint template.json -g
For example, it will generate a DOT file that renders like this:
Which corresponds to this template:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample template that demonstrates Fn::GetAtt",
"Resources": {
"DetectTextInImage": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Role": {
"Fn::GetAtt": [
"DetectTextInImageRole",
"Arn"
]
}
}
},
"DetectTextInImageBucketEvent1Permission": {
"Type": "AWS::Lambda::Permission",
"Properties": {}
},
"DetectTextInImageRole": {
"Type": "AWS::IAM::Role",
"Properties": {}
},
"ResultsTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {}
},
"SourceImageBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"NotificationConfiguration": {
"LambdaConfigurations": [
{
"Function": {
"Fn::GetAtt": [
"DetectTextInImage",
"Arn"
]
}
}
]
}
}
}
}
}
The CloudFormation Linter Visual Studio Code extension also has a resource dependency graph preview button in the top right while editing CloudFormation templates:
You can use the AWS CloudFormation designer. Click on Open, then upload your template. Finally take a screenshot of the result to have it in an image format.
Here's an exemple of what the result might look like:
For more information, have a look at the doc.

Compiling Reason source files to the same directory as the source files

I'm writing a node application, where I would like to mix Reason and raw JavaScript.
This section in the bucklescript documentation describes it
When user has an existing JS project, it makes sense to output the JS
file in the same directory as vanilla JS, the schema added a key
called in-source so that generate JS file next to ML file.
I assume that this is in the bsconfig.json file? But what value should the key have? The schema documentation does not mention this option.
I'm running Bucklescript version 1.9.1 - so the functionality should be available (available since 1.9.0).
How do I use the in-source option?
My bsconfig.json file looks like this:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"in-source": true, // I tried adding the key here
"sources": [{
"dir": "src",
"in-source": true // I tried adding the key here
}
],
"bs-dependencies" : [
"bs-express"
]
}
It should be in the "package-specs" section:
{
...
"package-specs" : [{
"module": ...,
"in-source": true
}]
}
So your bsconfig.json should look like:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"package-specs" : [{
"module": "commonjs",
"in-source": true
}],
"sources": [{
"dir": "src"
}
],
"bs-dependencies" : [
"bs-express"
]
}