loops site setup OK

This commit is contained in:
Helmut Merz 2024-09-29 12:05:53 +02:00
parent 6169a2d728
commit 2cf3569fcb
17 changed files with 136 additions and 143 deletions

View file

@ -40,6 +40,7 @@
<include package="zope.app.zcmlfiles" file="menus.zcml" />
<include package="zope.app.authentication" />
<include package="zope.app.security.browser" />
<include package="zope.app.catalog" />
<include package="zope.traversing.browser" />
<include package="zope.browserpage" />
<include package="zope.app.schema" />

View file

@ -5,8 +5,8 @@ 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)
print(f'Serving on port {port}.')
if __name__ == '__main__':

8
inst/loops/.env Normal file
View file

@ -0,0 +1,8 @@
# loops/inst/bluebream/.env
SERVER_PORT=8800
DBNAME=ccotest
DBUSER=ccotest
DBPASSWORD=cco
DBSCHEMA=testing

View file

@ -3,48 +3,32 @@
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="main">
<!-- default bluebream libraries -->
<include file="bluebream.zcml" />
<include file="../bluebream.zcml" />
<include package="zope.app.zcmlfiles" />
<include package="zope.app.catalog" />
<include package="zope.app.i18n" />
<include package="zope.app.intid" />
<include package="zope.app.renderer" />
<include package="zope.app.session" />
<include package="zope.dublincore.browser" />
<include package="zope.intid" />
<include package="zope.sendmail" file="meta.zcml" />
<!-- Security Policy -->
<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
for="zope.container.interfaces.IContainer"
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.ajax.dojo" />
<include package="cybertools.catalog" />
<include package="cybertools.composer.layout" />
<include package="cybertools.container" />
<!--<include package="cybertools.pyscript" />-->
<include package="cybertools.xedit" />
<!--<include package="cybertools.xedit" />-->
<include package="loops" />
<!--<include package="loops.browser.flash" />-->
<include package="cco.schema" />
<!--<include package="cco.schema" />
<include package="cco.skin.r2" />
<include package="cco.webapi" />
<include package="ccq.cqportal" />
@ -55,7 +39,7 @@
<include package="custom.cyberconcepts" />
<include package="custom.omk" />
<include package="cyberapps.ccmkg" />
<include package="cyberapps.knowledge" />
<include package="cyberapps.knowledge" />-->
<!-- Override registrations -->
<includeOverrides package="main" file="overrides.zcml" />

16
inst/loops/config.py Normal file
View 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
View 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
View 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>

View file

@ -43,6 +43,6 @@
class="zope.app.exception.browser.notfound.NotFound"
/>
<include package="cco.member" />
<!--<include package="cco.member" />-->
</configure>

39
inst/loops/zope.conf Normal file
View 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>

View file

@ -1,31 +1,11 @@
#
# 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
#
# loops.browser.mobile.default
"""
Default layouts for the loops mobile skin.
$Id$
""" Default layouts for the loops mobile skin.
"""
from zope.app.pagetemplate import ViewPageTemplateFile
from zope.cachedescriptors.property import Lazy
from zope import component
from zope.interface import implements
from cybertools.browser.renderer import RendererFactory
from cybertools.composer.layout.base import Layout

View file

@ -5,35 +5,42 @@
xmlns:browser="http://namespaces.zope.org/browser"
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">
<allow interface="cybertools.meta.interfaces.IOptions" />
</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">
<allow interface="cybertools.meta.interfaces.IOptions" />
</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">
<allow interface="cybertools.meta.interfaces.IOptions" />
</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">
<allow interface="cybertools.meta.interfaces.IOptions" />
</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">
<allow interface="cybertools.meta.interfaces.IOptions" />
</zope:class>
<!-- backward compatibility -->
<zope:adapter factory="loops.config.base.QueryOptions" trusted="True"
provides="cybertools.meta.interfaces.IOptions"
for="loops.query.IQueryConcept" />
<!-- query views -->
@ -46,5 +53,4 @@
factory="loops.config.browser.ConfiguratorView"
permission="zope.View" />
</configure>

View file

@ -524,6 +524,5 @@
<include package=".system" />
<include package=".versioning" />
<include package=".wiki" />
<include package=".xmlrpc" />
</configure>

View file

@ -1,23 +1,6 @@
#
# 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.expert.standard
"""
loops standard reports.
""" loops standard reports.
"""
from zope.cachedescriptors.property import Lazy
@ -49,6 +32,6 @@ class TypeInstances(ReportInstance):
for t in self.targets:
for c in t.getChildren([self.view.typePredicate]):
result.append(c)
print '***', self.targets, result
print('***', self.targets, result)
return result

View file

@ -1,25 +1,6 @@
#
# 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
#
# loops.layout.browser.traveral
"""
Layout node traversers.
$Id$
""" Layout node traversers.
"""
from zope.app.container.traversal import ItemTraverser
@ -79,7 +60,7 @@ class NodeTraverser(ItemTraverser):
if obj is None:
try:
obj = super(NodeTraverser, self).publishTraverse(request, name)
except NotFound, e:
except NotFound:
viewAnnotations['pageName'] = name
return self.context
return obj

View file

@ -1,27 +1,8 @@
#
# 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
#
# loops.media.browser.admin
"""
View for regenerating all transformed media assets.
""" View for regenerating all transformed media assets.
Authors: Johann Schimpf, Erich Seifert.
$Id$
"""
from logging import getLogger
@ -72,7 +53,7 @@ class ChangeSubdirectories(object):
found += 1
sp = obj._storageParams
subdir = sp.get('subdirectory', '')
print subdir
print(subdir)
if self.search in subdir:
changed += 1
sp['subdirectory'] = subdir.replace(self.search, self.replace)

View file

@ -1,32 +1,13 @@
#
# 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
#
# loops.target
"""
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.
$Id$
"""
from zope.cachedescriptors.property import Lazy
from zope.component import adapts
from zope.i18nmessageid import MessageFactory
from zope.interface import implements
from zope.interface import implementer
from zope import schema
from zope.security.proxy import removeSecurityProxy
@ -63,9 +44,9 @@ class TargetProxy(object):
title = property(getTitle, setTitle)
@implementer(IConcept)
class ConceptProxy(TargetProxy):
implements(IConcept)
adapts(IConceptView)
def getConceptType(self): return self.target.conceptType
@ -93,9 +74,9 @@ class ResourceProxy(TargetProxy):
contentType = property(getContentType, setContentType)
@implementer(IDocument)
class DocumentProxy(ResourceProxy):
implements(IDocument)
adapts(IDocumentView)
def setData(self, data):
@ -105,9 +86,9 @@ class DocumentProxy(ResourceProxy):
data = property(getData, setData)
@implementer(IMediaAsset)
class MediaAssetProxy(ResourceProxy):
implements(IMediaAsset)
adapts(IMediaAssetView)
def setData(self, data): self.target.data = data

View file

@ -36,6 +36,7 @@ dependencies = [
server = [
"waitress",
"ZConfig",
"zope.app.catalog",
"zope.app.form",
"zope.app.intid",
"zope.app.publication",