Creating a REST Server with 2-Legged OAuth Authentication (Example with Java Servlet)

Apparently the way to get content from a Drupal site to another site/application is to use services. And also it would seem that using session based authentication is sooo last Drupal 6. So the recommended, yet not at all properly documented (like, anywhere), method is for an application to use 2-Legged OAuth authentication to authenticate and exchange data.

I spent some time getting angry at Drupal and OAuth and module makers and everyone who wouldn't provide a clear guide how to do this, and so now I have what I believe is a correctly working implementation (if it's not, please tell me where I'm wrong) I pass this information on to you dear reader.

Start Here: Recommended Modules

We recommend you download and install the following modules in order to make the most of your Omega based theme. More on installing modules.

Make sure you are running the latest stable releases of all modules to ensure proper functionality. If you are using dev releases of any of these modules use the dev release for all in order to maintain compatibility.

  • Omega Tools

    (requires Ctools) - Omega Tools is a great set of functionality that will help you to easily create and manage your Omega subtheme. This tool is useful in development but should probably be disabled in production environments.

  • Delta

    Delta is a powerful tool that allows you to create variations of a theme's settings without having to create a new subtheme. When used with Context, Delta allows you to edit the omega grid, zone, and region settings and create all new layouts based on the various conditions available in Context.

Drupal 6 - How To: Different Headers using Pathauto, Views, Taxonomy, Context, and Views Slideshow

Problem: I needed different pages/areas of the site I'm currently developing to display different areas, as well as display a default area. But it needed to be more automated.

Pathauto and Taxonomy don't play well together in Views and so this was part of the problem.

Solution:

Requires Views Slideshow and I'm using Views 3 alpha as well, but I don't know if that matters.

Create a Vocabulary (mine's called Rotating Headers), attach it to the Image content type. Create some nodes, ensuring that they are named differently with pathauto. Upload some Images, tagging them with the same name as that of the path that you want it associated with.

ex: If the path shows "some-path," then the tag would be "some-path."

That's the easy part.

Go into views and create a new node view.
Create a new block.
Filters: Node: published, Node Type: Image, Taxonomy: Vocabulary = Rotating Headers.

Fields: Image: image

Use pager: all items

Style: Slideshow using Views Cycle.

Here's the tricky part.
Arguments:
Taxonomy: Term
Provide Default Argument -> PHP Code
Insert the following:
<?php
$arg = explode('/',drupal_get_path_alias($_GET['q']));
$vid = 9;
foreach ($arg as $thearg){
$term = taxonomy_get_term_by_name($thearg);
firep($term);
if($term[0]->vid == $vid){
$terms[] = $term[0]->name;
}
}
if($terms){

Subscribe with RSS Subscribe to RSS - context