Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest-fs-openacs
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
intranet-rest-fs-openacs
Commits
824cccfa
Commit
824cccfa
authored
Jun 07, 2019
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added ignore_p
parent
6236cc18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
mkdir.tcl
www/mkdir.tcl
+9
-6
No files found.
www/mkdir.tcl
View file @
824cccfa
...
...
@@ -8,6 +8,7 @@ ad_page_contract {
{
project_id:integer
""
}
{
path
""
}
{
name
""
}
{
ignore_p 0
}
}
set
user_id
[
ad_conn user_id
]
...
...
@@ -15,13 +16,16 @@ set package_id [ad_conn package_id]
set
package_id
[
db_string package
"select min(package_id) from apm_packages where package_key = 'file-storage'"
-default
$package
_id
]
ns_log Notice
"mkdir: path=
$path
, name=
$name
, project_id=
$project
_id"
# Just dry running?
if
{
$ignore
_p
}
{
doc_return 200
"application/json"
"{
\"
success
\"
: true,
\"
message
\"
:
\"
Request ignored.
\"
,
\"
data
\"
: {}}"
ad_script_abort
}
if
{
""
ne
$project
_id
}
{
set folder_id
[
im_rest_fs_folder_for_object -object_id
$project
_id
]
}
set
file_id
[
db_nextval
"acs_object_id_seq"
]
if
{
""
ne
$name
}
{
set path
"
$path
/
$name
"
}
set
path_pieces
[
split
$path
"/"
]
set
parent_pieces
[
lrange
$path
_pieces 0 end-1
]
...
...
@@ -30,7 +34,7 @@ ns_log Notice "mkdir: path=$path, parent_pieces=$parent_pieces, folder_name=$fol
set
parent_id
[
im_rest_fs_folder_for_path -object_id
$project
_id -path
[
join
$parent
_pieces
"/"
]]
if
{
""
eq
$parent
_id
}
{
doc_return
500
"text/plain"
"Did not find path=
$path
for object_id=
$object
_id
"
doc_return
200
"application/json"
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Did not find path=
$path
for project_id=
$project
_id.
\"
,
\"
data
\"
: {}}
"
ad_script_abort
}
...
...
@@ -48,6 +52,5 @@ db_string reg "select content_folder__register_content_type(:folder_id, 'file_st
db_string reg
"select content_folder__register_content_type(:folder_id, 'content_extlink', true)"
doc_return 200
"
text/plain"
"project_id=
$project
_id, path=
$path
"
doc_return 200
"
application/json"
"{
\"
success
\"
: true,
\"
message
\"
:
\"
Path created.
\"
,
\"
data
\"
: {
\"
project_id
\"
:
$project
_id,
\"
path
\"
:
\"
$path
\"
}}
"
ad_script_abort
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