Coder Social home page Coder Social logo

collective.embeddedpage's Introduction

collective.embeddedpage

Egg Status Latest Version License

kitconcept

collective.embeddedpage allows to embed remote HTML pages in Plone.

Features

  • Adds EmbeddedPage content types (Dexterity based)
  • Displays remote HTML within the view of the EmbeddedPage content object

Examples

This add-on can be seen in action at the following sites:

Translations

This product has been translated into

  • German

Installation

Add collective.embeddedpage in your Plone installation with pip install collective.embeddedpage

Configuration

This addon provides the entry collective.embeddedpage.timeout (Default value: 10 seconds) via the configuration registry in Plone. Requests to embedded pages that take longer than the entered value will be aborted and a generic error message is shown instead.

Local Development

Clone this repository:

git clone [email protected]:collective/collective.embeddedpage.git

Install Plone and this package:

cd collective.embeddedpage
make build-plone-6

Run tests:

make test

Contribute

Support

If you are having issues, please let us know.

If you require professional support, feel free to drop us a note at [email protected].

Credits

HU Berlin

Forschungszentrum Jülich

The development of this plugin has been kindly sponsored by Humboldt-Universität zu Berlin and Forschungszentrum Jülich.


kitconcept

Developed by kitconcept.

License

The project is licensed under the GPLv2.

collective.embeddedpage's People

Contributors

csenger avatar ericof avatar iham avatar reebalazs avatar robdayz avatar rodfersou avatar sneridagh avatar tisto avatar wolbernd avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collective.embeddedpage's Issues

Requests to URLs that do not respond run on forever

When calling an URL via an embeddedPage that does accept a connection but never sends a reply, this addon will not run into a timeout and will wait forever for a reply. On high traffic sites this can lead to resource exhaustion on the Plone servers as there is a limit to the open connections an instance can have open.

Steps to reproduce:

  • Create a web application that accepts a connection but does not reply (Simplest solution is to create e.g. a php script with sleep(999) and put it on a server with PHP support
  • Enter the URL of the above mentioned script into an embeddedPage (You might need to remove the sleep() for this step as the document will only be saved once the entered URL has been reached)
  • Call the embeddedPage in Plone

What happens:

  • The page loads forever in the browser without showing a result (Depending on the Plone setup there might be a timeout e.g. in a reverse proxy in front of the Plone instance.)
  • Even if the loading process in the browser is aborted the call from the Plone instance to the entered URL will still be kept open until either a response is received or the instance is restarted.

What should happen

The request to the external URL should time out after a certain time and an error message should be shown.

error at creating embedded page

Whenever I try to add a new embedded page I get following error at the end:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 371, in publish_module
  Module ZPublisher.WSGIPublisher, line 266, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module collective.embeddedpage.browser.embeddedpage, line 108, in __call__
  Module collective.embeddedpage.browser.embeddedpage, line 65, in process_page
  Module requests.api, line 76, in get
  Module requests.api, line 61, in request
  Module requests.sessions, line 542, in request
  Module requests.sessions, line 655, in send
  Module requests.adapters, line 516, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /index.html (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2c41e70d30>: Failed to establish a new connection: [Errno 111] Connection refused'))

Further information: I'm using Plone 5.2.4, latest collective.embeddedpage (=2.2.1), the html file in the url is very basic...
Thanks!

Volto support (REST API, Plone 5.2)

  • Write a serializer that does a request to the site under the "URL" attribute.
  • Plone RESTAPI returns a "normal" result in the text field:
text: {
  "data": "<p>HTML CODE FROM THE EMBEDDED PAGE</p>",
  "content-type": "text/html",
  "encoding": "utf-8"
}

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.