loops site setup OK
This commit is contained in:
parent
6169a2d728
commit
2cf3569fcb
17 changed files with 136 additions and 143 deletions
|
@ -40,6 +40,7 @@
|
||||||
<include package="zope.app.zcmlfiles" file="menus.zcml" />
|
<include package="zope.app.zcmlfiles" file="menus.zcml" />
|
||||||
<include package="zope.app.authentication" />
|
<include package="zope.app.authentication" />
|
||||||
<include package="zope.app.security.browser" />
|
<include package="zope.app.security.browser" />
|
||||||
|
<include package="zope.app.catalog" />
|
||||||
<include package="zope.traversing.browser" />
|
<include package="zope.traversing.browser" />
|
||||||
<include package="zope.browserpage" />
|
<include package="zope.browserpage" />
|
||||||
<include package="zope.app.schema" />
|
<include package="zope.app.schema" />
|
||||||
|
|
|
@ -5,8 +5,8 @@ from zope.app.wsgi import config, getWSGIApplication
|
||||||
|
|
||||||
def run(app, config):
|
def run(app, config):
|
||||||
port = int(config.server_port)
|
port = int(config.server_port)
|
||||||
|
#print(f'Serving on port {port}.')
|
||||||
waitress.serve(app, port=port)
|
waitress.serve(app, port=port)
|
||||||
print(f'Serving on port {port}.')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
8
inst/loops/.env
Normal file
8
inst/loops/.env
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# loops/inst/bluebream/.env
|
||||||
|
|
||||||
|
SERVER_PORT=8800
|
||||||
|
|
||||||
|
DBNAME=ccotest
|
||||||
|
DBUSER=ccotest
|
||||||
|
DBPASSWORD=cco
|
||||||
|
DBSCHEMA=testing
|
|
@ -3,48 +3,32 @@
|
||||||
xmlns:browser="http://namespaces.zope.org/browser"
|
xmlns:browser="http://namespaces.zope.org/browser"
|
||||||
i18n_domain="main">
|
i18n_domain="main">
|
||||||
|
|
||||||
<!-- default bluebream libraries -->
|
<include file="../bluebream.zcml" />
|
||||||
<include file="bluebream.zcml" />
|
|
||||||
|
|
||||||
<include package="zope.app.zcmlfiles" />
|
<include package="zope.app.zcmlfiles" />
|
||||||
<include package="zope.app.catalog" />
|
|
||||||
<include package="zope.app.i18n" />
|
<include package="zope.app.i18n" />
|
||||||
<include package="zope.app.intid" />
|
<include package="zope.app.intid" />
|
||||||
<include package="zope.app.renderer" />
|
<include package="zope.app.renderer" />
|
||||||
<include package="zope.app.session" />
|
<include package="zope.app.session" />
|
||||||
<include package="zope.dublincore.browser" />
|
|
||||||
<include package="zope.intid" />
|
|
||||||
<include package="zope.sendmail" file="meta.zcml" />
|
<include package="zope.sendmail" file="meta.zcml" />
|
||||||
|
|
||||||
<!-- Security Policy -->
|
|
||||||
<include package="main" file="securitypolicy.zcml" />
|
<include package="main" file="securitypolicy.zcml" />
|
||||||
|
|
||||||
<!-- The following registration (defaultView) register 'index' as
|
|
||||||
the default view for a container. The name of default view
|
|
||||||
can be changed to a different value, for example, 'index.html'.
|
|
||||||
More details about defaultView registration is available here:
|
|
||||||
http://bluebream.zope.org/doc/1.0/howto/defaultview.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<browser:defaultView
|
<browser:defaultView
|
||||||
for="zope.container.interfaces.IContainer"
|
for="zope.container.interfaces.IContainer"
|
||||||
name="index.html" />
|
name="index.html" />
|
||||||
|
|
||||||
<!-- To remove the sample application delete the following line
|
|
||||||
and remove the `welcome` folder from this directory.
|
|
||||||
-->
|
|
||||||
<!--<include package=".welcome" />-->
|
|
||||||
|
|
||||||
<include package="cybertools" />
|
<include package="cybertools" />
|
||||||
<include package="cybertools.ajax.dojo" />
|
<include package="cybertools.ajax.dojo" />
|
||||||
<include package="cybertools.catalog" />
|
<include package="cybertools.catalog" />
|
||||||
<include package="cybertools.composer.layout" />
|
<include package="cybertools.composer.layout" />
|
||||||
<include package="cybertools.container" />
|
<include package="cybertools.container" />
|
||||||
<!--<include package="cybertools.pyscript" />-->
|
<!--<include package="cybertools.pyscript" />-->
|
||||||
<include package="cybertools.xedit" />
|
<!--<include package="cybertools.xedit" />-->
|
||||||
|
|
||||||
<include package="loops" />
|
<include package="loops" />
|
||||||
<!--<include package="loops.browser.flash" />-->
|
|
||||||
<include package="cco.schema" />
|
<!--<include package="cco.schema" />
|
||||||
<include package="cco.skin.r2" />
|
<include package="cco.skin.r2" />
|
||||||
<include package="cco.webapi" />
|
<include package="cco.webapi" />
|
||||||
<include package="ccq.cqportal" />
|
<include package="ccq.cqportal" />
|
||||||
|
@ -55,7 +39,7 @@
|
||||||
<include package="custom.cyberconcepts" />
|
<include package="custom.cyberconcepts" />
|
||||||
<include package="custom.omk" />
|
<include package="custom.omk" />
|
||||||
<include package="cyberapps.ccmkg" />
|
<include package="cyberapps.ccmkg" />
|
||||||
<include package="cyberapps.knowledge" />
|
<include package="cyberapps.knowledge" />-->
|
||||||
|
|
||||||
<!-- Override registrations -->
|
<!-- Override registrations -->
|
||||||
<includeOverrides package="main" file="overrides.zcml" />
|
<includeOverrides package="main" file="overrides.zcml" />
|
||||||
|
|
16
inst/loops/config.py
Normal file
16
inst/loops/config.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# loops/inst/loops/config.py
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
from os import getenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
|
server_port = getenv('SERVER_PORT', '8099')
|
||||||
|
|
||||||
|
# storage settings
|
||||||
|
from scopes.storage.db.postgres import StorageFactory
|
||||||
|
dbengine = 'postgresql+psycopg'
|
||||||
|
dbname = getenv('DBNAME', 'demo')
|
||||||
|
dbuser = getenv('DBUSER', 'demo')
|
||||||
|
dbpassword = getenv('DBPASSWORD', 'secret')
|
||||||
|
dbschema = getenv('DBSCHEMA', 'demo')
|
15
inst/loops/main.py
Normal file
15
inst/loops/main.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# loops/inst/loops/main.py
|
||||||
|
|
||||||
|
import waitress
|
||||||
|
from zope.app.wsgi import config, getWSGIApplication
|
||||||
|
|
||||||
|
def run(app, config):
|
||||||
|
port = int(config.server_port)
|
||||||
|
#print(f'Serving on port {port}.')
|
||||||
|
waitress.serve(app, port=port)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import config
|
||||||
|
app = getWSGIApplication('zope.conf')
|
||||||
|
run(app, config)
|
18
inst/loops/notfound.pt
Normal file
18
inst/loops/notfound.pt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<html
|
||||||
|
i18n:domain="zope">
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h3 i18n:translate="">
|
||||||
|
The page that you are trying to access is not available
|
||||||
|
</h3>
|
||||||
|
<br/>
|
||||||
|
<b i18n:translate="">Please note the following:</b>
|
||||||
|
<br/>
|
||||||
|
<ol>
|
||||||
|
<li i18n:translate=""> You might have misspelled the url </li>
|
||||||
|
<li i18n:translate="">
|
||||||
|
You might be trying to access a non-existing page
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -43,6 +43,6 @@
|
||||||
class="zope.app.exception.browser.notfound.NotFound"
|
class="zope.app.exception.browser.notfound.NotFound"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<include package="cco.member" />
|
<!--<include package="cco.member" />-->
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
39
inst/loops/zope.conf
Normal file
39
inst/loops/zope.conf
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# loops/inst/bluebream/zope.conf
|
||||||
|
# main zope configuration file for deployment
|
||||||
|
|
||||||
|
# Identify the component configuration used to define the site:
|
||||||
|
site-definition application.zcml
|
||||||
|
|
||||||
|
<zodb>
|
||||||
|
|
||||||
|
<filestorage>
|
||||||
|
path var/filestorage/Data.fs
|
||||||
|
blob-dir var/blob
|
||||||
|
</filestorage>
|
||||||
|
|
||||||
|
# Uncomment this if you want to connect to a ZEO server instead:
|
||||||
|
# <zeoclient>
|
||||||
|
# server localhost:8100
|
||||||
|
# storage 1
|
||||||
|
# # ZEO client cache, in bytes
|
||||||
|
# cache-size 20MB
|
||||||
|
# # Uncomment to have a persistent disk cache
|
||||||
|
# #client zeo1
|
||||||
|
# </zeoclient>
|
||||||
|
</zodb>
|
||||||
|
|
||||||
|
<eventlog>
|
||||||
|
# This sets up logging to both a file and to standard output (STDOUT).
|
||||||
|
# The "path" setting can be a relative or absolute filesystem path or
|
||||||
|
# the tokens STDOUT or STDERR.
|
||||||
|
|
||||||
|
<logfile>
|
||||||
|
path var/log/z3-deploy.log
|
||||||
|
formatter zope.exceptions.log.Formatter
|
||||||
|
</logfile>
|
||||||
|
|
||||||
|
<logfile>
|
||||||
|
path STDOUT
|
||||||
|
formatter zope.exceptions.log.Formatter
|
||||||
|
</logfile>
|
||||||
|
</eventlog>
|
|
@ -1,31 +1,11 @@
|
||||||
#
|
# loops.browser.mobile.default
|
||||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Default layouts for the loops mobile skin.
|
||||||
Default layouts for the loops mobile skin.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app.pagetemplate import ViewPageTemplateFile
|
from zope.app.pagetemplate import ViewPageTemplateFile
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.interface import implements
|
|
||||||
|
|
||||||
from cybertools.browser.renderer import RendererFactory
|
from cybertools.browser.renderer import RendererFactory
|
||||||
from cybertools.composer.layout.base import Layout
|
from cybertools.composer.layout.base import Layout
|
||||||
|
|
|
@ -5,35 +5,42 @@
|
||||||
xmlns:browser="http://namespaces.zope.org/browser"
|
xmlns:browser="http://namespaces.zope.org/browser"
|
||||||
i18n_domain="zope">
|
i18n_domain="zope">
|
||||||
|
|
||||||
<zope:utility factory="loops.config.base.GlobalOptions" />
|
<zope:utility factory="loops.config.base.GlobalOptions"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
|
|
||||||
<zope:adapter factory="loops.config.base.LoopsOptions" trusted="True" />
|
<zope:adapter factory="loops.config.base.LoopsOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
<zope:class class="loops.config.base.LoopsOptions">
|
<zope:class class="loops.config.base.LoopsOptions">
|
||||||
<allow interface="cybertools.meta.interfaces.IOptions" />
|
<allow interface="cybertools.meta.interfaces.IOptions" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
<zope:adapter factory="loops.config.base.TypeOptions" trusted="True" />
|
<zope:adapter factory="loops.config.base.TypeOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
<zope:class class="loops.config.base.TypeOptions">
|
<zope:class class="loops.config.base.TypeOptions">
|
||||||
<allow interface="cybertools.meta.interfaces.IOptions" />
|
<allow interface="cybertools.meta.interfaces.IOptions" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
<zope:adapter factory="loops.config.base.QueryOptions" trusted="True" />
|
<zope:adapter factory="loops.config.base.QueryOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
<zope:class class="loops.config.base.QueryOptions">
|
<zope:class class="loops.config.base.QueryOptions">
|
||||||
<allow interface="cybertools.meta.interfaces.IOptions" />
|
<allow interface="cybertools.meta.interfaces.IOptions" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
<zope:adapter factory="loops.config.base.PredicateOptions" trusted="True" />
|
<zope:adapter factory="loops.config.base.PredicateOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
<zope:class class="loops.config.base.PredicateOptions">
|
<zope:class class="loops.config.base.PredicateOptions">
|
||||||
<allow interface="cybertools.meta.interfaces.IOptions" />
|
<allow interface="cybertools.meta.interfaces.IOptions" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
<zope:adapter factory="loops.config.base.ConceptAdapterOptions" trusted="True" />
|
<zope:adapter factory="loops.config.base.ConceptAdapterOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions" />
|
||||||
<zope:class class="loops.config.base.ConceptAdapterOptions">
|
<zope:class class="loops.config.base.ConceptAdapterOptions">
|
||||||
<allow interface="cybertools.meta.interfaces.IOptions" />
|
<allow interface="cybertools.meta.interfaces.IOptions" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
<!-- backward compatibility -->
|
<!-- backward compatibility -->
|
||||||
<zope:adapter factory="loops.config.base.QueryOptions" trusted="True"
|
<zope:adapter factory="loops.config.base.QueryOptions" trusted="True"
|
||||||
|
provides="cybertools.meta.interfaces.IOptions"
|
||||||
for="loops.query.IQueryConcept" />
|
for="loops.query.IQueryConcept" />
|
||||||
|
|
||||||
<!-- query views -->
|
<!-- query views -->
|
||||||
|
@ -46,5 +53,4 @@
|
||||||
factory="loops.config.browser.ConfiguratorView"
|
factory="loops.config.browser.ConfiguratorView"
|
||||||
permission="zope.View" />
|
permission="zope.View" />
|
||||||
|
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -524,6 +524,5 @@
|
||||||
<include package=".system" />
|
<include package=".system" />
|
||||||
<include package=".versioning" />
|
<include package=".versioning" />
|
||||||
<include package=".wiki" />
|
<include package=".wiki" />
|
||||||
<include package=".xmlrpc" />
|
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -1,23 +1,6 @@
|
||||||
#
|
# loops.expert.standard
|
||||||
# Copyright (c) 2013 Helmut Merz helmutm@cy55.de
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" loops standard reports.
|
||||||
loops standard reports.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
@ -49,6 +32,6 @@ class TypeInstances(ReportInstance):
|
||||||
for t in self.targets:
|
for t in self.targets:
|
||||||
for c in t.getChildren([self.view.typePredicate]):
|
for c in t.getChildren([self.view.typePredicate]):
|
||||||
result.append(c)
|
result.append(c)
|
||||||
print '***', self.targets, result
|
print('***', self.targets, result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,6 @@
|
||||||
#
|
# loops.layout.browser.traveral
|
||||||
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Layout node traversers.
|
||||||
Layout node traversers.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app.container.traversal import ItemTraverser
|
from zope.app.container.traversal import ItemTraverser
|
||||||
|
@ -79,7 +60,7 @@ class NodeTraverser(ItemTraverser):
|
||||||
if obj is None:
|
if obj is None:
|
||||||
try:
|
try:
|
||||||
obj = super(NodeTraverser, self).publishTraverse(request, name)
|
obj = super(NodeTraverser, self).publishTraverse(request, name)
|
||||||
except NotFound, e:
|
except NotFound:
|
||||||
viewAnnotations['pageName'] = name
|
viewAnnotations['pageName'] = name
|
||||||
return self.context
|
return self.context
|
||||||
return obj
|
return obj
|
||||||
|
|
|
@ -1,27 +1,8 @@
|
||||||
#
|
# loops.media.browser.admin
|
||||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" View for regenerating all transformed media assets.
|
||||||
View for regenerating all transformed media assets.
|
|
||||||
|
|
||||||
Authors: Johann Schimpf, Erich Seifert.
|
Authors: Johann Schimpf, Erich Seifert.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
@ -72,7 +53,7 @@ class ChangeSubdirectories(object):
|
||||||
found += 1
|
found += 1
|
||||||
sp = obj._storageParams
|
sp = obj._storageParams
|
||||||
subdir = sp.get('subdirectory', '')
|
subdir = sp.get('subdirectory', '')
|
||||||
print subdir
|
print(subdir)
|
||||||
if self.search in subdir:
|
if self.search in subdir:
|
||||||
changed += 1
|
changed += 1
|
||||||
sp['subdirectory'] = subdir.replace(self.search, self.replace)
|
sp['subdirectory'] = subdir.replace(self.search, self.replace)
|
||||||
|
|
|
@ -1,32 +1,13 @@
|
||||||
#
|
# loops.target
|
||||||
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Adapter classes (proxies, in fact), for providing access to concepts and
|
||||||
Adapter classes (proxies, in fact), for providing access to concepts and
|
|
||||||
resources e.g. from forms that are called on view/node objects.
|
resources e.g. from forms that are called on view/node objects.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.i18nmessageid import MessageFactory
|
from zope.i18nmessageid import MessageFactory
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
from zope import schema
|
from zope import schema
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
|
||||||
|
@ -63,9 +44,9 @@ class TargetProxy(object):
|
||||||
title = property(getTitle, setTitle)
|
title = property(getTitle, setTitle)
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IConcept)
|
||||||
class ConceptProxy(TargetProxy):
|
class ConceptProxy(TargetProxy):
|
||||||
|
|
||||||
implements(IConcept)
|
|
||||||
adapts(IConceptView)
|
adapts(IConceptView)
|
||||||
|
|
||||||
def getConceptType(self): return self.target.conceptType
|
def getConceptType(self): return self.target.conceptType
|
||||||
|
@ -93,9 +74,9 @@ class ResourceProxy(TargetProxy):
|
||||||
contentType = property(getContentType, setContentType)
|
contentType = property(getContentType, setContentType)
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IDocument)
|
||||||
class DocumentProxy(ResourceProxy):
|
class DocumentProxy(ResourceProxy):
|
||||||
|
|
||||||
implements(IDocument)
|
|
||||||
adapts(IDocumentView)
|
adapts(IDocumentView)
|
||||||
|
|
||||||
def setData(self, data):
|
def setData(self, data):
|
||||||
|
@ -105,9 +86,9 @@ class DocumentProxy(ResourceProxy):
|
||||||
data = property(getData, setData)
|
data = property(getData, setData)
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IMediaAsset)
|
||||||
class MediaAssetProxy(ResourceProxy):
|
class MediaAssetProxy(ResourceProxy):
|
||||||
|
|
||||||
implements(IMediaAsset)
|
|
||||||
adapts(IMediaAssetView)
|
adapts(IMediaAssetView)
|
||||||
|
|
||||||
def setData(self, data): self.target.data = data
|
def setData(self, data): self.target.data = data
|
||||||
|
|
|
@ -36,6 +36,7 @@ dependencies = [
|
||||||
server = [
|
server = [
|
||||||
"waitress",
|
"waitress",
|
||||||
"ZConfig",
|
"ZConfig",
|
||||||
|
"zope.app.catalog",
|
||||||
"zope.app.form",
|
"zope.app.form",
|
||||||
"zope.app.intid",
|
"zope.app.intid",
|
||||||
"zope.app.publication",
|
"zope.app.publication",
|
||||||
|
|
Loading…
Add table
Reference in a new issue