How can I import CDAP Pipeline other than the UI? - pipeline

Is there a way to import pipelines using CDAP CLI?
I am interested in automated pipeline deployment.

You can import pipeline using CDAP REST API.
PUT /v3/namespaces/<namespace>/apps/<pipeline name>
The body of the request should be the pipeline JSON that you have exported.

Related

How do I import SDK between SDK 8 and 9 in FCM firebase-messaging-sw.js service worker?

The Firebase docs provide several ways to import SDK in service worker, which confused me. Here are the methods I discovered in the documentation:
https://firebase.google.com/docs/cloud-messaging/js/receive#web-version-9
import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
I can't utilize the method since I can't process my service worker because my project still uses webpack version 1. So I'm going to concentrate on the 'importScripts' techniques I discovered.
https://firebase.google.com/docs/cloud-messaging/js/receive#web-version-8
importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js');
This is a working approach that I've tested; nevertheless, I have some questions about it:
Is it okay to use this gstatic domain in production?
This official SDK differs from the quickstart-js that they gave.
https://github.com/firebase/quickstart-js/blob/master/messaging/firebase-messaging-sw.js
importScripts('/__/firebase/9.2.0/firebase-app-compat.js');
importScripts('/__/firebase/9.2.0/firebase-messaging-compat.js');
importScripts('/__/firebase/init.js');
This is from the official example quickstart-js, however I still have a lot of questions about it:
It appears that they automatically updated the sample SDK, but the current version of Firebase is 9.6.1, not 9.2.0; should I remain with 9.2.0?
This approach only works in projects hosted by Firebase, and I can't find the init.js file matching to gstatic at the third line; is there a way to directly access that file?
Which approach should I utilize?
And I'm currently using Firebase 9.6.1 outside of my service worker; would utilizing Version 8 within my service worker cause any issues?
I think I'll stick to this:
importScripts('https://www.gstatic.com/firebasejs/9.6.1/firebase-app-compat.js')
importScripts(
'https://www.gstatic.com/firebasejs/9.6.1/firebase-messaging-compat.js'
)

Is there a way to import or load libraries in service worker?

I am writing a service worker for my app which, in 'activate' state reads and writes to IndexedDB. For reading or writing in IndexedDB, I use a library called 'idb'(https://unpkg.com/idb?module). Is there ant possible way to import libraries in service workers. Also, the library use ES6 imports and exports, will that be a problem?
To import scripts/libraries in service workers I had to use importScripts() rather than fetch() and that did the trick. Also, the imported library gets added to the ServiceWorkerGlobalScope, meaning I had to use this.<library-name> to access the library.
Also, the ServiceWorkerGlobalScope doesn't have support for ES6 import/export, that's why I needed to build the package with npm build and then use it.
importScripts('index-min.js');
this.idb();

Firebase JS SDK warning while load application in browser (angular v5)

When application load in browser, it gives following warning. So unable to create build for prod (ng build --aot --prod)
It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):
CommonJS Modules:
const firebase = require('firebase/app');
require('firebase/<PACKAGE>');
ES Modules:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
I am using following configurations
Angular CLI: 1.5.0
Node: 9.8.0
Angular: 5.1.3
"firebase": "^5.0.4",
"angularfire2": "^5.0.0-rc.10"
Please guide where I get wrong.
There is nothing really wrong, it is more a warning and a best practices tip.
Firebase is composed of different services/modules, e.g. the Real Time Database, Firestore, the Auth service, etc.
In the majority of projects one does not use ALL those services and therefore this warning indicates that instead of importing all the services with one global import it is better to only import the services you really need in your application. In such a way, your build will be optimized: the resulting build file(s) will only contain the Firebase SDK code that you need and will not contain the parts that are not used.
See this documentation item: https://firebase.google.com/docs/web/setup and in particular the part that says:
If you are using a bundler like Browserify or webpack, you can just
require() the components that you use.
Update following your comment:
With the import keyword, you should do as follows:
import messaging from 'firebase/messaging';
You did not share your Angular component code that's why I could not give you specific code. However, I guess, you include Firebase directly like this then it will show following warning.
import * as firebase from 'firebase'; // It will throw warning
import * as firebase from 'firebase/app'; // It will not throw any warning
Then include specific package acccording to your need.
import 'firebase/firestore';
import 'firebase/database';
import 'firebase/auth';
I add following code, it works for me
require("firebase/messaging");

Bulk import tool for alfresco

I want to integrate the functionnality of Bulk import tool into my Java code Client CMIS using openCMIS library, is there any way to do so ? The goal is to do an import to alfresco automatically and without using the bulk import tool UI I found this code :
Streaming
UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
AuthenticationUtil.setRunAsUser('admin');
StreamingNodeImporterFactory streamingNodeImporterFactory = (StreamingNodeImporterFactory)ctx.getBean('streamingNodeImporterFactory');
NodeImporter nodeImporter = streamingNodeImporterFactory.getNodeImporter(new File('importdirectory'));
BulkImportParameters bulkImportParameters = new BulkImportParameters();
bulkImportParameters.setTarget(folderNode);
bulkImportParameters.setReplaceExisting(true);
bulkImportParameters.setBatchSize(40);
bulkImportParameters.setNumThreads(4);
bulkImporter.bulkImport(bulkImportParameters, nodeImporter);
txn.commit();
But I didn't found any library that provides classes implemented in this code, so I can use them in my code.
If someone please can help me. Thanks a lot.
The code you are showing that invokes the Bulk File System Import Tool is running in the same process as Alfresco. It leverages the foundational Java API to make all of the calls.
You are asking about a client based on OpenCMIS. CMIS is a standard for working with all kinds of repositories. There is nothing in the spec or in the OpenCMIS implementation that knows anything about the Alfresco-specific Bulk File System Import Tool. Therefore, you cannot initiate a BFSIT import via CMIS.
To do imports, you can use the BFSIT or you can use CMIS, but combining the two does not make much sense.

Firebase 2 core module failing to import (web)

I'm trying to import the core module from firebase but it looks like something is wrong with what I''m doing. Currently I'm importing it as:
import firebase from 'firebase'
With this in my app I do not get the app interface, however, if I do:
import firebase from 'firebase/app'
It does work but I'm missing all the other modules as the database modules, I could by pass it just by adding a couple more of imports but I'd like to import the full app since it's a simpler implementation
Thanks for the help!
Try with:
import firebase from 'firebase/firebase-browser'

Resources