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
f6b87f10
Commit
f6b87f10
authored
Aug 02, 2009
by
po34devklaus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-- dev
parent
da32e703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
xml-rpc-procs.tcl
tcl/xml-rpc-procs.tcl
+28
-1
No files found.
tcl/xml-rpc-procs.tcl
View file @
f6b87f10
...
@@ -24,26 +24,48 @@ namespace eval xmlrpc-rest {}
...
@@ -24,26 +24,48 @@ namespace eval xmlrpc-rest {}
ad_register_proc GET /intranet-xmlrpc/rest/* xmlrpc-rest::dispatchRest
ad_register_proc GET /intranet-xmlrpc/rest/* xmlrpc-rest::dispatchRest
ad_register_proc POST /intranet-xmlrpc/rest/* xmlrpc-rest::dispatchRest
ad_register_proc POST /intranet-xmlrpc/rest/* xmlrpc-rest::dispatchRest
ad_proc -public xmlrpc-rest::dispatchRest
{}
{
ad_proc -public xmlrpc-rest::dispatchRest
{}
{
@return dispatches REST requests
@return dispatches REST requests
@author Klaus Hofeditz
@author Klaus Hofeditz
}
{
}
{
set user_id
[
ad_maybe_redirect_for_registration
]
set user_id
[
ad_maybe_redirect_for_registration
]
set urlpieces
[
ns_conn urlv
]
set urlpieces
[
ns_conn urlv
]
set path
[
lrange
$urlpieces
2
[
llength
$urlpieces
]]
set path
[
lrange
$urlpieces
2
[
llength
$urlpieces
]]
set url_query
[
ns_conn query
]
set url_query
[
ns_conn query
]
set header_vars
[
ns_conn form
]
set var_list
[
ad_ns_set_keys
$header
_vars
]
switch
[
lindex
$urlpieces
2
]
{
switch
[
lindex
$urlpieces
2
]
{
companies
{
return
[
xmlrpc-rest::handle_rest_company
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
companies
{
return
[
xmlrpc-rest::handle_rest_company
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
timesheet
{
return
[
xmlrpc-rest::handle_rest_timesheet
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
timesheet
{
return
[
xmlrpc-rest::handle_rest_timesheet
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
projects
{
doc_return 200
"text/plain"
[
xmlrpc-rest::handle_rest_project
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
projects
{
doc_return 200
"text/plain"
[
xmlrpc-rest::handle_rest_project
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
action_items
{
doc_return 200
"text/plain"
[
xmlrpc-rest::handle_action_items
[
ns_conn method
]
$path
$url
_query
$user
_id
]
}
default
{
ad_return_complaint 1
"ressource not available"
}
default
{
ad_return_complaint 1
"ressource not available"
}
}
}
}
}
ad_proc -public xmlrpc-rest::handle_action_items
{
method path url_query user_id
}
{
@return project list / task list
}
{
set header_vars
[
ns_conn form
]
set var_list
[
ad_ns_set_keys
$header
_vars
]
ad_ns_set_to_tcl_vars
$header
_vars
if
{
""
!=
$item
_list
}
{
return
[
gtd-dashboard::write_gtd_list
$item
_list
$user
_id
]
}
else
{
return
"error: not items found"
}
}
ad_proc -public xmlrpc-rest::render_json
{
object_list search_string
}
{
ad_proc -public xmlrpc-rest::render_json
{
object_list search_string
}
{
@returns a json structure
@returns a json structure
}
{
}
{
...
@@ -103,6 +125,11 @@ ad_proc -public xmlrpc-rest::handle_rest_project {method path url_query user_id}
...
@@ -103,6 +125,11 @@ ad_proc -public xmlrpc-rest::handle_rest_project {method path url_query user_id}
if
{
"last_id"
==
[
lindex
$query
_item 0
]
}
{
if
{
"last_id"
==
[
lindex
$query
_item 0
]
}
{
set last_id
[
lindex
$query
_item 1
]
set last_id
[
lindex
$query
_item 1
]
}
}
# location
if
{
"location"
==
[
lindex
$query
_item 0
]
}
{
set location
[
lindex
$query
_item 1
]
}
}
}
# set project_id 27971
# set project_id 27971
...
@@ -115,7 +142,7 @@ ad_proc -public xmlrpc-rest::handle_rest_project {method path url_query user_id}
...
@@ -115,7 +142,7 @@ ad_proc -public xmlrpc-rest::handle_rest_project {method path url_query user_id}
set output
[
xmlrpc-rest::render_json
$object
_list
$search
_string
]
set output
[
xmlrpc-rest::render_json
$object
_list
$search
_string
]
}
}
task
{
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
ts
$location
]
}
}
default
{
set
output
"Object Type not found"
}
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