UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
AuthenticationUtil.setRunAsUser("admin");
StreamingNodeImporterFactory streamingNodeImporterFactory = (StreamingNodeImporterFactory)ctx.getBean("streamingNodeImporterFactory");
NodeImporter nodeImporter = streamingNodeImporterFactory.getNodeImporter(new File("importdirectory"));
BulkImportParameters bulkImportParameters = new BulkImportParameters();
bulkImportParameters.setTarget(folderNode);
bulkImportParameters.setReplaceExisting(true);
bulkImportParameters.setBatchSize(40);
bulkImportParameters.setNumThreads(4);
bulkImporter.bulkImport(bulkImportParameters, nodeImporter);
txn.commit();
$ curl -sLG -w -d "sourceDirectory=C:\CaseManager\Capture-Test&targetPath=/Espace%20racine/Case%20Manager" "http://admin:pwd@localhost:8080/alfresco/service/bulk/import/filesystem" -o C:/My/Folder
-d<!DOCTYPE HTML>
<html>
<head>
<title>Bulk Filesystem Import Tool</title>
<link rel="stylesheet" href="/alfresco/css/main.css" TYPE="text/css">
<!– YUI 3.x –>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.3.0/build/widget/assets/skins/sam/widget.css&3.3.0/build/widget/ass... s/skins/sam/widget-stack.css&3.3.0/build/autocomplete/assets/skins/sam/autocomplete.css">
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.3.0/build/yui/yui-min.js&3.3.0/build/intl/intl-min.js&3.3.0/build/a... /lang/autocomplete.js&3.3.0/build/collection/array-extras-min.js&3.3.0/build/oop/oop-min.js&3.3.0/build/event-custom/event-custom-min.js&3.3.0/build/at tribute/attribute-min.js&3.3.0/build/base/base-base-min.js&3.3.0/build/base/base-build-min.js&3.3.0/build/escape/escape-min.js&3.3.0/build/dom/dom-base -min.js&3.3.0/build/dom/selector-native-min.js&3.3.0/build/dom/selector-css2-min.js&3.3.0/build/event/event-base-min.js&3.3.0/build/node/node-base-min. js&3.3.0/build/event/event-base-ie-min.js&3.3.0/build/event/event-synthetic-min.js&3.3.0/build/event/event-focus-min.js&3.3.0/build/event-valuechange/e vent-valuechange-min.js&3.3.0/build/querystring/querystring-stringify-simple-min.js&3.3.0/build/io/io-base-min.js&3.3.0/build/json/json-parse-min.js&3. 3.0/build/jsonp/jsonp-min.js&3.3.0/build/jsonp/jsonp-url-min.js&3.3.0/build/yql/yql-min.js&3.3.0/build/dom/selector-css3-min.js&3.3.0/build/pluginhost/ pluginhost-min.js&3.3.0/build/base/base-pluginhost-min.js&3.3.0/build/dom/dom-style-min.js&3.3.0/build/dom/dom-style-ie-min.js&3.3.0/build/node/node-st yle-min.js&3.3.0/build/classnamemanager/classnamemanager-min.js&3.3.0/build/event/event-delegate-min.js&3.3.0/build/node/node-event-delegate-min.js&3.3 .0/build/widget/widget-min.js&3.3.0/build/widget/widget-base-ie-min.js&3.3.0/build/dom/dom-screen-min.js&3.3.0/build/node/node-screen-min.js&3.3.0/buil d/widget/widget-position-min.js&3.3.0/build/widget/widget-position-align-min.js&3.3.0/build/widget/widget-stack-min.js&3.3.0/build/autocomplete/autocom plete-min.js&3.3.0/build/autocomplete/autocomplete-list-keys-min.js&3.3.0/build/autocomplete/autocomplete-list-keys-min.js"></script>
<style type="text/css">
.yui3-aclist-content {
background-color : white;
border : 1px solid darkgrey;
box-shadow : 3px 3px 4px lightgrey;
-webkit-box-shadow : 3px 3px 4px lightgrey; /* Safari and Chrome */
}
</style>
<!– Validation functions –>
<script type="text/javascript">
function validateRequired(field, errorMessageElement, errorMessage)
{
var result = true;
if (field.value == null || field.value == "")
{
errorMessageElement.textContent = errorMessage;
result = false;
}
else
{
errorMessageElement.textContent = "";
}
return result;
}
function validateForm(form)
{
var result = true;
result = validateRequired(form.sourceDirectory, document.getElementById("sourceDirectoryMessage"), "Source directory is mandatory.");
if (result)
{
result = validateRequired(form.targetPath, document.getElementById("targetPathMessage"), "Target space is mandatory.");
}
return result;
}
</script>
</head>
<body class="yui-skin-sam">
<table>
<tr>
<td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
<td><nobr>Bulk Filesystem Import Tool</nobr></td>
</tr>
<tr><td><td>Alfresco Community v3.4.0 (e 3419)
</table>
<form action="/alfresco/service/bulk/import/filesystem/initiate" method="get" enctype="multipart/form-data" charset="utf-8" onsubmit="return valida teForm(this);">
<table>
<tr>
<td>Import directory:</td><td><input type="text" name="sourceDirectory" size="128" /></td><td id="sourceDirectoryMessage" style="color:red">< /td>
</tr>
<tr>
<td><br/><label for="targetPath">Target space:</label></td>
<td>
<div id="targetNodeRefAutoComplete">
<input id="targetPath" type="text" name="targetPath" size="128" />
<div id="targetPathAutoSuggestContainer"></div>
</div>
</td>
<td id="targetPathMessage" style="color:red"></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td><label for="replaceExisting">Replace existing files:</label></td><td><input type="checkbox" id="replaceExisting" name="replaceExisting" v alue="replaceExisting" unchecked/> (unchecked means skip files that already exist in the repository)</td><td></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="submit" value="Initiate Bulk Import"></td>
</tr>
</table>
<br/>
</form>
<script type="text/javascript">
YUI().use("autocomplete", "autocomplete-highlighters", "datasource-get", function(Y)
{
Y.one('#targetPath').plug(Y.Plugin.AutoComplete,
{
source : '/alfresco/service/bulk/import/filesystem/ajax/suggest/spaces.json?query={query}',
maxResults : 25,
resultHighlighter : 'phraseMatch',
resultListLocator : 'data',
resultTextLocator : 'path'
});
});
</script>
</body>
</html>
-d
J'ai pas eu d'import, ni d'erreur dans les logs, @Cédric quesque je dois mettre a la place de: "%{http_code} %{url_effective}"au minimum il manque /initiate a la fin de votre URL.le /initiate n'a rien changé, es que c'est a cause du code suivent que je n'ai pas initié quelque part ? si oui ou ?
UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
AuthenticationUtil.setRunAsUser("admin");
StreamingNodeImporterFactory streamingNodeImporterFactory = (StreamingNodeImporterFactory)ctx.getBean("streamingNodeImporterFactory");
NodeImporter nodeImporter = streamingNodeImporterFactory.getNodeImporter(new File("importdirectory"));
BulkImportParameters bulkImportParameters = new BulkImportParameters();
bulkImportParameters.setTarget(folderNode);
bulkImportParameters.setReplaceExisting(true);
bulkImportParameters.setBatchSize(40);
bulkImportParameters.setNumThreads(4);
bulkImporter.bulkImport(bulkImportParameters, nodeImporter);
source=C:\CaseManager\Capture-Test
target=/Espace%20racine/Case%20Manager
curl -sLG -w "%{http_code} %{url_effective}" -d "sourceDirectory=C:\CaseManager\Capture-Test&targetPath=/Espace%20racine/Case%20Manager" "http://user:mdp@localhost:8080/alfresco/s/bulk/import/filesystem/ initiate" -o /dev/null
curl -sLG -w "%{http_code} %{url_effective}" -d "sourceDirectory=$source&targetPath=$target" "http://admin:admin@localhost:8080/alfresco/s/bulk/import/filesystem/ initiate" -o /dev/null
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.