Skip to main content

CastleCMS Plone distribution main package

Project description

.. image:: https://www.wildcardcorp.com/logo.png
:height: 50
:width: 382
:alt: Original work by wildcardcorp.com
:scale: 50 %


For access to Castle Cloud (our hosted CastleCMS service) or to request customizations or demos, please contact us at https://castlecms.io or https://wildcardcorp.com

info@wildcardcorp.com

+1 (715) 869-3440

=======================================
Welcome to the main CastleCMS package!
=======================================


Feature List
============

In addition to Plone standard features, CastleCMS includes:

- Login/lockout support
- Content archival to Amazon S3 storage
- Large files automatically moved to S3 storage
- Redis cache support
- Advanced content layout editor
- Improved management toolbar
- Intuitive content creation and organization
- Elasticsearch integration
- Search results tuned by social media impact
- Search results pinning
- Celery task queue integration (asynchronous actions)
- PDF generation
- Video conversion
- Amazon S3 interaction
- copying and pasting of large batches of items
- deletion and renaming of large batches of items
- Advanced content tiles:
- maps
- videos
- audio
- sliders
- galleries
- table of contents
- Audio and video content
- Automatic conversion of videos to web compatible format
- Search weighting based on popularity using Google Analytics API
- Content alias management
- Disqus commenting integration
- reCAPTCHA integration
- fullcalendar integration
- Google Business metadata
- Emergency notification system with optional SMS support
- Preview content on a variety of device sizes
- Map content
- KML feeds
- Social media integration with Twitter, Facebook, Pinterest
- Etherpad collaborative spaces support
- Stripping metadata from files
- Ability to view the site as another user
- Audit log, user activity reports
- Session management, inspection and termination
- Analytics dashboard
- De-duplication of uploaded images and files
- Trash can / recycle bin
- Two factor authentication


Installation
============

This package includes a lot of customizations to default Plone and, without an installer,
getting it running is a bit tricky.

Dependencies
------------

- Redis
- avconv (needs to be updated for ffmpeg again)
- ElasticSearch 2.3


Development setup on macOS
--------------------------

1. ``brew install redis elasticsearch libav python``
2. ``git clone git@github.com:castlecms/castle.cms.git``
3. ``cd castle.cms``
4. ``virtualenv -p python2.7 .``
5. ``bin/pip install --upgrade pip``
6. ``bin/pip install -r requirements.txt``
7. ``bin/buildout``
8. Run (in separate terminal windows) ``elasticsearch``, ``redis-server``, ``bin/instance fg`` and ``bin/celery worker``
9. Browse to http://localhost:8080/


Optional Dependencies
---------------------

- Install `argon2_cffi` to use more secure password hashing.
- https://github.com/castlecms/elasticsearch-castle-scoring
- https://github.com/castlecms/castlehps for faster search integration
- Amazon S3 credentials to store large files on S3
- Google API keys for Google analytics and Recaptcha integrations
- Plivo API for SMS


Running tests
=============

Default plone testing:

.. code-block:: shell

./bin/test -s castle.cms

To run only robot tests:
.. code-block:: shell
./bin/test -s castle.cms -t robot


Without robot:
.. code-block:: shell
./bin/test -s castle.cms -t \!robot

If you have errors complaining about warning, make sure the version of selenium
you're using works with the version of Firefox you have installed (see above)


Google Analytics Key File
-------------------------

- go to the Google API console
- create new credentials
- service account
- p12
- enable Analytics API api for credentials
- fill out email with email provided and p12 file in CastleCMS API settings
- use email for email you want to access and add it as an authorized user for the account in Google Analytics


Cron jobs
=========

CastleCMS uses many cron jobs that need to be setup.

Daily
-----

- ``bin/clean-plone-users``: removes disabled users
- ``bin/social-counts``: goes through all content and updates social media counts. Can be done monthly
- ``bin/content-popularity``: if Google Analytics is setup, will get content statistics for popularity
- ``bin/clean-drafts``: clean old draft data

Weekly
------

