I am developing my first large Ubercart site, which needs to have a daily product database update from an existing xBase (DBF format). The conversion from DBF to MySQL/PHP is handled on the same server as the Drupal installation, using some custom scripting I have done, and works well. However, the next step is to get my script to talk to Drupal and update the product nodes with pricing/stock level/etc.
Googling hasn't resulted in any good hits, at least in PHP terms.
So how do I go about this? Can I just use a POST to a particular page in Drupal, ie RESTful, or do I have to use some more arcane xmlrpc method?
There's a couple ways to approach this. If you need to de-couple your import system from php you could create a api that would allow you products to be updated from an authenticated data provider.
http://drupal.org/project/services
The simpler method though is if your working in php you should bootstrap drupal and insert / update the nodes from php:
Here's a great howto on doing that: hxxp://www.group42.ca/drupal_command_line_script_template
Related
I want to build wordpress based CMS using RDF (for persons) data as well as mySQL data (form news blogs ets). Data is store and retrieved from Sparql endpoint, and shown as a text on WP site i.e
1) it will retrieved all information regarding person from sparql endpoint and publish it on WP site with nice GUI.
2) Also it has editorial part in which person will be able to edit his content and it will be saved in RDF dataset.
3) On later stages it will be connected to other sites so that person will not need to update his data on every site.
I am new to all this so my question is, will it be possible in Wp?? and if so how I will go through it. In my head for News,blog etc Wp will be used and for publishing/retrieving and updating Persons I have to create my own CMS. Am i going in right direction??
One approach you could consider is to use Carbon LDP, a Linked Data Platform. (Disclaimer: I am product-related staff, but this answer is certainly viable for your goal and relevant to your question.)
The Standard (free edition) of Carbon LDP will give you a RESTful API and an RDF native file-store database suitable for small - medium (loosely speaking) apps. Carbon also has a JavaScript SDK which allows you to easily work with the REST API and JavaScript model objects of just about any shape. For example - just invent the JSON representing your Person, and Carbon will do the rest (converting everything to RDF behind the scenes when you save the object, and the converting back to the JavaScript object when you load). Of course you still get your SPARQL endpoints and all of the goody-good benefits of Linked Data. Carbon just makes it easier by abstracting a lot of the complexities away and providing a document-oriented approach to RDF that is more familiar to the everyday web developer.
You would need to develop whatever visual widgets are necessary to create the forms for data entry and the display output on a WordPress page. You could build those widgets using standards-based Web Components for example (e.g. using Stencil compiler) or whatever you're comfortable with (like vanilla JS / CSS / HTML). Basically, those widgets will just be calling Carbon's REST API (via the Carbon LDP JS SDK) to read and write data. Then you can leave it up to WordPress to do all the rest of the stuff that it does so well. The reason why I suggest Web Components is because that'll just give you simple HTML tags that can be used like any other HTML tag on a WordPress page to create widgets where you want them. The related JS can be injected into your theme's head using the WordPress recommended enqueue approach for themes or child themes.
You might also choose to code some of the stuff in theme, child theme, or a WordPress plugin if you find that it helps your workflow (there's always a few different ways to "skin the cat").
So I am building a small web app. I have set it all up on Ubuntu and I am using Wordpress. I want to use a plug-in called JSON API to pull in content from my Wordpress blog in an easy to read form and I want this to be updated to say have only 5 posts at a time being the 5 most recent ones. I’ve looked around and I was wondering if someone could help me and give me an idea on how to go about this? I am a complete beginner I have no previous experience I have not started typing any codes or anything like that because I'm not sure how to start it.
You have a few options here, and which one you choose really depends on what works for you.
WordPress has a built-in API, but this is not a JSON API, it's XML-RPC. It's pretty feature-rich and won't require you to write any code (on the WP side) to pull posts. More info here: http://codex.wordpress.org/XML-RPC_Support
Read directly from the database. This is probably a faster implementation if you're reading from the same box. Simply connect to the database WordPress uses and query the posts table directly.
Find a JSON API plugin that suits your needs. It's difficult to recommend any as you seem to have specific requirements. Try some, and see what works for you. The downside to this is you'll need to keep the plugin up-to-date, and you're using third-party code - I'll leave it up to you whether you believe that to be a bad thing or not.
Write your own! It should be relatively straightforward to write a small script to pull in posts from the WordPress database and spit out a well-formed JSON feed.
I have a wordpress installation I'd like to get rid off. It's been constant work over the past year keeping up with various updates and changes and managing differenet plugins. I've realized I don't need that much functionality and would be perfectly happy with static pages. If I manage to drop the installation I could also speed things up a lot and integrate the content more easily in the rest of our site.
I'm trying to find a PHP or Perl package which I can use to easily query the existing WP DB. Basically, I want to keep the DB and throw away the frontend and backend to WP. Then I just want to add a very minimal layer of PHP or Perl code on top to show the posts in the DB including meta data.
In case there is no package that can make this job easier, is there some concise overview of the SQL queries I will need? I know I can go digging for them in the codebase, but maybe there is someone who has already done this. Googling around didn't immediately turn up useful results.
Maybe you want give a try to jekyll or octopress.
If you were to integrate some open source CMS into your already existing website... which CMS would you choose and how would you go about achieving it?
The BEST CMSs that will work very well and may fit your needs are :
Instante Update - the best one in my opinion
PulseCMS
SiteCake
These three CMSs can be integrated into any existing Website & they are easy to use. I think they fit your needs.
you should ask the question in different order "How to migrate already existing content to open source CMS" and your action list would be
map existing data and url schema (so you could make redirects from old content to new locations if locations change) to get the hang of the amount of pages/structure that need conversion
choose your next weapon (wordpress, joomla, modx and so on dependent of your needs and amount of data) and make a clean installation of latest version
convert old site information to data import format of your chosen weapon
if your information is in start planning design, editorial and other regular tasks that each site needs
the idea here is to make the conversion first with raw data to get the clean site structure and content you really need and not mess with design and editorial tasks first as those are secondary and can be addressed separately over and over
i would go with wordpress... just download in from wordpress.org and install it into ur site, via FTP or File Manager, but you need to know how to use wordpress, everything would be very basic in PHP, they usually slice the website into three parts. Header, Body, and Footer, try to mess with it, and you could integrate it... but i think CMS is much preferrable if ur trying to create a blog-style website
You should also consider the popularity of the Open Source platform you choose. The more popular it is, the less likely it will disappear all of a sudden - and it will be a lot easier to get community support (and 3rd party modules).
For me there would be 3 choices if it has to be a PHP based CMS : Wordpress, Joomla or Drupal. I tend to prefer the latter, because it's very flexible (though it also has some quirks, especially if you're creating multilangual sites).
As for how to go about it : that largely depends on what you already have. Is it a static site or dynamic site? Have you got some scripts that wouldn't be easy to alter? Your first priority should be to list specific functionalities of your site and see if any of the CMSes you consider supports these out-of-the-box (or using 3rd party modules).
Porting data to Drupal can be very easy (using the Migrate module - Migration: not just for the birds).
Oh, and one more thing : also keep things you plan for the future in mind. If you consider building a full blown website, don't stick with something that will help you out now, but hold you back in the future.
I'm building a new website which has one core application and many content pages. Content pages are mostly dynamic and I require a way to manage this dynamic content on a regular basis. The core application's main functionality is a 3 step process or reading user data (input page), reading data from MySQL (product page) and submitting an application to an email address (application page).
Ideally I would like to build the core application in regular PHP and leverage Drupal for its content management capabilities. Can Drupal and regular PHP be integrated as I suggest easily? My feeling is that coding the core application as a Drupal module(s) will add layers of complexity that could be difficult to code from the outset and maintain later on as the system matures - so I would really like to just use regular PHP.
Let me explain where dynamic content (managed by the CMS) intersects with the core application:
Dynamic content such as FAQ data is used both on the 'normal' help pages and also within a mini-feed displayed within core application pages down a right hand side column. In this column, 3 random questions are pulled from the database and displayed as a feed. When users click on FAQ question they are not taken away from the core application product page but are instead shown data in a pop-up window displaying the question and answer. In addition, users can browse other questions and answers through a simple navigation menu within this popup. There are 3 such like feeds as I describe above that I require on the core application product page.
So, what is the ideal solution here in terms of 'keeping things simple' for both the management of dynamic content and the ease of coding the core application? Can 'regular PHP' and Drupal co-exist 'peacefully'? If so, how is this technically possible? Because there is some content managed by Drupal contained within core application pages, can the core application still be coded in regular PHP?
Any advice / suggestions?
Thank you!
Jim.
This is part of a post I submitted few years ago. Unfortunately the linked article is long gone, but it might still be relevant for your needs:
Importing old-style standalone PHP scripts into Drupal system
Drupal system is a very strong CMS, but taking an existing PHP site and trying to force it on Drupal might be a hard thing to do.
The "right" way to convert a site into Drupal is to "Drupalize" it, which means to do everything "the Drupal way", which is really the right thing to do - but is some cases not everybody agrees about that.
I had an example with a company that has many HTML/PHP based sites. They heard about the flexibility and strength of Drupal, and decided it is their choice for the revolution. But, on the other hand, they want not to change anything, and that I will do it as fast as possible.
The "right way" to do it was to break each PHP script they have to its pieces, find the commons, create the right methodology with existing Drupal modules, and finish the gaps with my own additional module.
But this is not what they asked me to do - instead, I looked for a way to just import the existing PHP script into Drupal environment.
Searching for am existing solution brought me to a proof-of-concept described by Dan Morrison. In the bottom line it uses PHP output buffering commands it order to collect everything the old script does, and then to display it as part of a Drupal module. In my case I had to make some small modifications (mainly to pass variables from the request to the PHP in the relevant scope), but in the bottom line it did exactly what I needed.
Well, almost... In other cases, in which I wanted to enjoy from Drupal's Form API, I handled it differently, as I will describe later on.
It sounds like you are asking about two things:
Including Drupal content in a custom-built PHP application.
Displaying Drupal content in a pop-up window from the PHP application.
There are a number of different levels of integration- if your need is as simple as pulling content into a page then you may be able to simply create a view (http://drupal.org/project/views) with that content from Drupal that you can make available to and then include it in your web app.
If you are looking for a tighter integration between the 2 including sharing of users, sessions, etc... then it is likely also "possible" but would take additional information to understand what you need.