Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1030732 - Change copy trans to load document entity within the sp…
Browse files Browse the repository at this point in the history
…awned transaction.
  • Loading branch information
Carlos A. Munoz committed Nov 15, 2013
1 parent f6fc82c commit 63d14df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -123,10 +123,10 @@ private String createComment(HTextFlowTarget target) {

@Override
public void copyTransForLocale(HDocument document, HLocale locale) {
this.copyTransForLocale(document, locale, new HCopyTransOptions());
this.copyTransForLocale(document.getId(), locale, new HCopyTransOptions());
}

public void copyTransForLocale(final HDocument document,
public void copyTransForLocale(final Long documentId,
final HLocale locale, final HCopyTransOptions options) {
try {
new Work<Void>() {
Expand All @@ -136,6 +136,7 @@ protected Void work() throws Exception {

boolean checkContext = false, checkProject = false,
checkDocument = false;
HDocument document = documentDAO.findById(documentId);
boolean requireTranslationReview =
document.getProjectIteration()
.getRequireTranslationReview();
Expand Down Expand Up @@ -433,7 +434,7 @@ public void copyTransForDocument(HDocument document,
if (taskHandleOpt.isPresent() && taskHandleOpt.get().isCancelled()) {
return;
}
copyTransForLocale(document, locale, copyTransOpts);
copyTransForLocale(document.getId(), locale, copyTransOpts);
}

if (taskHandleOpt.isPresent()) {
Expand Down
Expand Up @@ -341,8 +341,7 @@ public void testCopyTrans(CopyTransExecution execution) {
new HCopyTransOptions(execution.getContextMismatchAction(),
execution.getDocumentMismatchAction(),
execution.getProjectMismatchAction());
CopyTransService copyTransService = seam// .use("asynchronousProcessHandle",
// handle)
CopyTransService copyTransService = seam
.autowire(CopyTransServiceImpl.class);
copyTransService.copyTransForIteration(projectIteration, options);

Expand Down

0 comments on commit 63d14df

Please sign in to comment.