Project

General

Profile

« Previous | Next » 

Revision 458f7c28

Added by Marc Dequènes about 15 years ago

  • ID 458f7c287463d610baa96fc027f5e50a69bb1f76

[evol] limit parent location/type for item creation (not yet properly integrated)

View differences:

TODO
- ensure creating/modifying the root DSA object is possible (using the "root" handle" ?)
- improve configuration:
* allow global relations to share them among objects ???
- select parent at creation with :parent if present, or use
a default location (object-specific) ? this could be integrated in
a common code to be able to relocate an item
- find a way to restrict parent locations for new objects (regex for
<obj>/<item> string ? regex for DN ? OR/AND with both ? ???)
- search by family relationship ?
- handle language subtypes ? (would need the RFC2798 preferredLanguage
parser out of the CyborgHood project)
bin/shadowwalker
obj_klass, item_hdl = params_shift_item_handle_full_handle(args, false)
loc_obj_klass, loc_item = params_shift_item_handle_full_handle(args, true, "parent full-handle")
# TODO: move this in LdapShadows::Manipulation
p_hdl_restr = obj_klass.parameters[:mapping][:parent_handle_restrictions]
unless p_hdl_restr.nil? or loc_item.full_handle =~ Regexp.new(p_hdl_restr)
raise PreProcessingError, _("This parent can't raise such a child (handle restrictions)")
end
p_dn_restr = obj_klass.parameters[:mapping][:parent_dn_restrictions]
unless p_dn_restr.nil? or loc_item.dn =~ Regexp.new(p_dn_restr)
raise PreProcessingError, _("This parent can't raise such a child (DN restrictions)")
end
item = obj_klass.new(item_hdl)
item.base = loc_item.dn_obj - obj_klass.base_obj
modification_done = LdapShadows::Manipulation.item_modify_from_strings(item, args)
item.save!
#item.save!
puts "Creation done."
end
end
conf/ldap_shadows/shadows/MilkyPond/objects/entity.conf
excluded_classes: ['dcObject']
sort_by: o
associated_relations: ['foundersIndividuals', 'foundersEntities']
parent_handle_restrictions: "^unit/Entities$"
presentation:
name_attribute: o
hidden_attributes: ['founder']
data/ldap_shadows/default_config/object.yaml
possible_aspects: []
associated_relations: []
associated_attributes: []
parent_handle_restrictions:
parent_dn_restrictions:
presentation:
name_attribute:
hidden_attributes: []
data/ldap_shadows/schema/object.yaml
type: seq
sequence:
- type: str
"parent_handle_restrictions": {type: str}
"parent_dn_restrictions": {type: str}
=: {type: any}
"presentation":
type: map

Also available in: Unified diff