Search in sources :

Example 11 with RestoreRequest

use of org.xwiki.refactoring.job.RestoreRequest in project xwiki-platform by xwiki.

the class RestoreJob method runInternal.

@Override
protected void runInternal() throws Exception {
    RestoreRequest request = getRequest();
    initializeContext(request);
    boolean checkRights = request.isCheckRights();
    this.progressManager.pushLevelProgress(2, this);
    this.progressManager.startStep(this);
    // Read the request and build the final list of IDs to restore.
    List<Long> idsToRestore = getIdsToRestore(request);
    this.progressManager.startStep(this);
    // Process each ID and try to restore it.
    restoreDocuments(idsToRestore, checkRights);
    this.progressManager.popLevelProgress(this);
}
Also used : RestoreRequest(org.xwiki.refactoring.job.RestoreRequest)

Example 12 with RestoreRequest

use of org.xwiki.refactoring.job.RestoreRequest in project xwiki-platform by xwiki.

the class RefactoringScriptService method initializeRestoreRequest.

private RestoreRequest initializeRestoreRequest() {
    RestoreRequest request = new RestoreRequest();
    request.setId(generateJobId(RefactoringJobs.RESTORE));
    request.setCheckRights(true);
    request.setUserReference(this.documentAccessBridge.getCurrentUserReference());
    request.setWikiReference(getCurrentWikiReference());
    return request;
}
Also used : RestoreRequest(org.xwiki.refactoring.job.RestoreRequest)

Aggregations

RestoreRequest (org.xwiki.refactoring.job.RestoreRequest)12 Test (org.junit.Test)5 JobGroupPath (org.xwiki.job.JobGroupPath)2 XWikiException (com.xpn.xwiki.XWikiException)1 JobException (org.xwiki.job.JobException)1 JobExecutor (org.xwiki.job.JobExecutor)1 WikiReference (org.xwiki.model.reference.WikiReference)1 RefactoringScriptService (org.xwiki.refactoring.script.RefactoringScriptService)1 ScriptService (org.xwiki.script.service.ScriptService)1