Modify

Opened 16 years ago

Closed 16 years ago

#3520 closed enhancement (fixed)

get the names from the database

Reported by: anonymous Owned by: Vladislav Naumov
Priority: normal Component: CcSelectorPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

hello! i'm a newbie in using trac.. i just want to know on how to connect the db using sqlite in the jscript file.. hope to hear an answer from you soon.. tnx in advance!

Attachments (0)

Change History (5)

comment:1 Changed 16 years ago by Vladislav Naumov

Sorry, I do not understand what are you trying to do. You surely cannot connect to SQLite database (on server) from Javascript in your browser.

If you want to edit pre-defined set of email addresses in CcSelectorPlugin - just edit cc_selector.js before installing plugin. If you already installed it - edit it now and re-install plugin again.

comment:2 in reply to:  1 Changed 16 years ago by anonymous

Replying to vnaum:

Sorry, I do not understand what are you trying to do. You surely cannot connect to SQLite database (on server) from Javascript in your browser.

If you want to edit pre-defined set of email addresses in CcSelectorPlugin - just edit cc_selector.js before installing plugin. If you already installed it - edit it now and re-install plugin again.

Hi! How would I get the names of the users by means of connecting to the database? And not manually adding the names or email address of the users in the jscript file.. Hope to hear a reply from you.. tnx!

comment:3 Changed 16 years ago by Vladislav Naumov

Keywords: sqlite ccselector removed
Priority: highnormal
Status: newassigned
Summary: how to connect trac.db to jscript fileget the names from the database
Type: defectenhancement

I will do this eventually, but I can't promise anything: after all, I'm doing this in my spare time.

If you want your list right away - consider editing js file manually. If you need different lists for different environments - you can compile different lists into different *.egg files (setup bdist_egg) and eggs into plugin subdirs.

comment:4 Changed 16 years ago by anonymous

Couldn't we treat the javascript file as a Genshi template and get the user list as follows?

vars = { users: PermissionSystem(self.env).get_users_with_permission('TICKET_VIEW') }

comment:5 in reply to:  4 Changed 16 years ago by Vladislav Naumov

Resolution: fixed
Status: assignedclosed

Replying to anonymous:

Couldn't we treat the javascript file as a Genshi template

It's not that simple. According to Genshi Tutorial,

The template will be parsed by Genshi using an XML parser, which means that it needs to be well-formed XML.

And I don't know if it is possible to turn JS source into well-formed XML (it's probably possible, but I have no idea how to do this). Instead I used template to put developer list into page source and fetched data from there. And there are two different template engines in Trac to support (Clearsilver in 0.10 and Genshi in 0.11).

Also, to provide templates plugin should implement ITemplateProvider and to process requests is also should be IRequestHandler - so it does all this now.

Fixed in r5872 for 0.11 and later, and in r5873 for 0.10.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Vladislav Naumov.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.