Files
ofbiz-framework/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl
T
Sascha Rodekamp 0141c39f55 Reintegrating the Jackrabbit Development branch into the turnk.
The Merge contains the basic integration of jackrabbit into ofbiz and provides a simple API for further development.

Features:
API for easy CRUD operations
Versioning 
Multi Language Support
Object Content Mapping
Sample Implementation in Example Area

See this merge as first step. The development is still in progress but this is the stable starting point for all feature developments.


Detailed description can be found in the Wiki: https://cwiki.apache.org/OFBIZ/jackrabbit-branch-development.html

For any questions, requests, issues use the jira post: https://issues.apache.org/jira/browse/OFBIZ-4659

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1231647 13f79535-47bb-0310-9956-ffa450edef68
2012-01-15 10:41:50 +00:00

110 lines
3.8 KiB
Plaintext

<#--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script>
<div id="jackrabbitFileTree">${parameters.fileTree!""}</div>
<script type="text/javascript">
var rawdata = ${parameters.fileTree!};
jQuery(function () {
jQuery("#jackrabbitFileTree").jstree({
"plugins" : [ "themes", "json_data", "ui", "contextmenu"],
"json_data" : {
"data" : rawdata
},
'contextmenu': {
'items': {
'ccp' : false,
'create' : false,
'rename' : false,
'open' : {
'label' : "${uiLabelMap.ExampelsJackrabbitOpenFile}",
'action' : function(obj) {
openFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
}
},
'remove' : {
'label' : "${uiLabelMap.ExampelsJackrabbitRemoveFile}",
'action' : function(obj) {
removeFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
}
},
'download' : {
'label' : "${uiLabelMap.ExampelsJackrabbitDownloadFile}",
'action' : function(obj) {
downloadFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
}
}
}
}
});
});
function openFileFromRepository(nodepath, nodetype) {
var parameters = {"path" : nodepath};
var url = "OpenFileInformation";
runPostRequest(url, parameters)
}
function removeFileFromRepository(nodepath, nodetype) {
var parameters = {"path" : nodepath};
var url = "RemoveRepositoryFile";
runPostRequest(url, parameters)
}
function downloadFileFromRepository(nodepath, nodetype) {
if ("nt:folder" == nodetype) { // the open function for foldes is not supported yet.
return;
}
var parameters = {"path" : nodepath};
var url = "GetFileFromRepository";
runPostRequest(url, parameters)
}
function runPostRequest(url, parameters) {
// create a hidden form
var form = jQuery('<form></form>');
form.attr("method", "POST");
form.attr("action", url);
jQuery.each(parameters, function(key, value) {
var field = jQuery('<input></input>');
field.attr("type", "hidden");
field.attr("name", key);
field.attr("value", value);
form.append(field);
});
// The form needs to be apart of the document in
// order for us to be able to submit it.
jQuery(document.body).append(form);
form.submit();
form.remove();
}
</script>