[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/debbugs 17943cc 072/311: * Debbugs.wsdl (ArrayOfArrayOf
From: |
Stefan Monnier |
Subject: |
[elpa] externals/debbugs 17943cc 072/311: * Debbugs.wsdl (ArrayOfArrayOfAnyType) |
Date: |
Sun, 29 Nov 2020 18:41:43 -0500 (EST) |
branch: externals/debbugs
commit 17943cc23df7d3f63d55ffcc190245768ce3bf2f
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
* Debbugs.wsdl (ArrayOfArrayOfAnyType)
(ArrayOfArrayOfArrayOfAnyType): New types.
(search_estRequest, search_estResponse): New messages.
(search_est): New operation.
* debbugs.el (debbugs-search-est): New defun.
* debbugs-pkg.el (top): Upgrade package version to 0.2.
---
ChangeLog | 11 +++
Debbugs.wsdl | 57 +++++++++++++
debbugs-pkg.el | 2 +-
debbugs.el | 250 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
4 files changed, 317 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 92bbbda..bb174fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-08-12 Michael Albinus <michael.albinus@gmx.de>
+
+ * Debbugs.wsdl (ArrayOfArrayOfAnyType)
+ (ArrayOfArrayOfArrayOfAnyType): New types.
+ (search_estRequest, search_estResponse): New messages.
+ (search_est): New operation.
+
+ * debbugs.el (debbugs-search-est): New defun.
+
+ * debbugs-pkg.el (top): Upgrade package version to 0.2.
+
2011-07-29 Michael Albinus <michael.albinus@gmx.de>
* debbugs-gnu.el (debbugs-gnu-default-suppress-bugs)
diff --git a/Debbugs.wsdl b/Debbugs.wsdl
index ed26f26..4a99550 100644
--- a/Debbugs.wsdl
+++ b/Debbugs.wsdl
@@ -55,6 +55,24 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
</restriction>
</complexContent>
</complexType>
+
+ <complexType name="ArrayOfArrayOfAnyType">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType"
+ wsdl:arrayType="types:ArrayOfAnyType[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfArrayOfArrayOfAnyType">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType"
+ wsdl:arrayType="types:ArrayOfArrayOfAnyType[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
</schema>
<schema targetNamespace="http://xml.apache.org/xml-soap"
@@ -105,6 +123,14 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
<wsdl:part name="soapenc:Array" type="types:ArrayOfBugNumber"/>
</wsdl:message>
+ <wsdl:message name="search_estRequest">
+ <wsdl:part name="query" type="types:ArrayOfArrayOfAnyType"
+ minOccurs="1" maxOccurs="unbounded"/>
+ </wsdl:message>
+ <wsdl:message name="search_estResponse">
+ <wsdl:part name="soapenc:Array" type="types:ArrayOfArrayOfArrayOfAnyType"/>
+ </wsdl:message>
+
<wsdl:portType name="Debbugs/SOAP">
<wsdl:operation name="get_status" parameterOrder="bugs">
<wsdl:input message="tns:get_statusRequest">
@@ -165,6 +191,21 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
use="encoded"/>
</wsdl:output>
</wsdl:operation>
+
+ <wsdl:operation name="search_est" parameterOrder="query">
+ <wsdl:input message="tns:search_estRequest">
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:input>
+ <wsdl:output message="tns:search_estResponse">
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Debbugs/SOAP/BINDING" type="tns:Debbugs/SOAP">
@@ -232,6 +273,22 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
use="encoded"/>
</wsdl:output>
</wsdl:operation>
+
+ <wsdl:operation name="search_est">
+ <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+ <wsdl:input name="search_estRequest">
+ <wsdlsoap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="search_estResponse">
+ <wsdlsoap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
</wsdl:binding>
<wsdl:service name="Debbugs/SOAP/SERVICE">
diff --git a/debbugs-pkg.el b/debbugs-pkg.el
index 7a71af5..dd00fa1 100644
--- a/debbugs-pkg.el
+++ b/debbugs-pkg.el
@@ -1 +1 @@
-(define-package "debbugs" "0.1" "SOAP library to access debbugs servers")
+(define-package "debbugs" "0.2" "SOAP library to access debbugs servers")
diff --git a/debbugs.el b/debbugs.el
index 1d3812e..4e5f5bd 100644
--- a/debbugs.el
+++ b/debbugs.el
@@ -5,7 +5,7 @@
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, hypermedia
;; Package: debbugs
-;; Version: 0.1
+;; Version: 0.2
;; This file is part of GNU Emacs.
@@ -99,7 +99,7 @@ This corresponds to the Debbugs server to be accessed, either
"Return a list of bug numbers which match QUERY.
QUERY is a sequence of keyword-value pairs where the values are
-strings, i. e. :KEYWORD \"VALUE\" [:KEYWORD \"VALUE\"]*
+strings, i.e. :KEYWORD \"VALUE\" [:KEYWORD \"VALUE\"]*
The keyword-value pair is a subquery. The keywords are allowed to
have multiple occurrence within the query at any place. The
@@ -336,6 +336,252 @@ Every message is an association list with the following
attributes:
implemented yet server side."
(car (soap-invoke debbugs-wsdl debbugs-port "get_bug_log" bug-number)))
+(defun debbugs-search-est (&rest query)
+ "Return the result of a full text search according to QUERY.
+
+QUERY is a sequence of lists of keyword-value pairs where the
+values are strings or numbers, i.e. :KEYWORD \"VALUE\" [:KEYWORD
+VALUE]*
+
+Every sublist of the QUERY forms a hyperestraier condition. A
+detailed description of hyperestraier conditions can be found at
+URL `http://fallabs.com/hyperestraier/uguide-en.html#searchcond'.
+
+The following conditions are possible:
+
+\[:phrase SEARCH-PHRASE :skip NUMBER :max NUMBER\]
+
+ The string SEARCH-PHRASE forms the search on the database. It
+ contains words to be searched for, combined by operators like
+ AND, ANDNOT and OR. If there is no operator between the words,
+ AND is used by default. The phrase keyword and value can also
+ be omitted, this is useful in combination with other conditions.
+
+ :skip and :max are optional. They specify, how many hits are
+ skipped, and how many maximal hits are returned. This can be
+ used for paged results. Per default, :skip is 0 and :max is 10.
+
+ There must be exactly one such condition.
+
+\[ATTRIBUTE VALUE+ :operation OPERATION :order ORDER\]
+
+ ATTRIBUTE is one of the following keywords:
+
+ :status -- Status of bug. Valid values are \"done\",
+ \"forwarded\" and \"open\".
+
+ :subject, :@title -- The subject of a message or the title of
+ the bug, a string.
+
+ :date, :@cdate -- The submission or modification dates of a
+ message, a number.
+
+ :submitter, :@author -- The email address of the submitter of a
+ bug or the author of a message belonging to this bug, a string.
+ The special email address \"me\" is used as pattern, replaced
+ with `user-mail-address'.
+
+ :package -- The value is the name of the package a bug belongs
+ to, like \"emacs\", \"coreutils\", \"gnus\", or \"tramp\".
+
+ :tags -- An arbitrary string the bug is annotated with.
+
+ :severity -- This is the severity of the bug. The exact set of
+ allowed values depends on the Debbugs port. Examples are
+ \"normal\", \"minor\", \"wishlist\" etc.
+
+ :operator defines the comparison operator to be applied to
+ ATTRIBUTE. For string attributes this could be \"STREQ\" \(is
+ equal to the string), \"STRNE\" \(is not equal to the string),
+ \"STRINC\" \(includes the string), \"STRBW\" \(begins with the
+ string), \"STREW\" \(ends with the string), \"STRAND\"
+ \(includes all tokens in the string), \"STROR\" \(includes at
+ least one token in the string), \"STROREQ\" \(is equal to at
+ least one token in the string) or \"STRRX\" \(matches regular
+ expressions of the string). For operators with tokens, several
+ values for ATTRIBUTE shall be used.
+
+ Numbers can be compared by the operators \"NUMEQ\" \(is equal
+ to the number), \"NUMNE\" \(is not equal to the number),
+ \"NUMGT\" \(is greater than the number), \"NUMGE\" \(is greater
+ than or equal to the number), \"NUMLT\" \(is less than the
+ number), \"NUMLE\" \(is less than or equal to the number) or
+ \"NUMBT\" \(is between the two numbers). In the last case,
+ there must be two values for ATTRIBUTE.
+
+ If an operator is leaded by \"!\", the meaning is inverted. If
+ a string operator is leaded by \"I\", the case of the value is
+ ignored.
+
+ The optional :order can be specified only in one condition. It
+ means, that ATTRIBUTE is used for sorting the results. The
+ following order operators exist: \"STRA\" \(ascending by
+ string), \"STRD\" \(descending by string), \"NUMA\" \(ascending
+ by number) or \"NUMD\" \(descending by number).
+
+ A special case is an :order, where there is no corresponding
+ attribute value and no operator. In this case, ATTRIBUTE is
+ not used for the search.
+
+The result of the QUERY is a list of association lists with the
+same attributes as in the conditions. Additional attributes are
+
+ `id': The bug number.
+
+ `msg_num': The number of the message inside the bug log.
+
+ `snippet': The surrounding text found by the search. For the
+ syntax of the snippet, consult the hyperestraier user guide.
+
+Examples:
+
+ \(debbugs-search-est
+ '\(:phrase \"armstrong AND debbugs\" :skip 10 :max 2)
+ '\(:severity \"normal\" :operator \"STRINC\")
+ '\(:date :order \"NUMA\"))
+
+ => \(\(\(msg_num . 21)
+ \(date . 1229208302)
+ \(@author . \"Glenn Morris <rgm@gnu.org>\")
+ \(@title . \"Re: bug#1567: Mailing an archived bug\")
+ \(id . 1567)
+ \(severity . \"normal\")
+ \(@cdate . \"Wed, 17 Dec 2008 14:34:50 -0500\")
+ \(snippet . \"...\")
+ \(subject . \"Mailing an archived bug\")
+ \(package . \"debbugs.gnu.org\"))
+ ...)
+
+ ;; Show all messages from me between 2011-08-01 and 2011-08-31.
+ \(debbugs-search-est
+ '\(:max 20)
+ '\(:@author \"me\" :operator \"ISTRINC\")
+ `\(:date
+ ,\(floor \(float-time \(encode-time 0 0 0 1 8 2011)))
+ ,\(floor \(float-time \(encode-time 0 0 0 31 8 2011)))
+ :operator \"NUMBT\"))"
+
+ (let (args result)
+ ;; Compile search arguments.
+ (dolist (elt query)
+ (let (vec kw key val
+ phrase-cond attr-cond)
+
+ ;; Phrase is mandatory, even if empty.
+ (when (and (or (member :skip elt) (member :max elt))
+ (not (member :phrase elt)))
+ (setq vec (vector "phrase" "")))
+
+ ;; Parse condition.
+ (while (consp elt)
+ (setq kw (pop elt))
+ (unless (keywordp kw)
+ (error "Wrong keyword: %s" kw))
+ (setq key (substring (symbol-name kw) 1))
+ (case kw
+ ;; Phrase condition.
+ (:phrase
+ ;; It shouldn't happen in an attribute condition.
+ (if attr-cond
+ (error "Wrong keyword: %s" kw))
+ (setq phrase-cond t val (pop elt))
+ ;; Value is a string.
+ (if (stringp val)
+ (setq vec (vconcat vec (list key val)))
+ (error "Wrong %s: %s" key val)))
+
+ ((:skip :max)
+ ;; It shouldn't happen in an attribute condition.
+ (if attr-cond
+ (error "Wrong keyword: %s" kw))
+ (setq phrase-cond t val (pop elt))
+ ;; Value is a number.
+ (if (numberp val)
+ (setq vec (vconcat vec (list key (number-to-string val))))
+ (error "Wrong %s: %s" key val)))
+
+ ;; Attribute condition.
+ ((:submitter :@author)
+ ;; It shouldn't happen in a phrase condition.
+ (if phrase-cond
+ (error "Wrong keyword: %s" kw))
+ (if (not (stringp (car elt)))
+ (setq vec (vconcat vec (list key "")))
+ ;; Value is an email address.
+ (while (and (stringp (car elt))
+ (string-match "\\`\\S-+\\'" (car elt)))
+ (when (string-equal "me" (car elt))
+ (setcar elt user-mail-address))
+ (when (string-match "<\\(.+\\)>" (car elt))
+ (setcar elt (match-string 1 (car elt))))
+ (add-to-list 'val (pop elt) 'append))
+ (setq vec
+ (vconcat vec (list key (mapconcat 'identity val " "))))))
+
+ (:status
+ ;; It shouldn't happen in a phrase condition.
+ (if phrase-cond
+ (error "Wrong keyword: %s" kw))
+ (setq attr-cond t)
+ (if (not (stringp (car elt)))
+ (setq vec (vconcat vec (list key "")))
+ ;; Possible values: "done", "forwarded" and "open"
+ (while (and (stringp (car elt))
+ (string-match
+ "\\`\\(done\\|forwarded\\|open\\)\\'" (car elt)))
+ (add-to-list 'val (pop elt) 'append))
+ (setq vec
+ (vconcat vec (list key (mapconcat 'identity val " "))))))
+
+ ((:subject :package :tags :severity :@title)
+ ;; It shouldn't happen in a phrase condition.
+ (if phrase-cond
+ (error "Wrong keyword: %s" kw))
+ (setq attr-cond t)
+ (if (not (stringp (car elt)))
+ (setq vec (vconcat vec (list key "")))
+ ;; Just a string.
+ (while (stringp (car elt))
+ (add-to-list 'val (pop elt) 'append))
+ (setq vec
+ (vconcat vec (list key (mapconcat 'identity val " "))))))
+
+ ((:date :@cdate)
+ ;; It shouldn't happen in a phrase condition.
+ (if phrase-cond
+ (error "Wrong keyword: %s" kw))
+ (setq attr-cond t)
+ (if (not (numberp (car elt)))
+ (setq vec (vconcat vec (list key "")))
+ ;; Just a number.
+ (while (numberp (car elt))
+ (add-to-list 'val (pop elt) 'append))
+ (setq vec
+ (vconcat
+ vec (list key (mapconcat 'number-to-string val " "))))))
+
+ ((:operator :order)
+ ;; It shouldn't happen in a phrase condition.
+ (if phrase-cond
+ (error "Wrong keyword: %s" kw))
+ (setq attr-cond t val (pop elt))
+ ;; Value is a number.
+ (if (stringp val)
+ (setq vec (vconcat vec (list key val)))
+ (error "Wrong %s: %s" key val)))
+
+ (t (error "Unknown key: %s" kw))))
+
+ (setq args (vconcat args (list vec)))))
+
+ (setq result
+ (car (soap-invoke debbugs-wsdl debbugs-port "search_est" args)))
+ ;; The result contains lists (key value). We transform it into
+ ;; cons cells (key . value).
+ (dolist (elt1 result result)
+ (dolist (elt2 elt1)
+ (setcdr elt2 (cadr elt2))))))
+
(defun debbugs-get-attribute (bug-or-message attribute)
"Return the value of key ATTRIBUTE.
- [elpa] externals/debbugs 1651ba2 049/311: One week is a better period for staleness, I think., (continued)
- [elpa] externals/debbugs 1651ba2 049/311: One week is a better period for staleness, I think., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 7dd9887 052/311: * debbugs-gnu.el (debbugs-gnu-get-bugs): Reinsert sorting of ids., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 84be38d 055/311: * debbugs-gnu.el (debbugs-gnu-subject): New defvar., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 7f4fc6a 070/311: * debbugs-gnu.el (debbugs-gnu-default-suppress-bugs), Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs abc7751 069/311: * debbugs-gnu.el (debbugs-gnu-search): Let-bind, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 90417e5 056/311: * debbugs-gnu.el (debbugs-gnu-send-control-message): Add "pending" etc., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 5129bba 063/311: * debbugs.texi: New file., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 1ef5eb3 059/311: * debbugs-gnu.el (debbugs-gnu-send-control-message): Add "invalid"., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs d7b7072 060/311: * debbugs-gnu.el (debbugs-gnu-show-reports): Add packages to the status bar., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs f347ec7 066/311: (debbugs-gnu-summary-mode): Make sure `gnus-article-copy' is alive., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 17943cc 072/311: * Debbugs.wsdl (ArrayOfArrayOfAnyType),
Stefan Monnier <=
- [elpa] externals/debbugs 080565c 074/311: * debbugs-gnu.el (debbugs-gnu-search): Add full text search., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 560f17c 080/311: * debbugs.el (debbugs-get-mbox, debbugs-get-bugs): Fix typos in, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 298ea80 081/311: * debbugs.texi: Update documentation., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs e56e7b3 083/311: Change default value of `debbugs-gnu-default-severities' to '("important" "normal"), Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs b00d778 087/311: Make sure the buffer isn't read-only before altering., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 5495087 089/311: Allow ignoring matches in From/Subject when narrowing., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs df2ec72 042/311: (debbugs-summary-mode): Remove address@hidden from the list, too., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 1c81865 045/311: * debbugs-gnu.el (debbugs-gnu-*): Rename from `debbugs-*'., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs ba9a8ca 046/311: (debbugs-gnu-send-control-message): Add donenotabug and donewontfix., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs bbe09ae 047/311: (debbugs-gnu-send-control-message): Add doneunreproducible., Stefan Monnier, 2020/11/29