Closed Bug 473220 Opened 16 years ago Closed 15 years ago

Programmatic access to data from userprefs.cgi (XML, WebServices)

Categories

(Bugzilla :: User Accounts, enhancement)

3.3.1
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Frank, Assigned: Frank)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; de-de) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1
Build Identifier: 3.3.1

to get the flags work for Mylyn we need information about the groups

1) see https://bugzilla.mozilla.org/show_bug.cgi?id=473201
2) userprefs only supports html (I create an possible patch for this enhancement)




Reproducible: Always
Version: unspecified → 3.3.1
Attached patch patch, V1 (obsolete) — Splinter Review
Attachment #356582 - Flags: review?
OS: Mac OS X → All
Hardware: x86 → All
Comment on attachment 356582 [details] [diff] [review]
patch, V1

>+++ template/en/default/account/prefs/prefs.rdf.tmpl	2009-01-12 21:59:43.000000000 +0100
>@@ -0,0 +1,61 @@
>+
>+f this file are subject to the Mozilla Public

The template seems broken.


>+  #                 Frédéric Buclin <LpSolit@gmail.com>

Are you using UTF8 in your text editor? My first name is completely broken. Also, I didn't write this template. You should have your own name in the contributor list instead.
Attachment #356582 - Flags: review? → review-
Also, it would be better to work on exposing this information through the webservices interface. Also, RDF is not a good format, if you really do want to do this, just use some XML.
Summary: userprefs.cgi add support for ctype=rdf → Programmatic access to data from userprefs.cgi (RDF, XML, WebServices?)
Attached patch patch, V2 (obsolete) — Splinter Review
Now I use type xml and not rdf
Attachment #356582 - Attachment is obsolete: true
Attachment #359450 - Flags: review?
Attachment #359450 - Flags: review? → review-
Comment on attachment 359450 [details] [diff] [review]
patch, V2

>+++ template/en/default/account/prefs/prefs.xml.tmpl	2009-01-29 05:11:59.000000000 +0100

>+  # The Initial Developer of the Original Code is Netscape Communications

Really? I didn't know you were working for Netscape. ;)


>+     <user>
>+     <id>[% user.id FILTER html %]</id>
>+     <login_name>[% user.login_name FILTER html %]</login_name>
>+     <realname>[% user.realname FILTER html %]</realname>
>+     </user>

Please fix the indentation. Also, why using FILTER html instead of FILTER xml? Is there any reason for that?


>+     <has_bits>

has_bits?? Wouldn't "groups" or "permissions" be more explicit?


>+    <set_bits>

Same here.
Assignee: user-accounts → Frank
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Programmatic access to data from userprefs.cgi (RDF, XML, WebServices?) → Programmatic access to data from userprefs.cgi (XML, WebServices)
Attached patch Patch, V2Splinter Review
new version with corrections from comment#5

Sorry I copied the new file from an html template and did not change all the places.
Attachment #359450 - Attachment is obsolete: true
Attachment #361937 - Flags: review?(LpSolit)
Comment on attachment 361937 [details] [diff] [review]
Patch, V2

Sorry for taking so long to review this patch. I was busy with real work and the release of Bugzilla 3.4rc1.


>Index: template/en/default/list/list.rdf.tmpl

This template is unrelated to this bug. Please remove it.


>+++ template/en/default/account/prefs/prefs.xml.tmpl	2009-02-11 23:09:47.000000000 +0100

>+[%# The contents of this file are subject to the Mozilla Public
>+  # License Version 1.1 (the "License"); you may not use this file
>+  # except in compliance with the License. You may obtain a copy of
>+  # the License at http://www.mozilla.org/MPL/
>+  #
>+  # Software distributed under the License is distributed on an "AS
>+  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
>+  # implied. See the License for the specific language governing
>+  # rights and limitations under the License.
>+  #
>+  # Contributor(s): Frank Becker <Frank@Frank-Becker.de>
>+  #
>+  #%]

Please copy and paste http://www.mozilla.org/MPL/boilerplate-1.1/mpl-sh to get the correct license block.


>+<prefs>
>+     <user>
>+       <id>[% user.id FILTER xml %]</id>

In templates, the indentation is only 2 characters, not 4.


>+                <description>[% bit_description.desc FILTER html_light %]</description>

You must use |FILTER xml| for the group description, else you let some HTML tags going through, which generates invalid XML documents.


>+                <description>[% bit_description.desc FILTER html_light %]</description>

Same here.

Otherwise, your patch looks good and works fine. Note that if you call ctype=xml with a tab different from tab=permissions, you still get your XML document, but with no data. Maybe should we rather reject it?
Attachment #361937 - Flags: review?(LpSolit) → review-
Maybe that is no longer needed if we get bug#504937 fixed soon and change Mylyn to use the webservice.

Should I still fix this?
(In reply to comment #8)
> Maybe that is no longer needed if we get bug#504937 fixed soon and change Mylyn
> to use the webservice.
> 
> Should I still fix this?

If you are going to use WebService, then there is no need to implement this new XML interface to access user data, as we would have duplicated code. So marking as WONTFIX in favor of bug 504937.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: