Пример #1
0
from Products.DataGridField.Column import Column

from collective.httpproxy import HTTPProxyMessageFactory as _
from collective.httpproxy.config import PROJECT_NAME
from collective.httpproxy.interfaces import IHTTPProxy


HTTPProxyBaseSchema = ATContentTypeSchema.copy()

HTTPProxySchema = HTTPProxyBaseSchema + atapi.Schema((
    atapi.StringField('remoteUrl',
        required=True,
        searchable=True,
        primary=True,
        widget = atapi.StringWidget(
            label = _(u'URL'),
            maxlength = '511',
        ),
    ),
    atapi.StringField('encoding',
        required = True,
        vocabulary_factory = "collective.httpproxy.vocabularies.encodings",
        default = 'utf8',
        widget = atapi.SelectionWidget(
            label=_(u"Encoding"),
            description=_(u"Encoding of the proxied content"),
            format='radio',
        ),
    ),
    DataGridField('tagsSelections',
        columns=("urlStart", "beginTag", "endTag"),
Пример #2
0
# -*- coding: utf-8 -*-

from collective.httpproxy import HTTPProxyMessageFactory as _
from collective.httpproxy.interfaces import IHTTPProxySettings
from plone.app.registry.browser.controlpanel import RegistryEditForm
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper
from plone.z3cform import layout


class HTTPProxyControlPanelForm(RegistryEditForm):
    schema = IHTTPProxySettings

HTTPProxyControlPanelView = layout.wrap_form(HTTPProxyControlPanelForm, ControlPanelFormWrapper)
HTTPProxyControlPanelView.label = _(u"HTTP Proxy settings")