| |
- Acquisition.Acquirer
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
- OFS.SimpleItem.Item(ExtensionClass.Base, webdav.Resource.Resource, OFS.CopySupport.CopySource, App.Management.Tabs, OFS.Traversable.Traversable, OFS.ZDOM.Element, AccessControl.Owned.Owned, App.Undo.UndoSupport)
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
- App.PersistentExtra.Persistent
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
- OFS.PropertyManager.PropertyManager(ExtensionClass.Base, OFS.ZDOM.ElementWithAttributes)
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
- AccessControl.Role.RoleManager(ExtensionClass.Base, AccessControl.PermissionMapping.RoleManager)
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
- ZMapWMS.WMS.WMSClient.WMSClient
-
- WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item)
class WMSAdapter(ZMapWMS.WMS.WMSClient.WMSClient, Acquisition.Acquirer, App.PersistentExtra.Persistent, OFS.PropertyManager.PropertyManager, AccessControl.Role.RoleManager, OFS.SimpleItem.Item) |
|
WMS Adapter for Zope.
WMSAdapter provides a Zope-friendly interface to OGC WMS services. Allows
external servers to be cataloged and searched and provides methods to
conveniently access map imagery and server capabilities.
Methods that Zope site developers will use are:
capabilities(): return an XML document describing server capabilities
draw(): return spatially-referenced map imagery
map_url(): return a URL to spatially-referenced map imagery |
|
- COPY(self, REQUEST, RESPONSE)
- Create a duplicate of the source resource whose state
and behavior match that of the source resource as closely
as possible. Though we may later try to make a copy appear
seamless across namespaces (e.g. from Zope to Apache), COPY
is currently only supported within the Zope namespace.
- DELETE(self, REQUEST, RESPONSE)
- Delete a resource. For non-collection resources, DELETE may
return either 200 or 204 (No Content) to indicate success.
- HEAD(self, REQUEST, RESPONSE)
- Retrieve resource information without a response body.
- LOCK(self, REQUEST, RESPONSE)
- Lock a resource
- MKCOL(self, REQUEST, RESPONSE)
- Create a new collection resource. If called on an existing
resource, MKCOL must fail with 405 (Method Not Allowed).
- MOVE(self, REQUEST, RESPONSE)
- Move a resource to a new location. Though we may later try to
make a move appear seamless across namespaces (e.g. from Zope
to Apache), MOVE is currently only supported within the Zope
namespace.
- OPTIONS(self, REQUEST, RESPONSE)
- Retrieve communication options.
- PROPFIND(self, REQUEST, RESPONSE)
- Retrieve properties defined on the resource.
- PROPPATCH(self, REQUEST, RESPONSE)
- Set and/or remove properties defined on the resource.
- PUT(self, REQUEST, RESPONSE)
- Replace the GET response entity of an existing resource.
Because this is often object-dependent, objects which handle
PUT should override the default PUT implementation with an
object-specific implementation. By default, PUT requests
fail with a 405 (Method Not Allowed).
- TRACE(self, REQUEST, RESPONSE)
- Return the HTTP message received back to the client as the
entity-body of a 200 (OK) response. This will often usually
be intercepted by the web server in use. If not, the TRACE
request will fail with a 405 (Method Not Allowed), since it
is not often possible to reproduce the HTTP request verbatim
from within the Zope environment.
- UNLOCK(self, REQUEST, RESPONSE)
- Remove an existing lock on a resource.
- __class_init__ = default__class_init__(self)
- __init__(self, online_resource)
- Initialize instance from a WMS Online Resource URL.
- __len__(self)
- _addRole(self, role, REQUEST=None)
- _canCopy(self, op=0)
- Called to make sure this object is copyable. The op var
is 0 for a copy, 1 for a move.
- _delPropValue(self, id)
- _delProperty(self, id)
- _delRoles(self, roles, REQUEST)
- _deleteOwnershipAfterAdd(self)
- _getCopy(self, container)
- _has_user_defined_role(self, role)
- _isBeingAccessedAsZClassDefinedInstanceMethod(self)
- _isBeingUsedAsAMethod(self, REQUEST=None, wannaBe=0)
- _notifyOfCopyTo(self, container, op=0)
- Overide this to be pickly about where you go! If you dont
want to go there, raise an exception. The op variable is
0 for a copy, 1 for a move.
- _postCopy(self, container, op=0)
- _propertyMap(self)
- Return a tuple of mappings, giving meta-data for properties
- _setId(self, id)
- _setPropValue(self, id, value)
- _setProperty(self, id, value, type='string')
- _setRoles(self, acl_type, acl_roles)
- _updateProperty(self, id, value)
- _wrapperCheck(self, object)
- absolute_url(self, relative=0)
- ac_inherited_permissions(self, all=0)
- access_debug_info(self)
- Return debug info
- acquiredRolesAreUsedBy(self, permission)
- used by management screen
- bobobase_modification_time(self)
- capabilities(self)
- Return as a string the XML document describing server capabilities.
A server's capabilities document enumerates all the acceptable values
for arguments to WMSAdapter's draw() and map_url() methods.
- cb_isCopyable(self)
- cb_isMoveable(self)
- cb_userHasCopyOrMovePermission(self)
- changeOwnership(self, user, recursive=0, aq_get=<built-in function aq_get>, None=None)
- Change the ownership to the given user. If 'recursive' is
true then also take ownership of all sub-objects, otherwise
sub-objects retain their ownership information.
- class_manage_path(self)
- dav__init(self, request, response)
- dav__simpleifhandler(self, request, response, method='PUT', col=0, url=None, refresh=0)
- dav__validate(self, object, methodname, REQUEST)
- draw(self, format, width, height, srs, bbox, layers, styles=(), transparent=0, bgcolor='#FFFFFF', exceptions=None)
- Draw map imagery and return image data in a string.
Arguments correspond to those required by the WMS specification
but take their most natural Python forms. The external server's
capabilities document is the final word for the allowed values
for any of these arguments.
Potential usage is something like this::
from PIL import Image
import StringIO
srs = 4326 # WGS 1984
bbox = {'minx': -107.0, 'miny': 39.0, 'maxx': -106.0, 'maxy': 40.0}
layers = ('layer1','layer2')
# wms is a WMS Adapter instance
image_data = wms.draw('image/png', 200, 200, srs, bbox, layers)
img = Image.open(StringIO.StringIO(image_data))
Parameters:
- format: name of one of the mime types offered by the server
- width: map image width in pixels
- height: map image height in pixels
- srs: integer EPSG code defining the requested spatial reference
system
- bbox: dictionary containing the spatial bounding box for map
imagery. Keys are 'minx', 'miny', 'maxx', 'maxy'
- layers: sequence of layer names in drawing order
- styles: sequence of style names for layers in same drawing order.
An empty sequence is interpreted by the server as a request for
default styles, otherwise the length of styles must equal the length
of the layers sequence
- transparent: 1 for transparent map background, 0 for opaque
- bgcolor: hexidecimal color in #RRGGBB format, default is #FFFFFF
- exceptions: name of one of the exception formats offered by the
server. All servers support the default XML exception, but better
servers may offer support for exceptions written to an image. Check
the server's capabilities.
- filtered_manage_options(self, REQUEST=None)
- getAttribute(self, name)
- Retrieves an attribute value by name.
- getAttributeNode(self, name)
- Retrieves an Attr node by name or None if
there is no such attribute.
- getAttributes(self)
- Returns a NamedNodeMap containing the attributes
of this node (if it is an element) or None otherwise.
- getCapabilities(self, resource, version)
- Return a WMS capabilities XML document
- getCapabilitiesURL(self, resource, version)
- Return the URL to the capabilities
- getChildNodes(self)
- Returns a NodeList that contains all children of this node.
If there are no children, this is a empty NodeList
- getElementsByTagName(self, tagname)
- Returns a NodeList of all the Elements with a given tag
name in the order in which they would be encountered in a
preorder traversal of the Document tree. Parameter: tagname
The name of the tag to match (* = all tags). Return Value: A new
NodeList object containing all the matched Elements.
- getFirstChild(self)
- The first child of this node. If there is no such node
this returns None
- getId(self)
- Return the id of the object as a string. This method
should be used in preference to accessing an id attribute
of an object directly. The getId method is public.
- getLastChild(self)
- The last child of this node. If there is no such node
this returns None.
- getMap(self, resource, version, format, width, height, srs, bbox, layers, styles=(), transparent=None, bgcolor=None, exceptions=None)
- Return the map
- getMapURL(self, resource, version, format, width, height, srs, bbox, layers, styles=(), transparent=None, bgcolor=None, exceptions=None)
- Return the URL to the map
- getNextSibling(self)
- The node immediately preceding this node. If
there is no such node, this returns None.
- getNodeName(self)
- The name of this node, depending on its type
- getNodeType(self)
- A code representing the type of the node.
- getNodeValue(self)
- The value of this node, depending on its type
- getOwner(self, info=0, aq_get=<built-in function aq_get>, None=None, UnownableOwner=[], getSecurityManager=<function getSecurityManager>)
- Get the owner
If a true argument is provided, then only the owner path and id are
returned. Otherwise, the owner object is returned.
- getOwnerDocument(self)
- The Document object associated with this node.
When this is a document this is None
- getParentNode(self)
- The parent of this node. All nodes except Document
DocumentFragment and Attr may have a parent
- getPhysicalPath(self)
- Returns a path (an immutable sequence of strings)
that can be used to access this object again
later, for example in a copy/paste operation. getPhysicalRoot()
and getPhysicalPath() are designed to operate together.
- getPreviousSibling(self)
- The node immediately preceding this node. If
there is no such node, this returns None.
- getProperty(self, id, d=None)
- Get the property 'id', returning the optional second
argument or None if no such property is found.
- getPropertyType(self, id)
- Get the type of property 'id', returning None if no
such property exists
- getTagName(self)
- The name of the element
- get_local_roles(self)
- get_local_roles_for_userid(self, userid)
- get_request_var_or_attr(self, name, default)
- get_valid_userids(self)
- hasChildNodes(self)
- Returns true if the node has any children, false
if it doesn't.
- hasProperty(self, id)
- Return true if object has a property 'id'
- has_local_roles(self)
- http__etag(self, readonly=0)
- http__parseMatchList(self, REQUEST, header='if-match')
- http__processMatchHeaders(self, REQUEST=None)
- http__refreshEtag(self)
- locked_in_version(self)
- Was the object modified in any version?
- manage(self, URL1)
- manage_FTPlist(self, REQUEST)
- Directory listing for FTP. In the case of non-Foldoid objects,
the listing should contain one object, the object itself.
- manage_FTPstat(self, REQUEST)
- psuedo stat, used by FTP for directory listings
- manage_access(self, REQUEST, **kw)
- Return an interface for making permissions settings
- manage_acquiredPermissions(self, permissions=[], REQUEST=None)
- Change the permissions that acquire
- manage_addLocalRoles(self, userid, roles, REQUEST=None)
- Set local roles for a user.
- manage_addProperty(self, id, value, type, REQUEST=None)
- Add a new property via the web. Sets a new property with
the given id, type, and value.
- manage_afterAdd(self, item, container)
- manage_afterClone(self, item)
- manage_beforeDelete(self, item, container)
- manage_changeOwnershipType(self, explicit=1, RESPONSE=None, REQUEST=None)
- Change the type (implicit or explicit) of ownership.
- manage_changePermissions(self, REQUEST)
- Change all permissions settings, called by management screen
- manage_changeProperties(self, REQUEST=None, **kw)
- Change existing object properties.
Change object properties by passing either a mapping object
of name:value pairs {'foo':6} or passing name=value parameters
- manage_changePropertyTypes(self, old_ids, props, REQUEST=None)
- Replace one set of properties with another
Delete all properties that have ids in old_ids, then add a
property for each item in props. Each item has a new_id,
new_value, and new_type. The type of new_value should match
new_type.
- manage_defined_roles(self, submit=None, REQUEST=None)
- Called by management screen.
- manage_delLocalRoles(self, userids, REQUEST=None)
- Remove all local roles for a user.
- manage_delProperties(self, ids=None, REQUEST=None)
- Delete one or more properties specified by 'ids'.
- manage_editProperties(self, REQUEST)
- Edit object properties via the web.
The purpose of this method is to change all property values,
even those not listed in REQUEST; otherwise checkboxes that
get turned off will be ignored. Use manage_changeProperties()
instead for most situations.
- manage_editRoles(self, REQUEST, acl_type='A', acl_roles=[])
- manage_editedDialog(self, REQUEST, **args)
- manage_fixupOwnershipAfterAdd(self)
- manage_getPermissionMapping(self)
- Return the permission mapping for the object
This is a list of dictionaries with:
permission_name -- The name of the native object permission
class_permission -- The class permission the permission is
mapped to.
- manage_permission(self, permission_to_manage, roles=[], acquire=0, REQUEST=None)
- Change the settings for the given permission
If optional arg acquire is true, then the roles for the permission
are acquired, in addition to the ones specified, otherwise the
permissions are restricted to only the designated roles.
- manage_role(self, role_to_manage, permissions=[], REQUEST=None)
- Change the permissions given to the given role
- manage_setLocalRoles(self, userid, roles, REQUEST=None)
- Set local roles for a user.
- manage_setPermissionMapping(self, permission_names=[], class_permissions=[], REQUEST=None)
- Change the permission mapping
- manage_takeOwnership(self, REQUEST, RESPONSE, recursive=0)
- Take ownership (responsibility) for an object. If 'recursive'
is true, then also take ownership of all sub-objects.
- manage_undo_transactions(self, transaction_info=(), REQUEST=None)
- manage_workspace(self, REQUEST)
- Dispatch to first interface in manage_options
- map_url(self, format, width, height, srs, bbox, layers, styles=(), transparent=0, bgcolor='#FFFFFF', exceptions=None)
- Return a URL to map imagery from external WMS server.
More efficient than than the draw method for many applications.
Arguments correspond to those required by the WMS specification
but take their most natural Python forms. The external server's
capabilities document is the final word for the allowed values for
any of these arguments.
Potential usage in a Zope Page Template is something like this:
<span tal:define="srs python:4326";
bbox python:{'minx': -107.0, 'miny': 39.0,
'maxx': -106.0, 'maxy': 40.0};
layers python:('layer1','layer2')">
<!-- wms is a WMS Adapter instance -->
<img tal:attributes="src
python:wms.map_url('image/png', 200, 200, srs. bbox, layers)">
Parameters:
- format: name of one of the mime types offered by the server
- width: map image width in pixels
- height: map image height in pixels
- srs: integer EPSG code defining the requested spatial reference
system
- bbox: dictionary containing the spatial bounding box for map
imagery. Keys are 'minx', 'miny', 'maxx', 'maxy'
- layers: sequence of layer names in drawing order
- styles: sequence of style names for layers in same drawing order.
An empty sequence is interpreted by the server as a request for
default styles, otherwise the length of styles must equal the length
of the layers sequence
- transparent: 1 for transparent map background, 0 for opaque
- bgcolor: hexidecimal color in #RRGGBB format, default is #FFFFFF
- exceptions: name of one of the exception formats offered by the
server. All servers support the default XML exception, but better
servers may offer support for exceptions written to an image. Check
the server's capabilities.
- modified_in_version(self)
- Was the object modified in this version?
- objectIds = objectValues(self, spec=None)
- # This keeps simple items from acquiring their parents
# objectValues, etc., when used in simple tree tags.
- objectItems = objectValues(self, spec=None)
- # This keeps simple items from acquiring their parents
# objectValues, etc., when used in simple tree tags.
- objectValues(self, spec=None)
- # This keeps simple items from acquiring their parents
# objectValues, etc., when used in simple tree tags.
- overview_map_tag(self, format, width, layer)
- Return an <img> tag providing a full-extent layer overview
Used in the Map Overview management tab.
Parameters:
- format: name of one of the mime types offered by the server
- width: map width in pixels, height will be determined by layer
extent
- layer: name of a top-level layer
- overview_map_url(self, format, width, layer)
- Return a url to imagery providing a full-extent layer overview
Used in the Map Overview management tab.
Parameters:
- format: name of one of the mime types offered by the server
- width: map width in pixels, height will be determined by layer
extent
- layer: name of a top-level layer
- owner_info(self)
- Get ownership info for display
- permission_settings(self)
- Return user-role permission settings
- permissionsOfRole(self, role)
- used by management screen
- possible_permissions(self)
- propdict(self)
- propertyIds(self)
- Return a list of property ids
- propertyItems(self)
- Return a list of (id,property) tuples
- propertyLabel(self, id)
- Return a label for the given property id
- propertyMap(self)
- Return a tuple of mappings, giving meta-data for properties.
Return copies of the real definitions for security.
- propertyValues(self)
- Return a list of actual property objects
- raise_standardErrorMessage(self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=<built-in method search of SRE_Pattern object>, error_log_url='')
- restrictedTraverse(self, path, default=[])
- rolesOfPermission(self, permission)
- used by management screen
- tabs_path_default(self, REQUEST, unquote=<function unquote>)
- tabs_path_info(self, script, path, quote=<function quote>)
- this(self)
- title_and_id(self)
- Utility that returns the title if it is not blank and the id
otherwise. If the title is not blank, then the id is included
in parens.
- title_or_id(self)
- Utility that returns the title if it is not blank and the id
otherwise.
- tpURL(self)
- tpValues(self)
- undoable_transactions(self, first_transaction=None, last_transaction=None, PrincipiaUndoBatchSize=None)
- unrestrictedTraverse(self, path, default=[], restricted=0)
- userCanTakeOwnership(self)
- userdefined_roles(self)
- Return list of user-defined roles
- users_with_local_role(self, role)
- validRoles = valid_roles(self)
- Return list of valid roles
- valid_property_id(self, id)
- valid_roles(self)
- Return list of valid roles
- validate_roles(self, roles)
- Return true if all given roles are valid
- wl_clearLocks(self)
- wl_delLock(self, locktoken)
- wl_getLock(self, locktoken)
- wl_hasLock(self, token, killinvalids=0)
- wl_isLocked(self)
- wl_lockItems(self, killinvalids=0)
- wl_lockTokens(self, killinvalids=0)
- wl_lockValues(self, killinvalids=0)
- wl_lockmapping(self, killinvalids=0, create=0)
- if 'killinvalids' is 1, locks who are no longer valid
will be deleted
- wl_setLock(self, locktoken, lock)
| |