Testing new Helma features of generic object references and collections with the Image prototype

This commit is contained in:
Tobi Schäfer 2007-06-24 17:11:06 +00:00
parent d21b54dc69
commit 36e0faf467
3 changed files with 102 additions and 23 deletions

View file

@ -1,12 +1,33 @@
##
## The Antville Project
## http://code.google.com/p/antville
##
## Copyright 2001-2007 by The Antville People
##
## Licensed under the Apache License, Version 2.0 (the ``License'');
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an ``AS IS'' BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## $Revision$
## $LastChangedBy$
## $LastChangedDate$
## $URL$
##
_db = antville
_table = AV_IMAGE
_id = IMAGE_ID
_prototype = IMAGE_PROTOTYPE
_parent = parent, site.images
##
## object references
##
site = object(Site)
site.local = IMAGE_F_SITE
site.foreign = SITE_ID
@ -15,9 +36,11 @@ layout = object(Layout)
layout.local = IMAGE_F_LAYOUT
layout.foreign = LAYOUT_ID
parent = object(Image)
parent.local = IMAGE_F_IMAGE_PARENT
parent.foreign = IMAGE_ID
parent = object(HopObject)
parent.local.1 = IMAGE_PARENT
parent.foreign.1 = $id
parent.local.2 = IMAGE_PARENT_PROTOTYPE
parent.foreign.2 = $prototype
thumbnail = object(Image)
thumbnail.local = IMAGE_F_IMAGE_THUMB
@ -31,9 +54,9 @@ modifier = object(User)
modifier.local = IMAGE_F_USER_MODIFIER
modifier.foreign = USER_ID
##
## primitive properties
##
parentId = IMAGE_PARENT
parentType = IMAGE_PARENT_PROTOTYPE
alias = IMAGE_ALIAS
filename = IMAGE_FILENAME
fileext = IMAGE_FILEEXT

View file

@ -1,9 +1,35 @@
##
## collections
## The Antville Project
## http://code.google.com/p/antville
##
_children = collection(Image)
_children.local = SITE_ID
_children.foreign = IMAGE_F_SITE
_children.order = IMAGE_CREATETIME desc
_children.filter = IMAGE_PROTOTYPE = 'Image' and IMAGE_F_IMAGE_PARENT is null
## Copyright 2001-2007 by The Antville People
##
## Licensed under the Apache License, Version 2.0 (the ``License'');
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an ``AS IS'' BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## $Revision$
## $LastChangedBy$
## $LastChangedDate$
## $URL$
##
_children = collection(Image)
_children.accessname = IMAGE_ALIAS
_children.local.1 = $id
_children.foreign.1 = IMAGE_PARENT
_children.local.2 = $prototype
_children.foreign.2 = IMAGE_PARENT_PROTOTYPE
_children.order = IMAGE_CREATETIME desc
#_children.filter = IMAGE_F_IMAGE_PARENT is null

View file

@ -1,11 +1,41 @@
##
## The Antville Project
## http://code.google.com/p/antville
##
## Copyright 2001-2007 by The Antville People
##
## Licensed under the Apache License, Version 2.0 (the ``License'');
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an ``AS IS'' BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## $Revision$
## $LastChangedBy$
## $LastChangedDate$
## $URL$
##
_extends = ImageMgr
##
## collections
##
_children = collection(LayoutImage)
_children.local = LAYOUT_ID
_children.foreign = IMAGE_F_LAYOUT
_children.filter = IMAGE_PROTOTYPE = 'LayoutImage' and IMAGE_F_IMAGE_PARENT is null
_children.order = IMAGE_CREATETIME desc
_children = collection(LayoutImage)
## FIXME: All the following mappings are identical to ImageMgr.
## Is this a bug or feature that they don't get inherited?
_children.accessname = IMAGE_ALIAS
_children.local.1 = $id
_children.foreign.1 = IMAGE_PARENT
_children.local.2 = $prototype
_children.foreign.2 = IMAGE_PARENT_PROTOTYPE
_children.order = IMAGE_CREATETIME desc
#_children.filter = IMAGE_F_IMAGE_PARENT is null