(www-edit-display-object-desc): Support non-character objects.
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 9 Dec 2010 05:29:33 +0000 (14:29 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 9 Dec 2010 05:29:33 +0000 (14:29 +0900)
(www-edit-display-feature-desc): Add new optional argument
`object-genre'.
(www-batch-edit): Fix problem to edit feature of non-character
objects.

cwiki-edit.el

index 7b8c506..a8d81a0 100644 (file)
@@ -69,28 +69,46 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
   (let ((object (www-uri-decode-object genre uri-object))
        (feature-name (www-uri-decode-feature-name uri-feature-name))
        base-name metadata-name
+       parents
        object-spec str)
-    (when (characterp object)
+    (when object
       (princ
-       (format "<head>
-<title>CHISE-wiki character: %s</title>
+       (encode-coding-string
+       (format "<head>
+<title>EsT %s = %s</title>
 </head>\n"
-              (encode-coding-string
-               (decode-uri-string uri-object 'utf-8-mcs-er)
-               'utf-8-mcs-er)))
+               genre
+               (decode-uri-string uri-object 'utf-8-mcs-er))
+       'utf-8-mcs-er))
       (princ "<body>\n")
+      (when (eq genre 'character)
+       (dolist (feature (char-feature-property '$object 'additional-features))
+         (mount-char-attribute-table
+          (char-feature-name-at-domain feature '$rev=latest))))
+      (when (setq parents (www-get-feature-value object '<-denotational))
+       (princ (format "<p>%s %s</p>\n<hr>\n"
+                      (www-format-value-as-char-list parents)
+                      (www-format-feature-name '->denotational lang))))
+      (when (setq parents (www-get-feature-value object '<-subsumptive))
+       (princ (format "<p>%s %s</p>\n<hr>\n"
+                      (www-format-value-as-char-list parents)
+                      (www-format-feature-name '->subsumptive lang))))
       (princ
        (format "<h1>%s</h1>\n"
-              (www-format-encode-string (char-to-string object))))
+              (www-format-encode-string (est-format-object object))))
       (princ "<form action=\"set.cgi\" method=\"GET\">\n")
       (princ
        (encode-coding-string
-       (format "<p>(char : <input type=\"text\" name=\"char\"
+       (format "<p>(%s : <input type=\"text\" name=\"%s\"
 size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
 "
+               genre genre
                (decode-uri-string uri-object 'utf-8-mcs-er))
        'utf-8-mcs-er))
-      (setq object-spec (char-attribute-alist object))
+      (setq object-spec
+           (if (eq genre 'character)
+               (char-attribute-alist object)
+             (concord-object-spec object)))
       (if (string-match "\\*" (setq str (symbol-name feature-name)))
          (setq base-name (intern (substring str 0 (match-beginning 0)))
                metadata-name (intern (substring str (match-end 0))))
@@ -126,7 +144,8 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
 
 (defun www-edit-display-feature-desc (uri-feature-name
                                      uri-property-name
-                                     &optional lang uri-object)
+                                     &optional lang
+                                     object-genre uri-object)
   (let ((feature-name (www-uri-decode-feature-name uri-feature-name))
        (property-name (www-uri-decode-feature-name uri-property-name))
        name@lang)
@@ -273,10 +292,10 @@ size=\"30\" maxlength=\"30\" value=\"%s\">に限\u5B9Aしない)
                (decode-uri-string (cdr (assq 'property target))
                                   'utf-8-mcs-er)
                lang
-               (cdr (assq 'char target))
-                ;; (decode-uri-string (cdr (assq 'char target))
-                ;;                    'utf-8-mcs-er)
-               )
+               (car (nth 3 target))
+                (cdr (nth 3 target))
+                ;; (cdr (assq 'char target))
+                )
               )
              (t
               (www-edit-display-object-desc