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

Commit

Permalink
Merge branch 'integration/master' into refactorOnOptionPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sl-eng committed Nov 15, 2012
2 parents e4c500c + 73ef7b0 commit a2cd02e
Show file tree
Hide file tree
Showing 18 changed files with 223 additions and 126 deletions.
6 changes: 3 additions & 3 deletions functional-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<cargo.host>localhost</cargo.host>
<cargo.container>jboss51x</cargo.container>
<cargo.servlet.port>9898</cargo.servlet.port>
<cargo.installation>http://downloads.sourceforge.net/jboss/jboss-5.1.0.GA.zip?big_mirror=1</cargo.installation>
<cargo.installation>http://aarnet.dl.sourceforge.net/project/jboss/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA-jdk6.zip</cargo.installation>
<cargo.home>${java.io.tmpdir}/cargo/installs/jboss-ewp-5.1.2/jboss-ewp-5.1/jboss-as-web</cargo.home>
<context.path>zanata</context.path>

Expand Down Expand Up @@ -373,10 +373,10 @@
<echo>-Dfunctional-test : to activate functional test run</echo>
<echo>-Dcargo.wait : to ask cargo to start up then wait so that tests can be run manually</echo>
<echo>-Dzanata.target.version=version of zanata to deploy. Default is: ${project.parent.version}</echo>
<echo>-Dzanata.target.war=location of the war. Default is: ${basedir}/../zanata-war/target/zanata-${zanata.target.version}-autotest.war</echo>
<echo>-Dzanata.target.war=location of the war. Default is: ${basedir}/../zanata-war/target/zanata-${zanata.target.version}.war</echo>
<echo>-Dzanata.instance.url=http://${cargo.host}:8080/${context.path}</echo>
<echo>-Dzanata.apikey=b6d7044e9ee3b2447c28fb7c50d86d98</echo>
<echo>-Dzanata.client.version=maven client version to use. Currently: ${zanata.client.version}</echo>
<!--<echo>-Dzanata.client.version=maven client version to use. Currently: ${zanata.client.version}</echo>-->
<echo>-Dzanata.sample.projects.basedir=${project.build.testOutputDirectory}/sample-projects</echo>
<echo>==========================================================</echo>
</target>
Expand Down
48 changes: 0 additions & 48 deletions functional-test/sample-projects/plural/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,11 @@
<plugin>
<groupId>org.zanata</groupId>
<artifactId>zanata-maven-plugin</artifactId>
<version>${zanata.client.version}</version>
<configuration>
<srcDir>pot</srcDir>
<transDir>.</transDir>
</configuration>
</plugin>
</plugins>
</build>
<!-- NB: this is not needed if you have the jboss 'public' repository group enabled -->
<pluginRepositories>
<pluginRepository>
<id>zanata-cloudbees-release</id>
<name>zanata-cloudbees-release</name>
<url>http://repository-zanata.forge.cloudbees.com/release/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>zanata-cloudbees-snapshot</id>
<name>zanata-cloudbees-snapshot</name>
<url>http://repository-zanata.forge.cloudbees.com/snapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-releases</id>
<name>jboss-releases</name>
<url>http://repository.jboss.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-thirdparty-releases</id>
<name>jboss-thirdparty-releases</name>
<url>http://repository.jboss.org/nexus/content/repositories/thirdparty-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
48 changes: 0 additions & 48 deletions functional-test/sample-projects/trans-memory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,11 @@
<plugin>
<groupId>org.zanata</groupId>
<artifactId>zanata-maven-plugin</artifactId>
<version>${zanata.client.version}</version>
<configuration>
<srcDir>pot</srcDir>
<transDir>.</transDir>
</configuration>
</plugin>
</plugins>
</build>
<!-- NB: this is not needed if you have the jboss 'public' repository group enabled -->
<pluginRepositories>
<pluginRepository>
<id>zanata-cloudbees-release</id>
<name>zanata-cloudbees-release</name>
<url>http://repository-zanata.forge.cloudbees.com/release/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>zanata-cloudbees-snapshot</id>
<name>zanata-cloudbees-snapshot</name>
<url>http://repository-zanata.forge.cloudbees.com/snapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-releases</id>
<name>jboss-releases</name>
<url>http://repository.jboss.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-thirdparty-releases</id>
<name>jboss-thirdparty-releases</name>
<url>http://repository.jboss.org/nexus/content/repositories/thirdparty-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.slf4j.LoggerFactory;
import org.zanata.util.Constants;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -61,7 +62,8 @@ public int mvnPush(String sampleProject, String... extraPushOptions)
try
{
List<String> command = zanataMavenPushCommand(extraPushOptions);
log.info("execute command: {}", command);
Joiner joiner = Joiner.on(" ");
log.info("execute command: \n{}\n", joiner.join(command));

process = invokeMaven(projectDir, command);
process.waitFor();
Expand Down Expand Up @@ -106,7 +108,7 @@ private synchronized static Process invokeMaven(File projectDir, List<String> co
// mvn and java home
log.info("M2: {}", env.get("M2"));
log.info("JAVA_HOME: {}", env.get("JAVA_HOME"));
log.debug("env: {}", env);
// log.debug("env: {}", env);
processBuilder.directory(projectDir);
return processBuilder.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ public void execute(Database database) throws CustomChangeException
{
try
{
if( rset != null && !rset.isClosed() )
if( rset != null)
{
rset.close();
}
if( stmt != null && !stmt.isClosed() )
if( stmt != null)
{
stmt.close();
}
}
catch (SQLException e)
catch (Exception e)
{
// Ignore this one, already closed probably
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public <H extends ProcessHandle> void runAsynchronously(RunnableProcess<H> proce

private void outjectProcessHandle(ProcessHandle handle)
{
Contexts.getEventContext().set("asynchronousProcessHandle", handle);
if (Contexts.isEventContextActive())
{
Contexts.getEventContext().set("asynchronousProcessHandle", handle);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

/**
* This component executes {@link RunnableProcess} objects.
* This class should be used instead of {@link BackgroundProcess}
*
* @author Carlos Munoz <a href="mailto:camunoz@redhat.com">camunoz@redhat.com</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ public class CopyTransResourceService implements CopyTransResource
* @param docId Document Id to copy translations into.
* @return The following response status codes will be returned from this
* operation:<br>
* NO CONTENT(204) - Translation copy was started for the given document.
* locale. <br>
* OK(200) - Translation copy was started for the given document. The status of the
* process is also returned in the response contents.<br>
* UNAUTHORIZED(401) - If the user does not have the proper
* permissions to perform this operation.<br>
* INTERNAL SERVER ERROR(500) - If there is an unexpected
* error in the server while performing this operation. Translation copy will
* not start in this case.
*/
@Override
public void startCopyTrans(@PathParam("projectSlug") String projectSlug,
public CopyTransStatus startCopyTrans(@PathParam("projectSlug") String projectSlug,
@PathParam("iterationSlug") String iterationSlug,
@PathParam("docId") String docId)
{
Expand All @@ -77,7 +77,10 @@ public void startCopyTrans(@PathParam("projectSlug") String projectSlug,
throw new NoSuchEntityException("Could not find document: " + projectSlug + "/" + iterationSlug + "/" + docId);
}

// NB: Permission check happens in the Copy Trans service itself.

copyTransManager.startCopyTrans(document, null); // TODO allow options from the Rest endpoint
return this.getCopyTransStatus(projectSlug, iterationSlug, docId);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public UpdateTransUnitCallback(TransUnitSaveEvent event, TransUnitId id)
public void onFailure(Throwable e)
{
Log.error("UpdateTransUnit failure ", e);
saveFailure(e.getMessage());
saveFailure("id " + id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
Expand All @@ -31,10 +32,12 @@ public class CodeMirrorEditor extends Composite implements TextAreaWrapper
private JavaScriptObject codeMirror;
private boolean valueChangeHandlerInitialized;
private boolean editing;
private final Command onFocusCallback;


public CodeMirrorEditor()
public CodeMirrorEditor(Command onFocusCallback)
{
this.onFocusCallback = onFocusCallback;
initWidget(ourUiBinder.createAndBindUi(this));
}

Expand Down Expand Up @@ -97,6 +100,8 @@ private void onFocus()
// NativeEvent focusEvent = Document.get().createFocusEvent();
// FocusEvent.fireNativeEvent(focusEvent, this, this.getElement());
editing = true;
// this is to ensure row selection (on right click)
onFocusCallback.execute();
}

// callback function for the code mirror instance. Gets called when code mirror editor is on blur.
Expand Down
24 changes: 14 additions & 10 deletions zanata-war/src/main/java/org/zanata/webtrans/client/ui/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
Expand Down Expand Up @@ -55,14 +56,23 @@ public class Editor extends Composite implements ToggleEditor
@UiField(provided = true)
TextAreaWrapper textArea;

public Editor(String displayString, int index, final TargetContentsDisplay.Listener listener, TransUnitId id)
public Editor(String displayString, final int index, final TargetContentsDisplay.Listener listener, final TransUnitId id)
{
this.listener = listener;
this.index = index;
this.id = id;
if (listener.isUsingCodeMirror())
{
textArea = new CodeMirrorEditor();
Command onCodeMirrorFocusCallback = new Command()
{

@Override
public void execute()
{
listener.onEditorClicked(id, index);
}
};
textArea = new CodeMirrorEditor(onCodeMirrorFocusCallback);
}
else
{
Expand Down Expand Up @@ -95,19 +105,13 @@ public void onValueChange(ValueChangeEvent<String> event)
listener.setEditingState(id, UNSAVED);
}

@UiHandler("rootContainer")
public void onEditorClick(ClickEvent event)
{
listener.onEditorClicked(id, index);
textArea.setEditing(true);
fireValidationEvent();
}

@UiHandler("textArea")
public void onTextAreaFocus(FocusEvent event)
{
listener.onEditorClicked(id, index);
textArea.setFocus(true);
textArea.setEditing(true);
fireValidationEvent();
}

@UiHandler("textArea")
Expand Down
Loading

0 comments on commit a2cd02e

Please sign in to comment.