Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
XRF-App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fabio Proietti
XRF-App
Commits
7793dbe3
Commit
7793dbe3
authored
7 years ago
by
Laura Cappelli
Browse files
Options
Downloads
Patches
Plain Diff
prova importazione listing directory
parent
b350da88
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LoadFile.js
+9
-10
9 additions, 10 deletions
LoadFile.js
LoadFile.ts
+9
-12
9 additions, 12 deletions
LoadFile.ts
index.php
+7
-5
7 additions, 5 deletions
index.php
with
25 additions
and
27 deletions
LoadFile.js
+
9
−
10
View file @
7793dbe3
...
...
@@ -21,22 +21,21 @@ $(document).ready(function () {
//abilitazione drag&drop
var
droppableArea
=
document
.
querySelector
(
'
.droppable
'
);
makeDroppable
(
droppableArea
,
callback
);
login
();
});
//funzione che definisce tutti gli elementi responsabili dell'apertura di un file.
//Sono definiti quindi l'albero e il bottone per l'importazione da locale
function
setImportFile
()
{
//Leggo il contenuto del file
json
e ne eseguo il parse
//Leggo il contenuto del file
XML
e ne eseguo il parse
var
contentfilesystem
=
document
.
getElementById
(
'
contentfilesystem
'
).
innerHTML
;
var
jsonObject
=
JSON
.
parse
(
contentfilesystem
);
alert
(
jsonObject
[
0
].
name
);
var
parser
=
new
DOMParser
(
);
var
xmlDoc
=
parser
.
parseFromString
(
contentfilesystem
,
"
text/xml
"
);
//ora genero l'albero e definisco l'evento in caso di selezione di un nodo
//
$('#FileTreeview').treeview({data: generateTree(xmlDoc)});
//
$('#FileTreeview').on('nodeSelected', function(e, node){
//
if(node['url'] != undefined){
//
openFileFromServer(node['url']);
//
}
//
});
$
(
'
#FileTreeview
'
).
treeview
({
data
:
generateTree
(
xmlDoc
)
});
$
(
'
#FileTreeview
'
).
on
(
'
nodeSelected
'
,
function
(
e
,
node
)
{
if
(
node
[
'
url
'
]
!=
undefined
)
{
openFileFromServer
(
node
[
'
url
'
]);
}
});
//bottone per l'importazione locale
var
fileInputButton
=
document
.
getElementById
(
'
myImport
'
);
fileInputButton
.
onchange
=
function
()
{
...
...
This diff is collapsed.
Click to expand it.
LoadFile.ts
+
9
−
12
View file @
7793dbe3
...
...
@@ -30,27 +30,24 @@ $(document).ready( function() {
var
droppableArea
:
any
=
document
.
querySelector
(
'
.droppable
'
);
makeDroppable
(
droppableArea
,
callback
);
login
();
});
//funzione che definisce tutti gli elementi responsabili dell'apertura di un file.
//Sono definiti quindi l'albero e il bottone per l'importazione da locale
function
setImportFile
(){
//Leggo il contenuto del file
json
e ne eseguo il parse
//Leggo il contenuto del file
XML
e ne eseguo il parse
var
contentfilesystem
:
any
=
document
.
getElementById
(
'
contentfilesystem
'
).
innerHTML
;
var
jsonObject
:
any
=
JSON
.
parse
(
contentfilesystem
);
alert
(
jsonObject
[
0
].
name
);
var
parser
:
any
=
new
DOMParser
();
var
xmlDoc
:
any
=
parser
.
parseFromString
(
contentfilesystem
,
"
text/xml
"
);
//ora genero l'albero e definisco l'evento in caso di selezione di un nodo
//
$('#FileTreeview').treeview({data: generateTree(xmlDoc)});
//
$('#FileTreeview').on('nodeSelected', function(e, node){
//
if(node['url'] != undefined){
//
openFileFromServer(node['url']);
//
}
//
});
$
(
'
#FileTreeview
'
).
treeview
({
data
:
generateTree
(
xmlDoc
)});
$
(
'
#FileTreeview
'
).
on
(
'
nodeSelected
'
,
function
(
e
,
node
){
if
(
node
[
'
url
'
]
!=
undefined
){
openFileFromServer
(
node
[
'
url
'
]);
}
});
//bottone per l'importazione locale
var
fileInputButton
:
any
=
document
.
getElementById
(
'
myImport
'
);
...
...
This diff is collapsed.
Click to expand it.
index.php
+
7
−
5
View file @
7793dbe3
...
...
@@ -47,27 +47,29 @@
<span
class=
"glyphicon glyphicon-chevron-right"
></span>
</button>
<div
id=
"mySidenavfs"
class=
"sidenav"
>
<!--<h3> Import File From Server </h3>-->
<?php
echo
"<h3>Import File From Server</h3>"
;
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
"https://baltig.infn.it/api/v4/projects/819/repository/tree?recursive=1&path=RemoteFileSystem"
);
curl_setopt
(
$ch
,
CURLOPT_URL
,
"https://lcappelli_student.unife.it:61nerdolo@oc-chnet.cr.cnaf.infn.it:8443/owncloud/remote.php/webdav/Documents/XRFfilesystem"
);
// curl_setopt($ch, CURLOPT_URL, "https://oc-chnet.cr.cnaf.infn.it:8443/Laura/XRF-App/RemoteFileSystem/");
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_CUSTOMREQUEST
,
"
GET
"
);
curl_setopt
(
$ch
,
CURLOPT_CUSTOMREQUEST
,
"
PROPFIND
"
);
$headers
=
array
();
$headers
[]
=
"
Private-Token: kEzw3Lo1-T7ZaacK1s9z
"
;
$headers
[]
=
"
Depth: infinity
"
;
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$headers
);
$result
=
curl_exec
(
$ch
);
if
(
curl_errno
(
$ch
))
{
echo
'Error:'
.
curl_error
(
$ch
);
echo
'Error:'
.
curl_error
(
$ch
);
}
curl_close
(
$ch
);
echo
"<p id='contentfilesystem'>
$result
</p>"
;
echo
"<p
hidden
id='contentfilesystem'>
$result
</p>"
;
?>
<div
id=
"FileTreeview"
></div>
<h3>
Import File From Local Repository
</h3>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment