Edgewall Software

Ticket #909 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

[patch] Support for query: link syntax in WikiFormatting

Reported by: cboos@… Owned by: cmlenz
Priority: normal Milestone: 0.9
Component: wiki system Version: devel
Severity: normal Keywords: query
Cc:

Description

The proposed addition is quite simple: the query: string should be followed directly by the GET arguments.

As long as the query module uses the GET method, one can compose an arbitrarily complex query, and then copy/paste the link from the Web browser to the wiki page editor.

  • WikiFormatter.py

    === WikiFormatter.py
    ==================================================================
     
    116116              r"""(?P<tickethref>!?#(?P<t_intertrac>[a-zA-z]?)\d+)""", 
    117117              r"""(?P<changesethref>!?\[(?P<c_intertrac>[a-zA-z]?)\d+\])""", 
    118118              r"""(?P<reporthref>!?\{\d+\})""", 
    119               r"""(?P<modulehref>!?((?P<modulename>bug|ticket|browser|source|repos|report|changeset|wiki|milestone|search):(?P<moduleargs>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""", 
     119              r"""(?P<modulehref>!?((?P<modulename>bug|ticket|browser|source|repos|report|query|changeset|wiki|milestone|search):(?P<moduleargs>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""", 
    120120              r"""(?P<wikilink>!?(^|(?<=[^A-Za-z]))[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+(?=\Z|\s|,|\.|:|\)))""", 
    121121              r"""(?P<fancylink>!?\[(?P<fancyurl>([a-z]+:[^ ]+)) (?P<linkname>.*?)\])"""] 
    122122 
     
    258258                return self._href.wiki(args), '%s:%s' % (module, args), 0, None 
    259259        elif module == 'report': 
    260260            return self._href.report(args), '%s:%s' % (module, args), 0, None 
     261        elif module == 'query': 
     262            if args and args[0] == '?': 
     263                return self._href.query() + args, '%s:%s' % (module, args), 0, None 
     264            else: 
     265                return self._href.query(), '%s:%s' % (module, args), 1, None 
    261266        elif module == 'changeset': 
    262267           cursor = self.db.cursor () 
    263268           cursor.execute('SELECT message FROM revision WHERE rev=%s', args) 

Attachments

Change History

Changed 4 years ago by cmlenz

  • keywords query added
  • owner changed from jonas to cmlenz
  • milestone set to 0.9

Good idea. What I was planning was to use a kind of mini-query-language in the link, in conjunction with the more powerful query capabilities currently being worked on on the query branch.

For example:

    query:milestone=0.9&owner=cmlenz&keywords~=layout&severity!=enhancement

Meaning: all tickets with milestone set to 0.9 and owner set to cmlenz, where the severity field is not set to enhancement.

Operators supported might be:

= is
!= is not
~= contains
!~= does not contain
= begins with
$= ends with
>= greater than
<= less than

Note that the range of available operators will be dependent on what can be represented in the new query UI, rather than on whether they're technically implementable.

For fields like status, resolution and custom fields of type "radio", you could OR option values, for example:

    query:status=new|assigned|reopened

Changed 4 years ago by cboos@…

Yes, I understand that there's the room/need for a custom query mini-language...

Nevertheless, my proposal still stands:

  • if the first character after the query: is ?, use what follows directly to form the query (the simple copy/paste way)
  • if not, parse the arguments according to the rules presented above (the query mini-language way)

Changed 4 years ago by cmlenz

  • status changed from new to assigned

Changed 4 years ago by cboos@…

  • severity changed from normal to enhancement

Just a reminder for this patch, which I find quite useful as it is now:

Form a custom query using the web interface, then copy everything after the '?', and paste it in your link after the '?':

[query:?<paste the query here> Reopened Bugs for XYZ]

Changed 4 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Implemented in [1362].

Add/Change #909 ([patch] Support for query: link syntax in WikiFormatting)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.