Testing new Helma features of generic object references and collections with the Image prototype
This commit is contained in:
parent
d21b54dc69
commit
36e0faf467
3 changed files with 102 additions and 23 deletions
|
@ -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
|
_db = antville
|
||||||
_table = AV_IMAGE
|
_table = AV_IMAGE
|
||||||
_id = IMAGE_ID
|
_id = IMAGE_ID
|
||||||
_prototype = IMAGE_PROTOTYPE
|
_prototype = IMAGE_PROTOTYPE
|
||||||
_parent = parent, site.images
|
_parent = parent, site.images
|
||||||
|
|
||||||
##
|
|
||||||
## object references
|
|
||||||
##
|
|
||||||
site = object(Site)
|
site = object(Site)
|
||||||
site.local = IMAGE_F_SITE
|
site.local = IMAGE_F_SITE
|
||||||
site.foreign = SITE_ID
|
site.foreign = SITE_ID
|
||||||
|
@ -15,9 +36,11 @@ layout = object(Layout)
|
||||||
layout.local = IMAGE_F_LAYOUT
|
layout.local = IMAGE_F_LAYOUT
|
||||||
layout.foreign = LAYOUT_ID
|
layout.foreign = LAYOUT_ID
|
||||||
|
|
||||||
parent = object(Image)
|
parent = object(HopObject)
|
||||||
parent.local = IMAGE_F_IMAGE_PARENT
|
parent.local.1 = IMAGE_PARENT
|
||||||
parent.foreign = IMAGE_ID
|
parent.foreign.1 = $id
|
||||||
|
parent.local.2 = IMAGE_PARENT_PROTOTYPE
|
||||||
|
parent.foreign.2 = $prototype
|
||||||
|
|
||||||
thumbnail = object(Image)
|
thumbnail = object(Image)
|
||||||
thumbnail.local = IMAGE_F_IMAGE_THUMB
|
thumbnail.local = IMAGE_F_IMAGE_THUMB
|
||||||
|
@ -31,9 +54,9 @@ modifier = object(User)
|
||||||
modifier.local = IMAGE_F_USER_MODIFIER
|
modifier.local = IMAGE_F_USER_MODIFIER
|
||||||
modifier.foreign = USER_ID
|
modifier.foreign = USER_ID
|
||||||
|
|
||||||
##
|
parentId = IMAGE_PARENT
|
||||||
## primitive properties
|
parentType = IMAGE_PARENT_PROTOTYPE
|
||||||
##
|
|
||||||
alias = IMAGE_ALIAS
|
alias = IMAGE_ALIAS
|
||||||
filename = IMAGE_FILENAME
|
filename = IMAGE_FILENAME
|
||||||
fileext = IMAGE_FILEEXT
|
fileext = IMAGE_FILEEXT
|
||||||
|
|
|
@ -1,9 +1,35 @@
|
||||||
##
|
##
|
||||||
## collections
|
## The Antville Project
|
||||||
|
## http://code.google.com/p/antville
|
||||||
##
|
##
|
||||||
_children = collection(Image)
|
## Copyright 2001-2007 by The Antville People
|
||||||
_children.local = SITE_ID
|
##
|
||||||
_children.foreign = IMAGE_F_SITE
|
## Licensed under the Apache License, Version 2.0 (the ``License'');
|
||||||
_children.order = IMAGE_CREATETIME desc
|
## you may not use this file except in compliance with the License.
|
||||||
_children.filter = IMAGE_PROTOTYPE = 'Image' and IMAGE_F_IMAGE_PARENT is null
|
## 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.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
|
||||||
|
|
|
@ -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
|
_extends = ImageMgr
|
||||||
|
|
||||||
##
|
_children = collection(LayoutImage)
|
||||||
## collections
|
|
||||||
##
|
## FIXME: All the following mappings are identical to ImageMgr.
|
||||||
_children = collection(LayoutImage)
|
## Is this a bug or feature that they don't get inherited?
|
||||||
_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.accessname = IMAGE_ALIAS
|
_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
|
||||||
|
|
Loading…
Add table
Reference in a new issue