- ``bin/archive-content``: Archive content and send out warnings about content that will be archived
- ``bin/empty-trash``: Delete items that have been in trash for 30 days
- ``bin/send-forced-publish-alert``: Send update to admins about content that was forced-published


Processes
---------

- ``bin/twitter-monitor``: Monitor Twitter for mentions of your site
- ``bin/castle-crawler``: Crawl sites defined in crawler settings


Export/Import
-------------

CastleCMS provides a simple export/import mechanism that does not use transmogrifier.

You are still able to build your own custom transmogrifier pipelines to import/export
into CastleCMS; however, our scripts work in a lot of cases to get your
content moved over quickly.


Export
~~~~~~

Copy the export script into your existing site's main buildout folder::

https://raw.githubusercontent.com/castlecms/castle.cms/master/castle/cms/_scripts/export-content.py

Then, to run the export script::

./bin/client1 run export-content.py --site-id=mysiteid --dir=./export

where "client1" is a ZEO client of your site and "mysiteid" is the
ID of your Plone site.

To customize the export script so only parts of the site are exported,
you can change the final line in the script to a custom catalog query that
pulls in only the content you want to export.


Import
~~~~~~

Start by copying the exported directory (that you created in the previous step) to
the CastleCMS installation folder.

Next, copy the import script into your new CastleCMS site's main buildout folder::

https://raw.githubusercontent.com/castlecms/castle.cms/master/castle/cms/_scripts/importjson.py

Then, to run the import script::

./bin/client1 run importjson.py --site-id=mysiteid --export-directory=./export

where "client1" is a ZEO client of your site and "mysiteid" is the
ID of your CastleCMS site.


To register your own import type, using Event as an example::

from castle.cms._scripts.importtypes import BaseImportType
from castle.cms._scripts.importtypes import register_import_type
from castle.cms._scripts.importtypes import DateTime_to_datetime

class MyImportType(BaseImportType):
fields_mapping = {
# list of original field names to new field names
# 'startDate': 'start'
}
data_converters = {
# field name -> func(val) -> val
# convert data to the format it should be
# 'start': DateTime_to_datetime,
}
behavior_data_mappers = (
# (Behavior Interface, field name)
# to set behavior data from export data...
# (IEventBasic, 'start'),
)

def post_creation(self, obj):
'''
Additional custom data migration after object is created
''''
super(MyType, self).post_creation(obj)
obj.foo = 'bar'

register_import_type('MyType', MyImportType)



Tile display types
------------------

There are tiles provided by CastleCMS that allow you to customize
the display type. The display type field is a way of providing a different
view of the content.

Available display type tiles include the following (along with the matching display type vocabulary ID):

- Navigation (navigation)
- Existing content (existing)
- Gallery (gallery)
- Query Listing (querylisting)


Providing your own display types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are 3 components to registering a display type for a tile:
- Display type class
- Page template
- ZCML registration

Example custom display type
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is an example of creating a custom display type for the existing content tile.

Define the display type class::

class MyTileView(BaseTileView):
name = 'myview'
preview = '++plone++castle/path/to/image.png'
order = 1
index = ViewPageTemplateFile('myview.pt')
tile_name = 'existing'


Then define the template::

<tal:wrap tal:define="utils view/tile/utils;
data view/tile/data;
df view/tile/display_fields;
idt data/image_display_type|string:landscape;
existing nocall: view/tile/content|nothing;
url python: utils.get_object_url(existing);
has_image python: 'image' in df and utils.has_image(existing);">
<h3><a href="${url}">${existing/Title}</a></h3>
</tal:wrap>


Finally, define the ZCML to register it::

<adapter
name="existing.myview"
provides="castle.cms.interfaces.ITileView"
for="plone.dexterity.interfaces.IDexterityContent castle.cms.interfaces.ICastleLayer"
factory=".myview.MyTileView"
/>



Lead images
-----------

- all content has lead images
- lead images can be references to other images on the site or to other content on the site that has a lead image



CastleCMS upgrades
-------------------

There is currently no UI in the Site Setup to run CastleCMS
upgrades.

To run upgrades::

- go to the Management Interface (/manage) for your site
- click on portal_setup
- click the "Upgrades" tab
- select "castle.cms:default" and click "choose profile"
- from here, you should get a list of available upgrades to run


After the Deadline Spellchecking
--------------------------------

CastleCMS includes Plone's TinyMCE support for After the Deadline spellchecking and::

- supports After the Deadline in rich text tiles
- integrates spelling/grammar check within the content quality check dialog

To use After the Deadline, go to Site Setup and configure After the Deadline in the
TinyMCE configuration panel.



Building resources after changes to js
--------------------------------------

Just regular plone compile resources::

./bin/plone-compile-resources --site-id=Castle --bundle=plone
./bin/plone-compile-resources --site-id=Castle --bundle=plone-logged-in


Running local dependencies
--------------------------

$ docker run -p 6379:6379 redis


Forks/Custom releases
---------------------

Castle maintains forks and custom releases of packages ocassionally. Here is the
status and reasoning for our forks:

- plone.app.blocks: https://github.com/castlecms/plone.app.blocks
(Hard fork): Castle heavily customizes how Plone renders things including how "blocks" are rendered
- plone-app-mosaic: https://github.com/castlecms/plone.app.mosaic/tree/castlecms
(Hard fork, castlecms branch): Originally for fixes but at this point, we will maintain the fork
until we have reason not to or we have better alternative layout engines.
- plonetheme.barceloneta:
(Hard fork): Castle rendering of barceloneta. No Diazo.
- plone.app.registry
(Dev release): Release to get Plone 5.1 features into Castle based off Plone 5.0.
Can be removed once we go to 5.2
- plone.app.standardtiles
(Dev release): Unknown status on if we still need this release.
- Products.ZCatalog
(Dev release): unknown status
- z3c.relationfield
(Dev release): PR: https://github.com/zopefoundation/z3c.relationfield/pull/7
- mockup: https://github.com/plone/mockup/tree/2.4.x
(Dev release): TinyMCE backport fixes from 5.1
- Products-CMFPlone
(Dev release): TinyMCE backport fixes from 5.1 and bundle ordering bug: https://github.com/plone/Products.CMFPlone/pull/2632

Changelog
=========

2.2.2 (2018-11-26)
------------------

- fix mosaic build js/css


2.2.1 (2018-11-21)
------------------

- Upgrade CMFPlone to fix meta bundle ordering
[vangheem]

- Do not redirect to `/not-found`, just directly render not found template
[vangheem]

- Adding basic Robot testing setup
[obct537]

- Make recaptcha work with embeddable content tiles
[lucid-0]

- Since the carousel is behind aria-hidden, the whole thing is wisely skipped by screen readers. But still it is a requirement to not leave anchor tags empty https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-refs.html see 2.4.4 and https://www.w3.org/TR/2016/NOTE-WCAG20-TECHS-20161007/G91.
[RobZoneNet]

2.2.0 (2018-11-15)
------------------

- Accessibility colorblindness changes for editing buttons. The default bootstrap colors are mostly not accessible. Changed colors for things like notifications numbers, information messages, and some other buttons.
[RobZoneNet]

- Handle potentially weird ConnectionStateError on login
[vangheem]

- Be able to customize file upload fields
[vangheem]

- Show form errors in the mosaic interface so user knows if there
are required fields missing or errors in fields
[vangheem]

- Fixed the ability to click on "Add News Item" and getting the expected add news item modal.
[RobZoneNet]

- Fixes for folder_contents page. The query box layout and how it reacts to different widths
of a browser. Fixed the top tool bars as well for narrow browsers. Fixed colors for
dashboard search button due to failing colorblindness tests
[RobZoneNet]

- Clarified the add -- upload modal
[RobZoneNet]

- do not attempt to publish item is already published content with `@@publish-content` view.
[vangheem]

- Add "Manage Categories" tab to announcements control panel
[CorySanin]

- Upgrade mockup to fix dev mode on contents page
[vangheem]

- Rename some Castle -> CastleCMS titles and labels
[tkimnguyen]

