Including custom blueprint templates - fiware-pegasus

I would like to upload my own blueprint templates, then teploy blueprint instanced based on them. Can FIWARE Pegasus do that? In positive case, could you detail the procedure, please?

You can upload your own blueprint template into the FIWARE template catalogue, by using the Pegasus API (see https://jsapi.apiary.io/apis/fiwarepaas/reference/paasmanager-v1/blueprint-templateenvironment-api.html).
It is a POST request to /catalog/org/{your-organization}/vdc/{your tenant id in the Cloud}/environment with a payload similar to:
Body
<environment>
<name>{environment-name}</name>
<tiers>
<tier>
<initial_number_instances>1</initial_number_instances>
<maximum_number_instances>1</maximum_number_instances>
<minimum_number_instances>1</minimum_number_instances>
<name>{tier-id}</name>
<networkDto>
<networkName>Internet</networkName>
<subNetworkDto>
<subnetName>sub-net-Internet</subnetName>
</subNetworkDto>
</networkDto>
<productReleases>
<product>postgresql</product>
<version>0.0.3</version>
<withArtifact>true</withArtifact>
<productType>
<id>5</id>
<name>Database</name>
</productType>
</productReleases>
</tier>
</tiers>
</environment>

Related

Node-soap with WSDL that imports another WSDL

I have a 2 WSDL files.
WSAPIService.wsdl
WSAPIServiceContract.wsdl
WSAPIService.wsdl references WSAPIServiceContract.wsdl another via an import tag.
<wsdl:import location="WSAPIServiceContract.wsdl" />
I was hoping node-soap would automatically pull in the referenced file, but it doesn't appear to be.
const client = await soap.createClientAsync('WSAPIService.wsdl')
Does anyone have experience with merging wsdl files or using node-soap with a wsdl with imports?
Thanks!
I have already tried:
https://github.com/pkielgithub/SchemaLightener - it failed with Exception: net.sf.saxon.trans.XPathException: Too many nested template or function calls. The stylesheet may be looping.
https://svn.apache.org/repos/asf/webservices/muse/site/docs/2.2.0/manual/tools/wsdlmerge.html This looked helpful but the download links are broken
Any advice would be greatly appreciated!

How to add extensions to Microsoft Edge

I an trying to figure out how to add webRequest extension to Microsoft Edge. Can someone provide some assistance? I have gone though a number of documents, but when I go to Microsoft online store I don't see it there.
Test code:
<html>
<script>
browser.webRequest.onBeforeRequest.addListener(
logURL,
{ urls: ["<all_urls>"] }
);
function logURL(requestDetails) {
console.log("Loading: " + requestDetails.url);
};
</script>
</html>
In the doc of webRequest in MDN, we can see that:
To use the webRequest API for a given host, an extension must have the "webRequest" API permissions and the host permission for that host.
Where can we add the permissions? The answer is the manifest.json file. It is the necessary part of an extension. You could see the Anatomy of an extension to learn the compositions of an extension.
Besides, browser.webRequest isn't in the list of content scripts APIs, so we can only use it in background scripts.
In a conclusion, we can't just use the browser.webRequest in a script of a html file. If we want to test the event browser.webRequest.onBeforeRequest, we need to have a manifest.json file, put permisssions in it:
"permissions": [
"*://learn.microsoft.com/*",
"webRequest"
]
Then put the scripts you gave in the background scripts. Then you could try to debug the extension in Edge, there will be no error. Here is an article about creating a Microsoft Edge extension, you could refer to it if you need.

AzureReader2 with ImageResizer prefix issue

We are using AzureReader2 plugin to read the blob urls and ImageResizer plugin to re-size images on fly.
Our container name is - img
AzureReader2 prefix name is also - img
<add name="AzureReader2" prefix="~/img/" connectionString="DefaultEndpointsProtocol=https;AccountName=my;AccountKey=my endpoint="http://<account>.blob.core.windows.net/" />
So, the image url is looking like below:
http://.blob.core.windows.net/img/img/1GKS2EEF2BR171185/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500
img is repeated twice.
Is there any way to handle this?
Can we use empty prefix with ImageResizer?
Any advise is helpful.
Based on the example URL you've provided, I think you are misunderstanding the process. The cloud architecture page can be helpful here.
Your image URL should not be http://myaccount.blob.core.windows.net/img/img/1GKS2EEF2BR171185/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500
Without a CDN, it should be in the form http://myserverwithimageresizer.com/img/img/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500
Azure's Blob store doesn't know what to do with ?w=500. Your URLs in your HTML pages should never point to blob.core.windows.net; they should point to your server - or, a CDN that points to your server (not the blobstore!).
This question is old but nonetheless as Nathanael's answer says the image URL should be:
http://myserverwithimageresizer.com/img/img/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500
Or for example if you are running locally :
http://localhost:<PORT>/img/img/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?width=200
To use image resizer you should point to your website then set the reference to blob storage in your web.config file. If it directly access blob storage the image won't have a chance to be resized.
To set the prefix to nothing in web config put the following:
<add name="AzureReader2" prefix="~/" connectionString="DefaultEndpointsProtocol=https;AccountName=my;AccountKey=my endpoint="http://<account>.blob.core.windows.net/" />
By default the prefix is "~/azure" to set it to nothing it should be "~/"
This should make it so if you navigate to
http://myserverwithimageresizer.com/img/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500 that your image is retrieved from blob storage and resized.

Create TYPO3 Fluid link for typolink fields generated by a link wizard

I regularly use the link wizard in my TCA.
Its horrible to find out with conditions which kind of link I have to render in Fluid (page/email/external). Is there a solution for this or do I have to create my own ViewHelper?
It seems to be undocumented, but you can pass it to <f:link.page> and it will be rendered correctly, even if it is external, email, or file link. This is because internally, <f:link.page> uses UriBuilder to build the URL, and that UriBuilder uses Typolink.
<f:link.page pageUid="{myLinkFieldValue}">My link</f:link.page>
This is the ViewHelper i´m using for this (+a helper Class):
https://gist.github.com/BenjaminBeck/7220623
I think the link.typolink ViewHelper is what you are looking for, at least for TYPO3 7.0 and above.
<f:link.typolink parameter="{link}">
Linktext
</f:link.typolink>
See Changelog Feature #59396 - TypolinkViewHelper (TYPO3 7.0)
see link.typolink in ViewHelper Reference
External Link --
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
Email --
<f:link.email additionalAttributes="{foo: 'bar'}" email="NULL" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" name="NULL" rel="NULL" rev="NULL" target="NULL">
<!-- tag content - may be ignored! -->
</f:link.email>
Internal Link --
<f:link.page pageUid="1" additionalParams="{extension_key: {foo: 'bar'}}">page link</f:link.page>
In Fluid, there are different link view helpers:
<f:link.action action="show">action link</f:link.action>
<f:link.email email="foo#bar.tld" />
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
<f:link.page>page link</f:link.page>
The Code (and some examples) can be found at: typo3/sysext/fluid/Classes/ViewHelpers/Link

monodroid: how to create receiver/meta-data clause in manisfest.xml

I note the the mono android port of the SDK API Demos does not include the DeviceAdministration pieces.
Is this because it (DeviceAdmin) doesnt work? I have tried to make a small sample app and have not succeeded.
EDIT: Well I got a fair way in, now my problem is that I cannot generate the receiver/meta-data clause
I am on my way to writing my own aapt.exe to intercept the xml file on its way through this seems like a lot of heavy lifting
You can use the [BroadcastReceiverAttribute] custom attribute to generate the <receiver/> element, and you can use the [MetaDataAttribute] custom attribute to generate the <meta-data/> element:
[BroadcastReceiver]
[MetaData ("foo", Value="bar")]
public class MyReceiver : BroadcastReceiver {
}
Would generate the XML fragment within AndroidManifest:
<receiver android:name="generated-by-mandroid">
<meta-data android:name="foo" android:value="bar" />
</receiver>

Resources