Giter VIP home page Giter VIP logo

silverstripe-external-content's Introduction

External Content Module

The External Content module forms a framework for displaying and migrating content from external sources.

Maintainer Contact

Marcus Nyeholt

<marcus (at) silverstripe (dot) com (dot) au>

Requirements

  • SilverStripe 3
  • FileSystem Connector module (for a default connector implementation)
  • PHP MB String module (should be default on most systems)

Note: For a SilverStripe 2.4 compatible module, please check the 1.0.0 branch

Usage

This article assumes that you have installed the FileSystem Connector module, which provides access to content from a filesystem path.

Connecting to the content source

  • Extract the module to your silverstripe root directory in a directory called "external-content"
  • Browse to http://localhost/external-content/admin and login
  • Create a new FileSystemContentSource from the tree on the left menu. Set the following field values:
  • name - File System Content
  • Folder Path - The folder to retrieve content from (in the form /path/to/content)
  • Once saved, you will need to reload the External Content page for content to start coming through the connector

Accessing content on the frontend

  • Navigate to the "Site Content" tab
  • Create a new 'External Content Page' in your site tree
  • Change the External Content Source value to the source created earlier
  • Save and view the page on the frontend; its url should look something like http://localhost/extcon/view?ID=1 or similar
  • You can also link to external content directly in the WYSIWYG content areas by selecting "External Content" as the "Link To" option when the Insert Link toolbar is displayed

Importing content

  • First, make sure you have an empty folder called "Incoming" created in the "Files & Images" section
  • Navigate back to the External Content section, and expand the "File System Content" node created earlier.
  • Navigate to a folder that contains some files and click on its name, then click on the Migrate tab.
  • Select the "Incoming" folder, then click the "Include Selected Item in Migration" option.
  • Click the Migrate button down the bottom. An alert box will shortly appear when the migrate is complete.
  • Navigate to the "Files and Images" section and click the "Incoming" folder.
  • The uploaded files should appear in the right hand listing when you select the imported folder

API

WebApiClient

A generic method for calling methods with parameters where the method is actually found on a remote URL, and the return type of that method call can be easily converted to an appropriate object. For example, imagine that there is a "login" method that can be called on a particular URL with some parameters, with an XML return type. A definition of this method would look like

'login' => array(
	'url' => '/api/login',
	'return' => 'xml',
	'params' => array('u', 'pw'),
	'cache' => false,
),

When the WebApiClient is created, it is passed a 'baseUrl' and a list of method definitions like the above. Then, it is simply a matter of calling

$apiClient->call('login', array('u' => 'user', 'pw' => 'pass'))

and getting a SimpleXML object as the return type. This mechanism is used by the AlfrescoSeaMistRepository, so refer to that module for further details.

Troubleshooting

If you're having trouble viewing pages when opening an ExternalContentPage directly via the backend, make sure there's not two ? characters in the URL. The SS backend assumes that a URL for an item won't have a URL in it, but at the moment URLs are constructed in this way.

silverstripe-external-content's People

Contributors

ajshort avatar jedateach avatar mateusz avatar micmania1 avatar nyeholt avatar sminnee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

silverstripe-external-content's Issues

Search

I have a ExternalContentPage that's showing a xml tree of pages. How do I hook it up into site search?

Broken links in README

Most of the links in the README are broken, this makes trying to find the various dependencies or extra documentation very, very difficult.

Abandoned?

I get an error trying this with SS 3.6

Fatal error: Class 'DataObjectSet' not found in /Users/willbarker/Sites/www/hi/wwwroot/silverstripe-filesystem-connector/code/model/FileSystemContentItem.php on line 42

Form PJAX headers

In the centre-pane of the CMS the module uses a "Create" button, to allow the creation of new ExternalContentSource instances.

Once this is clicked, users need to reload the UI in order to see new instances in the center-pane, which is unlike how similar CMS interfaces currently work.

The addition of form PJAX headers via a custom defined getResponseNegotiator() method would fix this in ExternalContentAdmin#AddForm().

Import of external content only creates a live version, no draft

Using this base along side the staticsiteconnector (a fork at https://github.com/silverstripe-scienceninjas/silverstripe-staticsiteconnector) works in terms of importing raw text/html content however when imports occur, they are written only to the live table (I think) so do not show up on the SiteTree (even though the pages exist). The site this was tested on is a 3.2 core site. Anyone struck this issue before? Could it be a 3.2 related regression?

Can anyone point me towards where in the module the actual page object get written?

Cannot run tests when external-content is installed: Zend_Loader

Whenever I try and run Behat tests or unit-tests with the external-content module installed, I get the following error which means I need to comment the class it to get them running:

PHP Fatal error: Cannot redeclare class Zend_Loader in /path/to/htdocs/external-content/thirdparty/Zend/Loader.php on line 31.

Framework includes its own version of Zend_Loader and it's newer, so can the module just swap the location of the required thirdparty/Zend directory for the one in Framework? A change to _config.php would be all that's required right?

installation issue on SS 3.0.3

I'm trying to import video data from an xml feed as silverstripe pages/object. So I installed the module on SS v3.0.3 to try it.
After installation, when I create a new External Content page type I get the following error:

warning at line 53 at /framework/model/datalist.php

When I click on External Content tab on the left nav, I see a black page.

any help?

Default duplication strategy selection

There is no currently no default duplication strategy set. While this is only mildly bad usability practice, it would make it easier for users of module relying on EC's logic to know "what just happened" if they neglected to make a selection.

Human readable ExternalContentSource subclasses

The dropdown menu comprising ClassNames of ExternalContentSource subclasses should be made a little more "Human" by applying FormField::name_to_label() or similar to the class-names that appear in it.

SS3 support

nyeholt/master doesn't currently support SS3. Shea's ss3 branch addresses this, but it's stuck in his repo.

Can we get the SS3 work merged into whatever the official version is? Should this be pushed over to github.com/silverstripe-australia or even github.com/silverstripe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.