This repository has been archived by the owner on Jan 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Carr
committed
Oct 18, 2012
0 parents
commit 81a7672
Showing
34 changed files
with
2,678 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Metadata-Version: 1.0 | ||
Name: zkaffold | ||
Version: 0.0.8 | ||
Summary: Build out demonstration content for plone | ||
Home-page: http://pypi.python.org/pypi/zkaffold | ||
Author: Pat Smith | ||
Author-email: pat.smith@isotoma.com | ||
License: UNKNOWN | ||
Description: UNKNOWN | ||
Platform: UNKNOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
NAME | ||
---- | ||
|
||
zkaffold | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
A plone product to install content on a plone site. | ||
|
||
FEATURES | ||
-------- | ||
|
||
* Install content | ||
* Install products | ||
* Delete content | ||
* Apply zope interfaces | ||
* Modify content | ||
* Generate test content | ||
|
||
HOW TO INSTALL | ||
-------------- | ||
|
||
Add zkaffold to your product: | ||
|
||
* Add "zkaffold" to your product's install_requires in setup.py | ||
* Add <include package="zkaffold" /> in your product's configure.zcml | ||
* Add "profile-zkaffold:default" as a dependency to your product's | ||
metadata.xml | ||
* run ./bin/buildout | ||
|
||
Zkaffold should now be installed. Note that zkaffold is not installable / | ||
uninstallable from the portal quick installer. | ||
|
||
HOW TO USE | ||
---------- | ||
|
||
After installing zkaffold in your plone site, you can build content for | ||
your plone site by: | ||
|
||
* create "initial" profile in your product, | ||
* create a directory called "zkaffold" in profile/initial, | ||
* create structure.xml (example structure.xml is in | ||
zkaffold/exportimport/tests/test_exportimport.py), | ||
|
||
You can also create default users in your plone site by: | ||
|
||
* create members.xml (example members.xml is in | ||
zkaffold/exportimport/tests/test_exportimport.py) | ||
|
||
If you are using buildout, in your buildout.cfg: | ||
|
||
* in the [plonesite] section, add your product initial profile (e.g. | ||
mysite:initial) to "profiles-initial", | ||
* run ./bin/buildout | ||
|
||
Your plone site should now be populated with content specified in | ||
structure.xml. Note that if your plone site already exists before running | ||
buildout, it will not add any content. You'll have to delete your plone | ||
site or run the zkaffold import step to add the content. | ||
|
||
You can use different profiles to create different content, for example if | ||
you want test content, you can create another profile and add that in | ||
profiles-initial when you want test content to be built. | ||
|
||
Zkaffold publishes all objects by default by trying to apply transition | ||
"publish" to the objects. If your objects need a different way of | ||
publishing, have a look at | ||
zkaffold/exportimport/tests/test_exportimport.py. | ||
|
||
DEPENDENCIES | ||
------------ | ||
|
||
zkaffold depends on lxml, which depends on libxml2-dev and libxslt-dev. | ||
In Debian, you can use: | ||
|
||
* sudo aptitude install libxml2-dev libxslt-dev | ||
|
||
PLUGIN | ||
------ | ||
|
||
zkaffold supports a plugin system for exporting content: | ||
|
||
* Add an import step for your profile initial, | ||
* create an exporter for your field, it should return a | ||
lxml.etree.Element for <param> or (lxml.etree.Element for <param>, | ||
filename, file content):: | ||
|
||
def my_field_exporter(plone_object, field): | ||
... | ||
return param | ||
|
||
* create the import step to register the field exporter:: | ||
|
||
from zkaffold.contextexporter import IContentExporter | ||
|
||
def register_field_exporters(context): | ||
portal = context.getSite() | ||
sm = portal.getSiteManager() | ||
exporter = sm.getUtility(IContentExporter) | ||
exporter.register_field_exporter('mysite.fields.MyField', | ||
'mysite.field_exporters.my_field_exporter') | ||
|
||
TESTS | ||
----- | ||
|
||
To run zkaffold's tests, you need to: | ||
|
||
* add "zkaffold [test]" in the "eggs" in the [test] section of your | ||
buildout.cfg, | ||
* run ./bin/buildout, | ||
* ./bin/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[buildout] | ||
develop = . | ||
parts = test | ||
versions = versions | ||
extends = http://dist.plone.org/release/3.3.5/versions.cfg | ||
|
||
[zope] | ||
recipe = plone.recipe.zope2install | ||
url = http://www.zope.org/Products/Zope/2.10.11/Zope-2.10.11-final.tgz | ||
fake-zope-eggs = true | ||
|
||
[test] | ||
recipe = zc.recipe.testrunner | ||
eggs = zkaffold [test] | ||
defaults = ['--exit-with-status', '--auto-color', '--auto-progress'] | ||
extra-paths = ${zope:location}/lib/python | ||
|
||
[versions] | ||
zc.recipe.testrunner = 1.0.0 | ||
zc.recipe.egg = 1.2.3b2 | ||
zc.buildout = 1.4.3 | ||
zope.testing = 3.9.4 | ||
Products.LinguaPlone = 2.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[egg_info] | ||
tag_build = | ||
tag_date = 0 | ||
tag_svn_revision = 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup(name="zkaffold", | ||
version="0.0.8", | ||
description="Build out demonstration content for plone", | ||
author="Pat Smith", | ||
author_email="pat.smith@isotoma.com", | ||
url="http://pypi.python.org/pypi/zkaffold", | ||
packages=find_packages(), | ||
package_data={ | ||
'': ['*.zcml', '*.xml'], | ||
'zkaffold': [ | ||
'latinwords', | ||
'exportimport/tests/isotoma_logo.gif', | ||
'profiles/default/*'], | ||
}, | ||
include_package_data=True, | ||
install_requires=[ | ||
'z3c.autoinclude', | ||
'lxml', | ||
'DateTime', | ||
], | ||
extras_require={ | ||
'test': ['mock', 'Products.PloneTestCase', 'Plone'], | ||
}, | ||
entry_points=""" | ||
# -*- Entry points: -*- | ||
[z3c.autoinclude.plugin] | ||
target = plone | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Metadata-Version: 1.0 | ||
Name: zkaffold | ||
Version: 0.0.8 | ||
Summary: Build out demonstration content for plone | ||
Home-page: http://pypi.python.org/pypi/zkaffold | ||
Author: Pat Smith | ||
Author-email: pat.smith@isotoma.com | ||
License: UNKNOWN | ||
Description: UNKNOWN | ||
Platform: UNKNOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
README.rst | ||
buildout.cfg | ||
setup.py | ||
zkaffold/__init__.py | ||
zkaffold/build_site.py | ||
zkaffold/config.py | ||
zkaffold/configure.zcml | ||
zkaffold/consolehelpers.py | ||
zkaffold/contentexporter.py | ||
zkaffold/contentimporter.py | ||
zkaffold/latinwords | ||
zkaffold/main.py | ||
zkaffold/memberimporter.py | ||
zkaffold/setuphandlers.py | ||
zkaffold/wordy.py | ||
zkaffold.egg-info/PKG-INFO | ||
zkaffold.egg-info/SOURCES.txt | ||
zkaffold.egg-info/dependency_links.txt | ||
zkaffold.egg-info/entry_points.txt | ||
zkaffold.egg-info/requires.txt | ||
zkaffold.egg-info/top_level.txt | ||
zkaffold/exportimport/__init__.py | ||
zkaffold/exportimport/configure.zcml | ||
zkaffold/exportimport/tests/__init__.py | ||
zkaffold/exportimport/tests/isotoma_logo.gif | ||
zkaffold/exportimport/tests/test_exportimport.py | ||
zkaffold/profiles/default/metadata.xml | ||
zkaffold/profiles/default/zkaffold.txt | ||
zkaffold/tests/__init__.py | ||
zkaffold/tests/functional.py | ||
zkaffold/tests/test_contentexporter.py | ||
zkaffold/tests/test_contentimporter.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# -*- Entry points: -*- | ||
|
||
[z3c.autoinclude.plugin] | ||
target = plone | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
z3c.autoinclude | ||
lxml | ||
DateTime | ||
|
||
[test] | ||
mock | ||
Products.PloneTestCase | ||
Plone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zkaffold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# $Id$ | ||
|
||
''' | ||
__init__.py | ||
''' | ||
|
||
__author__ = 'Karen Chan <karen.chan@isotoma.com>' | ||
__docformat__ = 'restructuredtext en' | ||
__version__ = '$Revision$'[11:-2] | ||
|
||
def initialize(context): | ||
""" called when used as a Zope 2 product. """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# $Id: build_site.py 4550 2010-01-24 10:54:19Z karen $ | ||
|
||
''' | ||
build_site.py | ||
------------- | ||
''' | ||
|
||
__author__ = 'Karen Chan <karen@isotoma.com>' | ||
__docformat__ = 'restructuredtext en' | ||
__version__ = '$Revision: 4550 $'[11:-2] | ||
|
||
from Products.CMFPlone.utils import getFSVersionTuple | ||
from Products.CMFPlone.utils import getToolByName | ||
|
||
from consolehelpers import login | ||
|
||
def build_site(app, manager, site_name, productName=None): | ||
#login as manager | ||
app = login(app, manager) | ||
|
||
# Delete and re-create the portal | ||
if hasattr(app, site_name): | ||
print 'Deleting old portal' | ||
app.manage_delObjects(site_name) | ||
|
||
# Install the product | ||
version = getFSVersionTuple() | ||
factory = app.manage_addProduct['CMFPlone'] | ||
if version[0] <= 2: | ||
ext_id = '%s:default' % productName | ||
factory.addPloneSite(site_name, productName, extension_ids=(ext_id,)) | ||
else: | ||
# Plone 3 and above | ||
factory.addPloneSite(site_name) | ||
if productName: | ||
qi = getToolByName(getattr(app, site_name), 'portal_quickinstaller') | ||
qi.installProducts([productName,]) | ||
|
||
return app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# $Id$ | ||
|
||
''' | ||
config.py | ||
--------- | ||
Configuration for zkaffold | ||
''' | ||
|
||
__author__ = 'Karen Chan <karen@isotoma.com>' | ||
__docformat__ = 'restructuredtext en' | ||
__version__ = '$Revision$'[11:-2] | ||
|
||
PROJECTNAME = 'zkaffold' | ||
ZKAFFOLD_NAMESPACE = 'http://www.isotoma.com/zkaffold' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:five="http://namespaces.zope.org/five" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
xmlns:i18n="http://namespaces.zope.org/i18n" | ||
i18n_domain="zkaffold"> | ||
|
||
<five:registerPackage package="." initialize=".initialize" /> | ||
|
||
<genericsetup:registerProfile | ||
name="default" | ||
title="zkaffold" | ||
description="Build out demonstration content for plone" | ||
directory="profiles/default" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
/> | ||
|
||
<utility factory=".setuphandlers.HiddenProfiles" | ||
name="zkaffold" /> | ||
|
||
<utility factory=".setuphandlers.HiddenProducts" | ||
name="zkaffold" /> | ||
|
||
<include package=".exportimport" /> | ||
|
||
</configure> |
Oops, something went wrong.