SharedShelf Link not working with Omeka 2.2.2

Hi Omeka folks,

I'm hoping someone can help me with setting up the SharedShelf Link Plugin. I've been working with SharedShelf (SS) support, but haven't had any success so far.

This may be related to his post, but I don't know for sure. http://omeka.org/forums/topic/sharedshelflink-publishaction-bug#post-103641

Omeka 2.2.2
SharedShelfLink-2.0
My sandbox Omeka site that I'm using for testing is here:
http://omeka.wellesley.edu/omeka-2.2.2-sandbox/

I've installed the plugin and added an authorization token "archivesomeka" in the configuration form.
I followed instructions from SS here: http://help.artstor.org/ssadmin/index.php/Publishing_Targets#Add_the_Omeka_target_in_Shared_Shelf_Admin_Tool

Where I see the problem is at step 5. The drop down menu is not populating with the collections from the Omeka site. I have two different test collections created in our site. When setting up the target in SS, the drop down shows a spinner and loading, but then goes blank and is never populated with the available collections.

The URL i'm entering for the Omeka URL is: http://omeka.wellesley.edu/omeka-2.2.2-sandbox/
I've also tried without the http://, with an ending / and without.
I've also tried the following, since "Enter the URL of your Omeka collection" is a little vague.
http://omeka.wellesley.edu/omeka-2.2.2-sandbox/collections/
http://omeka.wellesley.edu/omeka-2.2.2-sandbox/collections/show/2

Another problem I've found that could possibly be a sign of a greater problem is when I filled in an Authorization Token in the configuration of Plugin: SharedShelf Link and I return to the configuration page the field seems to be reset and shows "<Your Token Here>". If I enter a token and click save changes it returns to the list of plugins and tells me I've updated successfully. If I go in again, I see the "<Your Token Here>"
If I look at the table sandbox222_options in MySQL there is an entry for
127 shared_shelf_link_token archivesomeka

So even though it's not showing on the admin page it's in the database. But I can't help think that this may be part of the problem.

SS support was able to look at the log on their server and this was the log:

<start log>
qateam@pteserver1:~$ wget http://omeka.wellesley.edu/omeka-2.2.2-sandbox/shared-shelf-link/publishing/publish/collection?__token=archivesomeka
--2014-08-07 14:58:08-- http://omeka.wellesley.edu/omeka-2.2.2-sandbox/shared-shelf-link/publishing/publish/collection?__token=archivesomeka
Resolving omeka.wellesley.edu (omeka.wellesley.edu)... 66.147.232.198
Connecting to omeka.wellesley.edu (omeka.wellesley.edu)|66.147.232.198|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 160 [application/json]
Saving to: `collection?__token=archivesomeka'

100%[==========================================================================================>] 160 --.-K/s in 0s

2014-08-07 14:58:08 (13.7 MB/s) - `collection?__token=archivesomeka' saved [160/160]

qateam@pteserver1:~$ cat c*

Notice: Undefined index: __token in /var/www/html/omeka-2.2.2-sandbox/plugins/SharedShelfLink/controllers/PublishingController.php on line 30
{"success":false}qateam@pteserver1:~$
<end log>

line 30 of the PublishingController.php falls on the if line of this function:

public function publishAction()
{
// Bypass ACL security on publication processing.
//Omeka_Context::getInstance()->acl = null;

$token = get_option('shared_shelf_link_token');
if ($token == $_POST['__token']) {
new SharedShelfImporter();
$publication = new SharedShelfImporter;
$publication->createOrUpdateItem($_POST, $_FILES);
$this->_helper->json(array('success' => true));
} else {
$this->_helper->json(array('success' => false));
}
}

Thanks for any help,
Kara

We will look into this. Did you have an earlier version of Omeka where the Shared Self plugin worked?

There shouldn't be a reason this isn't working but it is always tricky because it relies on settings in both ArtStor and Omeka working together.

No, I did not have this installed and working in an earlier version. So I did just try installing SharedShelfLink 1.0 in an older Omeka 1.5.3 version. With this older version, there is a default Token showing, and it does stick when I leave the page and return and when I change the token.
But I'm still getting the same effect in Shared Shelf. Just a spinning loading... and no collections are populated in the dropdown menu.

I don't know anything about how Shared Shelf works, but there's a clear mismatch in the output you quoted. The test used the query string ?__token=archivesomeka, while the plugin code you pasted is looking for __token in POST data, not the query string.

I don't know where exactly the issue lies, but that would certainly seem to be part of it.

let me expand on what John mentioned. If you want to be able to pass post data when using wget you must pass the --post-data flag to it with the content you want to pass to it. For example to publish an item you would need to use the following command

wget --post-data "_collection_id=1&__token=myToken&_ss_id=2&title=MyTitle&title2=mysecondTitle" http://omeka.wellesley.edu/omeka-2.2.2-sandbox/shared-shelf-link/publishing/publish

Now, the problem within the log data that Shared Shelf produced is that it's looking for the collections in the wrong place. instead of
http://omeka.wellesley.edu/omeka-2.2.2-sandbox/shared-shelf-link/publishing/publish/collection?__token=archivesomeka

it should be looking for theme here instead

http://omeka.wellesley.edu/omeka-2.2.2-sandbox/shared-shelf-link/publishing/collections?__token=archivesomeka

copy & paste the above into your web browser to see what collections Shared Shelf should be able to see.
You must ensure that this link and the collections you want Shared Shelf to access are publicly available

Thank you John and Roberto! I did change my token after posting my question. I am able to see the two public collections listed when I construct the url correctly.

[{"id":1,"name":"Test the Link to Shared Shelf Archives Collection"},{"id":2,"name":"testKara"}]

I've passed along this information to SharedShelf and hopefully they can fix the problem on their end. We'll see if we hit another roadblock. I'll post a follow-up later.

Having this exact problem. I can get Shared Shelf to publish to an Omeka.net site, but I'm having the same problem described above when using an install on a third party hosting site.

Was this issue resolved with Shared Shelf? Is there a work around?

Hello EMcG
Are you having problems when trying to add targets to sharedshelf? This may be a problem with how SS is attempting to access your collections.

Back in Nov. 2014, the support staff at Shared Shelf told me they were trying to set up a meeting with the head of QA and the Omeka developers so they could figure out what the issue is. I have just emailed today asking for an update and informing them there are other users wanting to use this plugin. Here's hoping! Kara

Hello Kara,
Let me follow up with them as well so we can resolve this as quickly as possible.

I contacted our Shared Shelf administrator and our issue was resolved after they enabled our domain in the ArtStor firewall.