Youtube video XML url : Part 5- So open youtube.com and open a play list
Search a channel on youtube and open it. You will find a playlist tab . Open that tab and it will display playlist. Click on any play list and you will see url of play list
We will get Title , thumnail url and video id from this xml feed to display list of all videos. To achieve this goal we need to parse xml and get data.
Process To Get Data From Youtube – If you will see youtube video.xml url, there are many xml node. We need only all video id , thumbnail url to display image and Title to show on top of Card
XML display data different way than Json. So first we parse xml data and use text to get its value.
First install xmldom so run command
npm install -S xmldom
So after last import line, after a line line break add parse function which will help to parse data of xml
const DOMParser = require(‘xmldom’).DOMParser;
before component start. For example
…..
const DOMParser = require(‘xmldom’).DOMParser;
class VideoList extends Component {
………
First you need to understand few things before we start coding. In this process I am going to use ComponentWillMount, fetch, and state
componentWillMount: this is a lifecycle method . It invoke immediately before mounting occurs.
Fetch: Fetch Networking api used in react native to get content from arbitrary URL
Now in our next process we will use componentWillMount before render function and so
So in VideoList.js remove condole.log(this.props.playlistid); and start writing componentWillMount()
componentWillMount should be called before render() function of component
But before componentWillMount function we will define a state video as array. Because after fetch were are going to get data in array so open VideoList.js and add before render() function
state = { videos: [], }
componentWillMount() {
const playerid = this.props.playlistid; /* to get playlist id value*/
/* now we will run console.log to check if data coming after fetch */
.then(DataText => console.log(DataText));
}
Now refresh simulator and you will see xml data in condole.
But this data is not in array and it is not useful for us to setState with array. As you can see we are getting whole xml as it is. To process our video listing we need a array of Title, Image and Video id. To process this we will process to parse data using a helper function . so create a function called getXMLData
So in componentWillMount function add a new function
componentWillMount() {
const getXMLData = (listdata) => {
}
……
No we will expand our function getXMLData. In this function i have passed a parameter which is used to get data which we get from fetch and parse it
So
const getXMLData = (listdata) => {
const parseData = new DOMParser().parseFromString(listdata, ‘text/xml’);
In above function you can see we have passed our listdata paramer in parseFromString and then we are getting title, video id and Thumbnail by tag name of xml. But is is not enough because we need a series of array in which we can get all values in one array
So I created a variable with name finallArray as array then using for function I have adding each values in finalArray using push function
Push: This method help to add new item in array
Now our function returning array of all items which we need in one array. Now we will call this function to setState of Video array state. It may be little confusing but no need to worry much about it . I will show you further process
Now go to this line of componentWillMount function
.then(DataText => console.log(DataText));
And now remove console.log(DataText) and replace with
When installation is complete. Please open root file index.js and we will create Screen and use it . Here i am going to use react-navigation to import StackNavigator so you can easily understand how navigator work in react native
To define screen we will use index.js and in that file we will define YoutubeVideo component to load first. We have added YoutubeVideo in App.js and already imported on index.js on root
So first import stack navigator in index.js on top. So after this line
import { AppRegistry } from ‘react-native’;
add
import { StackNavigator, } from ‘react-navigation’;
Note: “if you are getting 500 error after installation of React Navigation, Please delete it and re-install by npm command. To delete please use command npm uninstall –save react-navigation”
Calling Screens In Stack Navigator- Here one need to notice. When we use navigation we should call all component through navigator props. If you will include direct then props from one component to another component will not go and we get error when navigate.
So before video play we will change all component call using navigate function . Here is further process
So first import all component pages in index.js
import ViewVideo from ‘./src/components/ViewVideo’;
import VideoList from ‘./src/components/VideoList’;
import Index from ‘./src/components/Index’;
Then define screen for all components
YoutubeVideo: {
screen: YoutubeVideo
},
Index: {
screen: Index
},
VideoList: {
screen: VideoList
}
Now our index.js page code should look like this
import React from ‘react’;
import { StackNavigator, } from ‘react-navigation’;
import { AppRegistry } from ‘react-native’;
import YoutubeVideo from ‘./App’;
import VideoList from ‘./src/components/VideoList’;
so now our all screen are added in Stack Navigator function. Now we call any screen to load by using navigation props anywhere without import. Now in next post i will show you how we can call any page instead of import
Steps to upgrade Online CRM to Dynamics 365 – Microsoft Dynamics 365 CRM out into the market and to use new features like field services etc, you have to upgrade online CRM to 365. Upgrading online CRM is very confusing as users have not full control over instance and have fear to lose data or customizations. To give Dynamics CRM upgrade a clear view you can refer this article.
Step1: Setup Sandbox instance of your Online CRM.
Dynamics CRM Sandbox account is useful for development and to test customizations before publishing on a production instance. It’s also useful for upgrade process from lower version to upper version.
Sandbox instance as can be purchased as add-on subscription or with 25 user’s subscription licenses. To setup, sandbox instance using production instance, select production instance and click on copy icon.
It takes to Copy instance window.
The properties you need to care about are:
Target Instance: In the current case, it will be production instance.
Copy Type: Recommended type is a Minimal copy.
Name: should be the name of Sandbox instance.
And click on Copy. It will take a while to update sandbox account copy of production.
Step 2: Test upgrade of sandbox instance
When a copy of production as sandbox instance, is ready to test CRM instance upgrade process using sandbox CRM instance.
One thing you need to know that is when production instance is ready for an upgrade, to let that know go to Admin Center > Dynamics CRM.
Instances that are eligible to update will see Update is Available. You can see along with your CRM instance.
Select updates tab and schedule upgrade for sandbox instance.
The process you have to follow for a lower version to upper version upgrade is:
To Upgrade
Dynamics Online CRM To Dynamics Online CRM Update 1
Dynamics Online CRM Update 1 To Dynamics 365 CRM
After scheduling dynamics CRM upgrade process, it will be updated on your scheduled time. It might be possible, current customizations are not supported by updated version. Upgrade process gets failed. So you have to reset sandbox back to old version and fix all those issues in sandbox instance and again follow the same process of schedule sandbox instance upgrade to the target version.
Step 3: Upgrade Production Instance
Once your sandbox instance is upgraded, approve upgrade. Same process you need to follow to upgrade production instance upgrade. Also, keep in mind your instance upgrade will not be upgraded till you approve upgrades.
Adding Content Templates to Editor in Kentico 9 – It’s handy to adding site typography as content templates in Kentico CKeditor. Follow steps given below to add and customize CKeditor toolbar and include new content templates.
Step1: Download sample content template from http://ckeditor.com/addon/templates. Extract downloaded zip folder and copy template folder in \CMS\CMSAdminControls\CKeditor\plugins. It should look like example image.
Step 2: Adding config properties – Open config.js file under CKeditor folder and add these lines on top of file along with other properties-
config.extraPlugins = ‘templates’;
/* CMS */
config.plugins += ‘,showborders’;
/* Templates */
config.plugins += ‘,templates’;
It should be like image example.
Step3: Customize toolbar : Add template after source in toolbar_FULL
Step4: Setup toolbar_Full, At bottom of config file change value –
config.toolbar = config.toolbar_Full;
Now ckeditor is ready to use templates and can do testing after login in CMSDesk. Open editable page. Ckeditor should show template icon along with source.
After clicking in template icon, it will show all available content templates. You can select any of these templates and insert in editable part and modify accordingly. You don’t need to be worried about styling content text. It helps non technical person to make pages and style it easily.
Next part is, how to add new templates in editor. Open default.js file under CKeditor/plugins/templates/templates/default.js
Default.js already has some inbuilt templates, you can add more templates using same structure. Using example I added youtube responsive videotemplate at bottom of default.js file.
{
title: ‘Responsive YouTube Video (with controls)’,
//image: ‘template1.gif’,
description: ‘Responsive YouTube Video (with controls)’,
Connection from PHP to Microsoft Dynamics CRMThis time we will learn how to connect Microsoft dynamics CRM using PHP code. Microsoft dynamics CRM soap service can be a way to make calls from PHP source code. A valid soap header is required to execute soap request. Let’s see how to create a valid header using PHP code:
To get valid soap request, first need to create token1, token2, and keyIdentifer which can be created using online user name and password.
Soap enavlop for getting token1, token2, ekyidentifer:
Install Magento 2 – beginner’s guide – Before continuing, make sure you have all the prerequisites, required for running Magento 2, below are system requirements
System requirements: 1. Apache Version: 2.2 or 2.4 2. PHP version: 5.5.x, where x is 22 or greater 3. MySQL Version : 5.6.x and upper
Installation 1. First and easiest way is to download the Magento installation package from official Magento site https://www.magentocommerce.com/download (Install from archive file – In this installation Magento core code is stored under /vendor directory and updating is possible through Magento admin.)
See below screenshot
2. Create one folder and Unzip in and put it under C:\xampp\htdocs\FOLDER_NAME 3. Create a MySQL Database for Magento2 form phpmyadmin. 4. Go through the Magento installation process, below is the first screen
Click on button Agree and Setup Magento
Click to start Readiness Check button to move forword
If all the requirements are ok then it’ll show tick mark for that, click on Next button
Here add all the fields properly as mentioned, host, Database Username and password, database name, Table prefix, etc
and continue with the next button.
In this step it’ll ask for your store’s admin url.
5. After successful installation you will get this page 6. Your frontend will look like this
Installation of Magento 2 on Ubuntu 16.04 LTS – I am writing this article for absolute beginner with deeper explanation of all steps which are required to install and configure Magento 2.0 on Ubuntu OS. Let’s start: a) Install Apache2, PHP, MySQL Server, composer and required packages for Magento 2.0. Using command:
b) After successfully installation of these packages, make changes in the apache2.conf file and AllowOverrideall for Directory permission.
$ cd /etc/apache
$ Sudo nano apache2.conf
Changes from
Options Indexes FollowSymLinks AllowOverride none Require all granted
To
Options Indexes FollowSymLinks AllowOverride all Require all granted
c) Use ^x (Ctrl + X) to exit from edit file screen. After making change in Config file, you need to restart Apache. Use this command:
$ sudo systemctl restart apache2.service
d) Next step to install Magento 2 in var/www/html document using these commands:
cd /var/ww/html/
git clone https://github.com/magento/magento2.git
cd magento2
composer install
e) You might face problem while installing Composer in Magneto 2 directory, like some of PHP extensions are missing. Don’t be panic in this case and install missing extensions.
After installing all missing PHP extensions, change current directory to Magento 2 and install composer:
$ cd /var/www/html/magento2
$ composer install
f) Following messages come on screen: Loading composer repositories with package information Installing dependencies (including require-dev) from lock file
Login to Login here https://www.magentocommerce.com/ and use public key as Username and private key as Password.
g) Next step is to change directories permission to
$ sudo chmod -R 777 /var/www/html/magento2/
$ sudo chmod -R 777 /var/www/html/magento2/var/
$ sudo chmod -R 777 /var/www/html/magento2/pub/
Now we move to Mysql. To create Mysql database for magento 2 installation.
Use Following command: $ sudo mysql –u root -p Enter Sudo password and now you are ready to execute Sql queries using mysql prompt. Enter the following commands in the order to create a database instance named magento2 with user name magento2 h) Create database magento2; GRANT ALL ON magento.* TO magento2@localhost IDENTIFIED BY ‘magento2’; Database magento2 is created and all permissions are granted to magent2@localhost user with password magento2. To check you can use:
$ sudo mysql –u magento2 -p
Enter password magento2 and use sql query:
Mysql > show database;
Use exit to come out from mysql prompt.
Now you are ready for final step to install magento2.
Open http://localhost/magento2/setup/
If you face any permission issue, grant permission to Magento 2 root directory-
$ sudo chmod -R 777 /var/www/html/magento2/
When you get green check for file permission check, click next till installation finish. You can browse magento 2 using http://localhost/magento2/ or http://{ipaddress}/magento2/
At this stage, we are completed with Magento 2 installation on Ubuntu 16.04 LTS. Hope it helps you!
Grow Your Business With Our Expertise
This site uses cookies. The use of cookies must be permitted for an optimal browsing experience.