- Fix potential querylisting unicode errors from form input
[vangheem]

- Fix the layout of the theming control panel buttons
[RobZoneNet]

- Fix accessibility issue with the querylisting templates injecting empty A tags
[RobZoneNet]

- Fix saving default values for Dexterity fields
[CorySanin]

- Handle potential errors caused by invalid references in folder ordering.
See https://github.com/plone/plone.folder/pull/10 for details
[vangheem]

- Fix resources references which was causing a bunch of 404 errors
[vangheem]

- Add Keyword Manager (Products.PloneKeywordManager) by default
[CorySanin]

- Remove _permissions DeprecationWarnings from startup
[CorySanin]

- Fix change password on login
[CorySanin]

- Various import/export fixes
[vangheem]

- Allow trailing slashes in backend URLs
[CorySanin]

- Use chunked upload on edit forms with NamedFile fields
[lucid-0]

- Allow custom FROM for announcement emails
[lucid-0]


2.1.1 (2018-10-02)
------------------

- Fix password reset function
[CorySanin]

- Fix not Schema AttributeError on export script
[vangheem]

- Add support for the path search parameter
[CorySanin]

- Update twitter embedding code and templates
[lucid-0]

2.1.0 (2018-09-26)
------------------

- Add support for the Subject:list search parameter
[CorySanin]

- Add password expiration option with whitelist
[CorySanin]

- Fixed a bug with the tab order on the login screen
[CorySanin]

- The button for creating a custom content type now defaults to cloning an existing one
[CorySanin]

- Hide field descriptions when not logged in
[CorySanin]

- Hide the Edit XML button from the Dexterity fields page unless "advanced mode" is enabled
[CorySanin]

- add info and warnings for missing REDIS_SERVER env var
[tkimnguyen]

- add copyright year to footer of new sites at create time
[tkimnguyen]

- handle Celery connection errors in Tasks control panel
[tkimnguyen]

- Rearranged image tile settings, clarified terminology
[CorySanin]

- import script fixes
[tkimnguyen]

- Use the image_url property for file_url when file is an image
[lucid-0]

- disallow logins from non-backend URLs, if set in Security panel; tweaks to field descriptions
[CorySanin]

- improve export and import scripts
[tkimnguyen]

- tweak find-broken-links.py script
[tkimnguyen]

- Changed collective.documentviewer dep. version
[obct537]

- Added status control panel to give users the status of relevant subprocesses
[mattjhess]

- in query listing tile, do not display event start/end if they don't exist
[tkimnguyen]


2.0.45 (2018-07-13)
-------------------

- add Event start and end datetimes to the query listing tile's views
[tkimnguyen]

- add Site Crawler control panel field descriptions
[tkimnguyen]

- check for when Twitter-related keys in twitter-monitor
[CorySanin]

- Added Beautifymarkers leaflet extension, adds map icon customization
[obct537]

- add celery environment vars for connecting to redis
[tkimnguyen]

- Added fragments directory ZCML directive
[obct537]

- Add Survey invite tile and controlpanel
[lucid-0]

- Replace deprecated 'mockup-patterns-base' with 'pat-base' in several files
[lucid-0]

2.0.44 (2018-05-08)
-------------------

- fix default news item layout
[tkimnguyen]

- add description to Etherpad fields
[tkimnguyen]

2.0.43 (2018-04-06)
-------------------

- Add simple display type to existing content tile (displays body of article)
[lucid-0]

- show relative and absolute datetimes in contents view
[robzonenet]

- change default site announcement text
[tkimnguyen]

- Change email category widget. Make subscribe title editable. Updated to work with Plone 5.0.x
[lucid-0]

2.0.42 (2018-03-01)
-------------------

- tweak tour text
[tkimnguyen]

- fix CastleCMS spelling
[tkimnguyen]

- tweak installation instructions
[tkimnguyen]

- add version pins
[tkimnguyen]

- remove duplicate location of site announcement settings
[tkimnguyen]

- correct typos; add descriptions to control panels
[tkimnguyen]

- improve URL shared via sharing buttons
[tkimnguyen]

2.0.41 (2017-09-26)
-------------------

- print.css improvements
[robzonenet]

2.0.40 (2017-09-26)
-------------------

- accessibility and print.css improvements
[robzonenet]

2.0.39 (2017-09-20)
-------------------

- 2-level nav improvements for mobile
[robzonenet]

2.0.38 (2017-09-18)
-------------------

- Fixed the missing print stylesheet
[robzonenet]


2.0.36 (2017-08-01)
-------------------

- Fixed issue breaking the history view on content
[obct537]


2.0.35 (2017-07-26)
-------------------

- Added in a 2 level navigation
[robzonenet]


2.0.34 (2017-07-03)
-------------------
- Changed map attribution string to include OpenStreepMap
[obct537]

- Fixed problem breaking content history view
[obct537]

- add new CastleCMS pypi classifiers
[lucid-0]

- Added a toolbar button to allow users to manually mark an object for archiving
[obct537]

2.0.33 (2017-05-8)
-------------------

- Site install now wont add duplicate slot tiles
[obct537]

- Original image scale now actually does something
[obct537]


2.0.32 (2017-04-28)
-------------------

- Better error pages with stacktrace info if it's possible to provide
[vangheem]

- Be able to modify comments made on a historic content object history data
[vangheem]

- Fix 404 not being protected by login shield.
[vangheem]

- After login should now redirect you to `/@@dashboard` or to the original
url you requested if you were redirected to login page
[vangheem]

- Updated defaults for the image tile
[obct537]


2.0.31 (2017-04-18)
-------------------

- Fix version pin for plone.app.content to work correctly with folder contents
and changing date properties
[vangheem]

- Build css/js with latest mockup but disable now/clear buttons on pickadate
so they are unstyled and look bad with castle.
[vangheem]

- Fix password reset template to send user's username instead of id
[vangheem]

- export-content.py now works to export dexterity and mosaic pages
[vangheem]

- fix crawling gz sitemaps
[vangheem]

- Resolved issue where the the words 'site settings' showed up when clicked
[robzonenet]

2.0.30 (2017-04-12)
-------------------

- Fix create user to send out correct password reset url
[vangheem]

- Handle issue getting current user when logging in. Can happen with authomatic
[vangheem]

- fix cases where generated absolute url was incorrect based on the original
result html not being used for the base path
[vangheem]

- Resolved issue where invalid sort parameters broke the querystring tile. Closes issue #42
[obct537]

- Resolved issue where the images were missing due to the url being wrong. Closes issue #17
[robzonenet]



2.0.29 (2017-04-04)
-------------------

- Change "Read transcript" link to "Transcript | Download"
[vangheem]
- Fix issue where a span tag was being added to the castle toolbar which is an accessibility issue.
[robzonenet]
- Fix accessibility issue of not having words in the cog button. The screen reader needs to read something.
[robzonenet]


2.0.28 (2017-03-28)
-------------------

- Use ssl for maps data urls
[vangheem]


2.0.27 (2017-03-27)
-------------------

- Fix issue where archetypes content in castle.cms would cause potentially
inconsistent search results.
[vangheem]


2.0.26 (2017-03-27)
-------------------

- Fix potential issue with upgrading to latest version of collective.elasticsearch
[vangheem]


2.0.25 (2017-03-27)
-------------------

- Fix regression from login fix
[vangheem]


2.0.24 (2017-03-27)
-------------------

- Do not require selection of images for gallery/slider tile so that query
field will work
[vangheem]


2.0.24 (2017-03-27)
-------------------

- Fix cron scripts to look in more locations for zope.conf
[vangheem]


2.0.23 (2017-03-27)
-------------------

- Be able to provide dynamic query for gallery and slider tiles
[vangheem]

- Fix issue where feature tile was not mobile friendly
[RobZoneNet]

- Provide link back to original image item from slider/gallery tiles
[vangheem]


2.0.22 (2017-03-27)
-------------------

- Fix case where query results would not correctly get results when using the filter.
[vangheem]


