API for Plone 4? - plone

I am wondering if Plone 4 has an API. I don't see one documented on api.plone.org.
Essentially what I would like to do is pipe content to a Plone page. We have a number of lookup tables in MySQL which if their content could be ported to Plone would allow the content to be found and indexed in Plone. These tables are updated about four times a year so each time it is piped it would become a new version of the same document.

api.plone.org is outdated.
If you want to know how to program Plone with Python read here:
http://collective-docs.readthedocs.org/en/latest/index.html
However Plone is not different from any other Python program. You can use standard Python MySQL libraries and frameworks with Plone.
There exist a framework for importing content to Plone called Transmogrifier:
http://pypi.python.org/pypi/collective.transmogrifier/1.0
And various subpackages:
http://plone.org/products/mr.migrator
http://www.slideshare.net/regebro/transmogrifier-migrating-to-plone-with-less-pain-2387600
Plone Conference 2011 had an example of importing Liferay CMS SQL data to Plone but AFAIK this presentation is not on-line yet.
Advanced Python skills needed in any case.

Related

Drupal 7 - Use external database in (virtual?) nodes and views

I'm a bit of a Drupal newbie but have committed myself to porting some quite complex bespoke websites.
One of these is a surf report site which uses a database with millions of time/location rows to get the local conditions. Obviously can't write this to a Drupal table everyday so am looking for a way to connect and retrieve live data.
I'll need to use the external data in a number of displays which would normally be nodes, views, blocks etc.
The ideal solution would be if the external data just appeared as local data, but I'm guessing that is a rather big ask.
I'm open to any approach. If it involves writing a module some pointers on what to look at (preferably code examples) would be much appreciated.
Thanks,
Chris
Maybe you can use the Data module.
From the documentation:
The Data module lets you use database tables that are foreign to Drupal.
You can 'adopt' a table in your database that ordinarily Drupal would not be aware of. This might be external data you have imported, or a table that another application has created.
It also provides Views integration.
I had to show info from a legacy staff databse in my Drupal 6. I have explored three ways:
Importing database rows as nodes in a nightly cronjob
Accessing the external database in my own module
Accessing the external database using hook_views_data()
If I started again I would use hook_views_data(), it's more flexible, specially if you want to match the external database information with drupal nodes.
Best.
Have a look at the Forena module which can be used to display (= query, not update) data stored in databases external to Drupal. It comes with a full suite of Supported database connections, such as MySQL, MS SQL, Oracle, Postgres or any PDO compliant variation.
For more details about Forena, 2 types of documentation are available:
Community documentation.
Documentation that comes with Forena, which you can access right after install and enable of the module. Checkout the demo site for an online example of the Forena Documentation.
The Sample reports and graphs are fully functional, such as the drill downs available on the Master Summary with drill down. Using Forena "skins", you can also use the amazing "dataTables" (and its widgets, such as sorting by selected columns).
Forena also includes a UI for either creating your reports (the WYSIWYG Report Editor) and/or for creating your SQL queries (the WYSIWYG Query Builder).
Disclosure: I'm a co-maintainer of Forena.

Copying content from dev to live sites in Drupal

We have several Drupal 6 sites. On most of the sites we will have some content editors, who will optimally log into a dev/test site and create content. Mostly just plain vanilla pages. What is the best method for migrating these newly created pages to the live server? I know there is the Deploy module and also Backup and Migrate. Are these the de facto standards? I was wondering if there is anything else I might be overlooking or if there is a better/easier solution. I am ONLY interested in moving content. We will be using GIT to move code and the Features module to migrate admin changes.
THANKS
In the past I've used node_export and recently I've found (in drupal 7) that the uuid module is invaluable. It means you can keep a track of content even if the nid's change as you move it over.
There are some legacy modules hanging around too that did an okay job but their functionality has really been surpassed by the modules you mention and the ones above.
If you're creating all your content using fields added with cck, you shouldn't have a problem. I personally use node_export along with features to allow easy importing and updating.
One gotcha you might want to look for on node_export is when importing on the new site, if a node is found with the same uuid (i.e. you're doing and update), the default is to create a new node. I prefer to create a new revision. Worth tracking down that setting (it's there in d7 so likely in d6 too).
EDIT: node_export doesn't currently export panels very well if at all - just in case.
It depends on the structure and diversity of the nodes (how many fields of which type, how many node types). My first try would be to generate a view with XML output (views_datasource.module or views_data_export) on the dev site and use the feeds.module for XML import on the live site.
The above XML export modules are avalable for D6 and D7. In Drupal 6 I used views_bonus.module for the XML export.

Is a CMS like Drupal or WordPress appropriate for a basic data-centric web application?

I'm curious if a CMS like Drupal or WordPress is a suitable approach for creating a data-centric web application. It's nothing fancy, but would require a login to access, and essentially have search parameters, results pages, and detail pages. I can program this pretty easily but would prefer to just theme Drupal or WP, since I'm not much of a designer. Thanks for any insight, as well as any examples of where this might currently exist!
-e-
Sure, Drupal is suited for data-centric websites. Development Seed is a company that use Drupal and make data-centric websites but they also use other technologies such as Node.JS. As suggested by Marek Sebera, it really depends on your actual needs and what exactly your site will be doing with the data.
You basically have two ways to integrate your data into Drupal. One is to import the data into Drupal as entities (a generic concept for anything data in Drupal 7) or nodes (a concrete concept for anything content in Drupal). The other is to directly query an external data source from Drupal.
To import data, the Feeds module is a very solid and flexible solution. Out of the box it only supports CSV, Atom and RSS from local files or HTTP. But it is flexible and extensible and there is already many contributed modules that extends it.
To query the data, both external or imported, you can use the Views module to build query pages. For external data source support, you will need additional backends modules and probably have to write your own.
If you import the data as entities, you can also uses the core's EntityFieldQuery to write your own query without using Views. And you can also uses the Search API to index the imported data using a search engine such a Apache Solr.

Working with version control on a Drupal/CMS project

I was wondering how teams that develop sites using Drupal (or any other CMS) integrate version control, subversion, git or similar, into their workflow. You'd obviously want your custom code and theme files under version control but when you use a CMS such as Drupal a lot of the work consists of configuring modules and settings all of which is stored in the database.
So when you are a team of developers, how do you collaborate on a project like this? Dumping the database into a file and putting that file under version control might work I guess, but when the site is live the client is constantly adding content which makes syncing a bit problematic.
I'd love to know how others are doing this.
You are correct that this is an issue for Drupal--version control works fine until you turn the site over to your client or open it up to users.
Your question seems like a more specific version of this one, which touched on version control in the Drupal workflow. You may find some answers there that help.
For some projects, I have exported all of the views to code, using that feature of the Views module, and I have one project where all of the blocks have been exported, as well. (Although that was a development exercise and not a customary thing to do with blocks.)
Take a look at the work that Development Seed is doing to work around this problem. They are leading the development of the Context, Features, and Spaces modules that work together to store configuration data in modules (outside of the DB) so that it can be versioned with the code.
There is a Drupal group called Packaging & Deployment for discussing the various solutions that are being developed for this issue.
Right now there are a lot of efforts towards creating something that will handle the dev -> production difficulties with drupal in relation to the database. Features, that flaminglogos mentioned is one, but I feel that is more focused on creating stand alone projects, ie ones that would be installed on many sites.
For simple maintaining you dev and prod databases I'd take a look at http://drupal.org/project/deploy and http://drupal.org/project/dbscripts. They support syncing and merging db side drupal config data.
I can't guarantee they are ready for prime time though...
There is a lot of effort of shipping the next drupal version with configuration in code. That's is the key to have it in a version system.
For now you can use the features module, with that you can export things like content types, views, etc. to code, and then compare, version and revert it as you need.

how to use plone as a framework

I am creating a web app that allows people to debate topics. I started prototyping with Django and have a functional app. I have not yet decided on what framework to use.
I've read about Plone the app and Plone the framework. I just can't seem to find any online documentation on using Plone as a framework. I'm looking for a tutorial or something that will show me how to build a web app starting with Plone. I just want to evaluate Plone before I choose my framework.
Anyone have any refs or recommendations on learning how to use Plone as a framework?
You should start here:
http://plone.org/documentation
A really good book is:
http://www.packtpub.com/Professional-Plone-web-applications-CMS/book
Plone is build on Zope Application Server (zope.org). You should read into the zope book too. Its free.
The IRC Channel (#plone) on freenode is full of experts that are willing to help. They like to discuss with :)
Don't use Plone as Framework.
Plone is an CMS. You can use it as framework,You can use Zope2 application server + Zope3 component architecture but I don't recomended to do this. Plone was designed to be a CMS so why You want use it as framework?
Why you shouldn't use Plone as framework?:
Plone is Slow!!!
30 sec. on every restart is too much. When You change something, you need restart. Autorestart(http://plone.org/products/collective.autorestart) doesn't help, you still need to restart Plone any time You change a zcml, portlet's code and sometime with python code.
Plone is too complex.
So big code base. Different coding styles (old Zope2, new component base Zope3, some parts are written with Grok).
You will need write xml (Generic Setup).
Nobody can say what you must use Archetypes, Formlib, z3c.form or Dexterity?
Plone doesn't have good documentation. Too much old documentation (plone.org/documentation) and there is no place where you can read what is the right way to do. The only good documentation is in Martin Aspeli's book (martinaspeli.net/plone-book) but you will need more and this book isn't open, so You will need buy it.
Plone has so many products but if you need really stable and quality stuff you will need write your own.
Plone is Slow!!! Forget test driven development.
I think that the most important factor in choosing a framework is the existence of good documentation. If you can't find good docs for using plone in the way that you want without having to ask here first, that's all the "evaluation" you need.
I'd stick with Django.

Resources