Changeset 643 for trunk/src/model
- Timestamp:
- 07/19/11 08:01:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/model/datamodel.lisp ¶
r642 r643 1578 1578 (mapc (lambda(psi)(mark-as-deleted psi :revision revision 1579 1579 :source-locator source-locator)) 1580 (psis top :revision 0))1580 (psis top :revision revision)) 1581 1581 (mapc (lambda(sl)(mark-as-deleted sl :revision revision 1582 1582 :source-locator source-locator)) 1583 (locators top :revision 0)) 1583 (locators top :revision revision)) 1584 (mapc (lambda(ii)(mark-as-deleted ii :revision revision 1585 :source-locator source-locator)) 1586 (item-identifiers top :revision revision)) 1584 1587 (mapc (lambda (name) (mark-as-deleted name :revision revision 1585 1588 :source-locator source-locator)) 1586 (names top :revision 0))1589 (names top :revision revision)) 1587 1590 (mapc (lambda (occ) (mark-as-deleted occ :revision revision 1588 1591 :source-locator source-locator)) 1589 (occurrences top :revision 0))1592 (occurrences top :revision revision)) 1590 1593 (mapc (lambda (ass) (mark-as-deleted ass :revision revision 1591 1594 :source-locator source-locator)) 1592 1595 (find-all-associations top :revision 0)) 1596 (let ((ref (reified-construct top :revision revision))) 1597 (when ref 1598 (private-delete-reified-construct top ref :revision revision))) 1599 (dolist (typable (used-as-type top :revision revision)) 1600 (private-delete-typable typable :source-locator source-locator 1601 :revision revision)) 1602 (dolist (scopable (used-as-theme top :revision revision)) 1603 (private-delete-scopable scopable :source-locator source-locator 1604 :revision revision)) 1593 1605 (call-next-method))) 1606 1607 1608 (defgeneric private-delete-scopable (construct &key source-locator revision) 1609 (:documentation "This method should be called when a topic that is used 1610 as a theme for the passed construct is getting 1611 marked-as-deleted, i.e. all scopable constructs, scoped 1612 by the deleted topic are marked-as-deleted as well. 1613 If the passed construct is a role the entire parent 1614 association is deleted, otherwise only the construct itself.") 1615 (:method ((construct ScopableC) &key source-locator revision) 1616 (if (typep construct 'RoleC) 1617 (let ((assoc (parent construct :revision revision))) 1618 (if assoc 1619 (mark-as-deleted assoc :source-locator source-locator 1620 :revision revision) 1621 (mark-as-deleted construct :source-locator source-locator 1622 :revision revision))) 1623 (mark-as-deleted construct :source-locator source-locator 1624 :revision revision)))) 1625 1626 1627 (defgeneric private-delete-typable (construct &key source-locator revision) 1628 (:documentation "This method should be called when a topic that is used 1629 as a type for the passed construct is getting 1630 marked-as-deleted, i.e. all typable constructs, typed 1631 by the deleted topic are marked-as-deleted as well. 1632 If the passed construct is a role the entire parent 1633 association is deleted, otherwise only the construct itself.") 1634 (:method ((construct TypableC) &key source-locator revision) 1635 (if (typep construct 'RoleC) 1636 (let ((assoc (parent construct :revision revision))) 1637 (if assoc 1638 (mark-as-deleted assoc :source-locator source-locator 1639 :revision revision) 1640 (mark-as-deleted construct :source-locator source-locator 1641 :revision revision))) 1642 (mark-as-deleted construct :source-locator source-locator 1643 :revision revision)))) 1594 1644 1595 1645 … … 2351 2401 as deleted." 2352 2402 (declare (ignorable source-locator)) 2353 (let ((owner (parent construct :revision 0))) 2403 (let ((owner (parent construct :revision revision)) 2404 (type-top (instance-of construct :revision revision))) 2354 2405 (when owner 2355 (private-delete-characteristic owner construct :revision revision)))) 2406 (private-delete-characteristic owner construct :revision revision)) 2407 (when type-top 2408 (private-delete-type construct type-top :revision revision)) 2409 (dolist (theme (themes construct :revision revision)) 2410 (private-delete-theme construct theme :revision revision)))) 2356 2411 2357 2412 … … 2639 2694 (when (VariantC-p characteristic-symbol) 2640 2695 (map 'list #'characteristic (slot-p parent-construct 'variants)))) 2696 2697 2698 (defmethod mark-as-deleted ((construct NameC) &key source-locator revision) 2699 "Marks the last active relation between a characteristic and its parent topic 2700 as deleted." 2701 (declare (ignorable source-locator)) 2702 (dolist (variant (variants construct :revision revision)) 2703 (private-delete-variant construct variant :revision revision)) 2704 (call-next-method)) 2641 2705 2642 2706
Note: See TracChangeset
for help on using the changeset viewer.