-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cmfdocument from CMFDefault to allow testing
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 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 |
---|---|---|
@@ -1 +1,13 @@ | ||
# And as if by magic, this folder is a python package | ||
# initialize cmf test content | ||
from Products.CMFCore import permissions | ||
|
||
def initialize(context): | ||
import Products.contentmigration.testcontent | ||
from Products.CMFCore import utils | ||
utils.ContentInit( | ||
'CMF Default Content', | ||
content_types=(), | ||
permission=permissions.AddPortalContent, | ||
extra_constructors=(testcontent.addDocument,), | ||
visibility=None, | ||
).initialize(context) |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:five="http://namespaces.zope.org/five" | ||
i18n_domain="Products.contentmigration"> | ||
|
||
<five:registerPackage package="." initialize=".initialize" /> | ||
|
||
</configure> |
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
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,25 @@ | ||
from App.class_init import InitializeClass | ||
from Products.Archetypes import atapi | ||
from Products.CMFCore.PortalContent import PortalContent | ||
from zope.component.factory import Factory | ||
|
||
def addDocument(self, id, title='', description='', text_format='', text=''): | ||
"""Add a Document. | ||
""" | ||
o = Document(id, title, description, text_format, text) | ||
self._setObject(id, o, suppress_events=True) | ||
|
||
|
||
class Document(PortalContent): | ||
""" A Document """ | ||
|
||
def __init__(self, id, title='', description='', text_format='', text=''): | ||
self.id = id | ||
self.title = title | ||
self.description = description | ||
|
||
def Title(self): | ||
return self.title | ||
|
||
InitializeClass(Document) | ||
DocumentFactory = Factory(Document) |
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