{"id":343,"date":"2016-08-14T09:46:00","date_gmt":"2016-08-14T13:46:00","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=343"},"modified":"2016-08-14T09:57:55","modified_gmt":"2016-08-14T13:57:55","slug":"dataflex-for-wordpress","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2016\/08\/14\/dataflex-for-wordpress\/","title":{"rendered":"DataFlex for WordPress"},"content":{"rendered":"<p>This plugin, available from DataAcesss allows you to embed a DataFlex WebApp into a WordPress site. WordPress is a free\u00a0open source content management system.<\/p>\n<p>In order to use this plugin we need a WordPress site. To start we will simply install WordPress on the localhost.<\/p>\n<p>Obviously you will need a computer with IIS installed and running.<\/p>\n<p>Installing WordPress can often be very easy but sometimes a bit of a headache as well.<\/p>\n<p>If all is ok you can use the Microsoft Platform Installer to install WordPress. Simply navigate to the Platform Installer in IIS Management and type WordPress into the search window.<\/p>\n<p>Add WordPress and start the install. This will install all prerequisites required by WordPress such as PHP as well as MySQL.<\/p>\n<p>If you are not so lucky the install fails. There is a common issue with the WordPress platform install where during the install an error is shown that tells you the password for the MySQL server is invalid.<\/p>\n<p>if that happens to you there are several solutions to the problem. From manually installing MySQL and the .NET connector and then rerunning the platform installer to completely manually installing all items.<\/p>\n<p>On my last test for this blog I was forced to install all pieces manually. I installed PHP from the platform installer and downloaded MySQL manually and installed it.<\/p>\n<p>Next step is to create an empty database for wordpress. you can do this from the MySQL command line using the following commands<\/p>\n<pre class=\"lang:default decode:true\">mysql&gt; CREATE DATABASE databasename;\r\nQuery OK, 1 row affected (0.00 sec)\r\n \r\nmysql&gt; GRANT ALL PRIVILEGES ON databasename.* TO \"username\"@\"hostname\"\r\n    -&gt; IDENTIFIED BY \"password\";\r\nQuery OK, 0 rows affected (0.00 sec)\r\n  \r\nmysql&gt; FLUSH PRIVILEGES;\r\nQuery OK, 0 rows affected (0.01 sec)\r\n\r\nmysql&gt; EXIT\r\n<\/pre>\n<p>One a database is created you will need to manually edit your wp-config.php file and set the following entries<\/p>\n<p>DB_NAME, DB_USER, DB_PASSWORD, DB_HOST<\/p>\n<p>and also the Authentication Unique Keys<\/p>\n<p>then download and unzip wordpress into the folder on your web site.<\/p>\n<p>Then navigate in the browser to the wordpress install script<\/p>\n<p>for example<\/p>\n<p>http:\/\/mysite.com\/wp-admin\/install.php<\/p>\n<p>if all is fine the wordpress install will start and finish in a short time.<\/p>\n<p>Now that WordPress is up and running we need to configure it for using DataFlex for WordPress<\/p>\n<p>Start by downloading DataFlex for WordPress\u00a0at http:\/\/www.dataflex4wordpress.com\/index.php\/df4wp-plugin\/<\/p>\n<p>The zip file contains two files. DataFlex4wordpress.zip which is a plugin for wordpress and DF4WPLib.zip which is a library workspace needed to compile your DataFlex WebApp.<\/p>\n<p>In your wordpress Dashboard select Plugins -&gt; Add New<\/p>\n<p>Then click Upload Plugin. Borwse to your DataFlex4wordpress.zip file and click Install Now<\/p>\n<p>if WordPress asks for your FTP credentials your site user does not have rights to write to the wp-content folder. You can either use FTP access or assign proper rights and restart the install of the plugin<\/p>\n<p>Once the plugin is installed click Activate Plugin<\/p>\n<p>At this time you should see a new DataFlex option that was added to your Dashboard menu<\/p>\n<p>We will get back to these settings later after we have ourt\u00a0test application ready.<\/p>\n<p>To get a test application we launch the DataFlex Studio. Remember to launch it as Administrator so it will be able to register your webapp.<\/p>\n<p>Create a new Workspace. I called mine TestWP. Once the workspace is created create a new WebApp project.<\/p>\n<p>We now need to add the DataFlex 4 WP library to this workspace. You can place the library in any location you like. We generally create a library folder inside our workspace folders.<\/p>\n<p>Unzip the DF4WP.zip file into the library workspace and then add the library to the workspace.<\/p>\n<p>Now open your webapp.src file and at the top use the cWPWebApp.pkg file<\/p>\n<pre class=\"lang:default decode:true \">Use AllWebAppClasses.pkg\r\nUse cWPWebApp.pkg\r\n\r\n\/\/Register_Object oDashboard<\/pre>\n<p>also change the class used for your WebApp from cWebApp to cWPWebapp<\/p>\n<pre class=\"lang:default decode:true \">Object oApplication is a cApplication\r\nEnd_Object\r\n\r\nObject oWebApp is a cWPWebApp   \r\n    Set psTheme to \"Df_Flat_Touch\"\r\n    Set peAlignView to alignCenter<\/pre>\n<p>in addition any view that you would like to be able to show within your wordpress site needs to be based on the cWPWebView class and any modal dialogs need to be based on the cWBWebModalDialog class.<\/p>\n<p>for testing I created a simple hello world view.<\/p>\n<p>make sure your app runs properly and then lets go back to the WordPress dashboard.<\/p>\n<p>In the DataFlex settings set the path to your application. For example <strong>\/TestWP<\/strong><\/p>\n<p>then enter a 32 character secret. if you do not enter one, one will be automatically created.<\/p>\n<p>New create a new page in WordPress and use the following shortcode to add your DataFlex application<\/p>\n<p><strong>[df4wp-webapp height=600]<\/strong><\/p>\n<p>now publish the page and navigate to the page. Your DF WebApp should be showing in the page<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-363\" src=\"http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp-1024x676.png\" alt=\"df4wp\" width=\"1024\" height=\"676\" srcset=\"http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp-1024x676.png 1024w, http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp-300x198.png 300w, http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp-768x507.png 768w, http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp-1080x713.png 1080w, http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/08\/df4wp.png 1120w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<div>\n\n\t\t<div class='author-shortcodes'>\n\t\t\t<div class='author-inner'>\n\t\t\t\t<div class='author-image'>\n\t\t\t<img src='http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/02\/mike5crop-566174_60x60.jpg' alt='' \/>\n\t\t\t<div class='author-overlay'><\/div>\n\t\t<\/div> \n\t\t<div class='author-info'>\n\t\t\tMichael Salzlechner is the CEO of StarZen Technologies, Inc.<\/p>\n<p>He was part of the Windows Team at Data Access Worldwide that created the DataFlex for Windows Product before joining <a href=\"http:\/\/starzen.com\">StarZen Technologies<\/a>. StarZen Technologies provides consulting services as well as custom Application development and third party products specifically for DataFlex developers<\/p>\n\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This plugin, available from DataAcesss allows you to embed a DataFlex WebApp into a Wordpress site. Wordpress is a free open source content management system.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","ngg_post_thumbnail":0,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-343","post","type-post","status-publish","format-standard","hentry","category-dataflex-webapp"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/comments?post=343"}],"version-history":[{"count":15,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/343\/revisions"}],"predecessor-version":[{"id":366,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/343\/revisions\/366"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=343"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}