2.0.21 (2017-03-24)
-------------------

- Fix some cases where default plone workflow was assumed
[vangheem]


2.0.20 (2017-03-24)
-------------------

- Be able to specify external url for the image tile.
[vangheem]


2.0.19 (2017-03-23)
-------------------

- Fix case where default page would not be imported correctly on some sites. By
default import will always attempt to treat a lead image for folder content.
[vangheem]


2.0.18 (2017-03-22)
-------------------

- Make AtD support work with mosaic rich text tiles
[vangheem]

- Integrate AtD with quality check. If active, quality check will also notify
potential spelling/grammar issues.
[vangheem]


2.0.17 (2017-03-22)
-------------------

- Fix issue where empty lead images would get imported from old lead image package
and no filename would be found.
[vangheem]


2.0.16 (2017-03-21)
-------------------

- Fix event type to have lead image and search customization
[vangheem]

- Fix import of event type
[vangheem]


2.0.15 (2017-03-21)
-------------------

- Fix OFS missing import in importtypes
[vangheem]

- JSON feed now works with body option
[obct537]


2.0.14 (2017-03-20)
-------------------

- Provide information on lead image when inspecting history
[vangheem]

- Handle zeoserver errors for syndication
[vangheem]


2.0.13 (2017-03-20)
-------------------

- Fix invalid date issue from crawled pages on search results page
[vangheem]

- auto detect lead images from content in the layout
[vangheem]


2.0.12 (2017-03-15)
-------------------

- Fix paste button not working and throwing unauthorized errors because of
missing csrf token. Fixes #19
[vangheem]

- Automatically detect image in content if no lead image is set. Fixes #28
[vangheem]

- Fix showing non-image content on lead image browse selector. Fixes #30
[vangheem]

- Be able to provide additional views for the existing content tile
[vangheem]

- Be able to specify upload location
[vangheem]


2.0.11 (2017-03-09)
-------------------

- Fix image focus point upgrade issue where it would request more images than
it should
[vangheem]

- Provide image_url for json feed
[vangheem]

- If commenting enabled on a folder, it will become the default for all children
in that folder.
[vangheem]


2.0.10 (2017-02-06)
-------------------

- Fix next/prev nav fragment to work with pages and site root
[vangheem]

- Fix fullcalendar issue with selecting text when one is dropped on page.
This requires building with mockup on fix-jquery-event-drag-compat branch
or master once it's merged
[vangheem]

- Override default Zope2 logging to log actual plone username in Z2.log
[vangheem]


2.0.9 (2017-01-23)
------------------

- Add automatic session refresh support
[vangheem]


2.0.8 (2017-01-21)
------------------

- Be able to provide your own google maps api key so that working with the
mapping widget works more consistently.
[vangheem]

- Use argon2 pw encryption scheme by default
[vangheem]


2.0.7 (2017-01-18)
------------------

- Fix previous release


2.0.6 (2017-01-18)
------------------

- Fix logged in event not recorder in the audit log correctly
[vangheem]


2.0.5 (2017-01-18)
------------------

New:

- Add new JSON feed type
[vangheem]

Fixes:

- Fix parsing querylisting selected-year query
[vangheem]

- Fix parsing querylisting Title/SearchableText query
[vangheem]

2.0.4 (2017-01-09)
------------------

- add rocket chat integration
[sam schwartz]

- fix issue where password reset wasn't sticking
[vangheem]

- make sure logout page shows login form
[vangheem]

- add clean-drafts script
[vangheem]

- add ping draft view so that the clean-drafts script knows not to clean a potentially
active draft
[vangheem]

2.0.3 (2016-12-20)
------------------

- Be able to pass in a site object to the render_content_core function for
layout aware items
[vangheem]


2.0.2 (2016-12-14)
------------------

- build resources
[vangheem]

2.0.1 (2016-12-14)
------------------

- fix ipod/ipad safari video background image issue
[robzonenet]


2.0.0 (2016-12-07)
------------------

- Initial public release

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

castle.cms-2.2.2.tar.gz (6.9 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page