Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xml-rpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
xml-rpc
Commits
da32e703
Commit
da32e703
authored
Aug 01, 2009
by
po34devklaus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-- dev
parent
7a6f1c42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
xml-rpc-procs.tcl
tcl/xml-rpc-procs.tcl
+29
-17
No files found.
tcl/xml-rpc-procs.tcl
View file @
da32e703
...
...
@@ -47,7 +47,11 @@ ad_proc -public xmlrpc-rest::dispatchRest {} {
ad_proc -public xmlrpc-rest::render_json
{
object_list search_string
}
{
@returns a json structure
}
{
#
set output
"
\{\"
ResultSet
\"
:
\n\{\n\"
Result
\"
:
\[\n
"
# set output "\[\n"
foreach sub_list
$object
_list
{
if
{
[
llength
$sub
_list
]
}
{
if
{
0 !=
[
llength
[
lindex
$sub
_list 0
]]
}
{
...
...
@@ -55,7 +59,11 @@ ad_proc -public xmlrpc-rest::render_json { object_list search_string } {
if
{
[
string
first
[
string
tolower
$search
_string
]
[
string
tolower
[
lindex
$sub
_list 0
]]]
!= -1
}
{
append output
"
\{\"
Object
\"
:
\"
"
append output
[
string
map
{
 
;
""
}
[
lindex
$sub
_list 0
]
]
append output
"
\"\}
,"
append output
"
\"
"
append output
",
\"
ObjectId
\"
:"
append output
[
string
map
{
 
;
""
}
[
lindex
$sub
_list 1
]
]
# append output [lindex $sub_list 1
]
append output
"
\}
,"
}
}
else
{
append output
"
\{\"
Object
\"
:
\"
"
...
...
@@ -68,42 +76,46 @@ ad_proc -public xmlrpc-rest::render_json { object_list search_string } {
set output
"
[
string
range
$output
0
[
expr
[
string
length
$output
]
-2
]]
"
append output
"
\]\}\n\}
"
# append output "\n\
]
"
}
ad_proc -public xmlrpc-rest::handle_rest_project
{
method path url_query user_id
}
{
@return
the URL that is listening for RPC requests
@return
project list / task list
}
{
set query_list
[
split
$url
_query &
]
# find searchstrin and object type
foreach sub_list
$query
_list
{
set query_item
[
split
$sub
_list =
]
# find searchstring, object type, project_id
foreach sub_list
$query
_list
{
set query_item
[
split
$sub
_list =
]
if
{
"search_string"
==
[
lindex
$query
_item 0
]
}
{
set search_string
[
lindex
$query
_item 1
]
set search_string
[
lindex
$query
_item 1
]
}
# project or task?
if
{
"object_type"
==
[
lindex
$query
_item 0
]
}
{
set object_type
[
lindex
$query
_item 1
]
}
if
{
"project_id"
==
[
lindex
$query
_item 0
]
}
{
set project_id
[
lindex
$query
_item 1
]
}
if
{
"last_id"
==
[
lindex
$query
_item 0
]
}
{
set last_id
[
lindex
$query
_item 1
]
}
}
if
{
"project_id"
==
[
lindex
$query
_item 0
]
}
{
set project_id
[
lindex
$query
_item 1
]
}
# last id used in <li> element
if
{
"last_id"
==
[
lindex
$query
_item 0
]
}
{
set last_id
[
lindex
$query
_item 1
]
}
}
set project_id 27971
#
set project_id 27971
# Getting list of objects
switch
$object
_type
{
project
{
set object_list
[
im_project_list -exclude_subprojects_p 0 -exclude_status_id
[
im_project_status_closed
]
-project_id 0
]
set output
[
xmlrpc-rest::render_json
$object
_list
$search
_string
]
set object_list
[
im_project_list -exclude_subprojects_p 0 -exclude_status_id
[
im_project_status_closed
]
-project_id 0
]
set output
[
xmlrpc-rest::render_json
$object
_list
$search
_string
]
}
task
{
set output
[
gtd-dashboard::render_output
[
im_gtd_task_list -restrict_to_project_id
$project
_id
]
task_table
$last
_id
]
set output
[
gtd-dashboard::render_output
[
im_gtd_task_list -restrict_to_project_id
$project
_id
]
task_table
$last
_id
]
}
default
{
set
output
"Object Type not found"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment