Skip to content

Commit

Permalink
Merge pull request pentaho#4496 from Kyrrui/BACKLOG-18845
Browse files Browse the repository at this point in the history
[BACKLOG-18845] Remove the need for VERSION_FOR_LICENSE replacement
  • Loading branch information
jgminder authored Oct 25, 2017
2 parents eda91e9 + 99b8fb4 commit 8c8e291
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 34 deletions.
32 changes: 0 additions & 32 deletions plugins/file-open-save/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<properties>
<maven-replacer-plugin.version>1.5.2</maven-replacer-plugin.version>
<src.dir>target/processed-sources</src.dir>
</properties>

<dependencies>
Expand Down Expand Up @@ -107,7 +106,6 @@
</dependency>
</dependencies>
<build>
<sourceDirectory>${src.dir}</sourceDirectory>
<resources>
<resource>
<filtering>false</filtering>
Expand Down Expand Up @@ -138,36 +136,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>${maven-replacer-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<basedir>${basedir}/src/main/java</basedir>
<outputDir>../../../target/processed-sources</outputDir>
<includes>
<include>**/*.java</include>
</includes>
<replacements>
<replacement>
<token>@PROJECT_ARTIFACT_ID@</token>
<value>${project.artifactId}</value>
</replacement>
<replacement>
<token>@PROJECT_VERSION@</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
import org.pentaho.platform.settings.ServerPort;
import org.pentaho.platform.settings.ServerPortRegistry;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
* Created by bmorrise on 5/23/17.
*/
Expand All @@ -36,7 +40,6 @@ public class RepositoryOpenSaveDialog extends ThinDialog {
public static final String STATE_OPEN = "open";
private static final Image LOGO = GUIResource.getInstance().getImageLogoSmall();
private static final String OSGI_SERVICE_PORT = "OSGI_SERVICE_PORT";
private static final String CLIENT_PATH = "/@PROJECT_ARTIFACT_ID@/@PROJECT_VERSION@/index.html";
private static final int OPTIONS = SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX;
private static final String THIN_CLIENT_HOST = "THIN_CLIENT_HOST";
private static final String THIN_CLIENT_PORT = "THIN_CLIENT_PORT";
Expand All @@ -53,7 +56,7 @@ public RepositoryOpenSaveDialog( Shell shell, int width, int height ) {

public void open( String directory, String state, String filter, String origin ) {
StringBuilder clientPath = new StringBuilder();
clientPath.append( CLIENT_PATH );
clientPath.append( getClientPath() );
clientPath.append( !Utils.isEmpty( directory ) ? "#?path=" + directory : "#?" );
clientPath.append( !Utils.isEmpty( directory ) ? "&" : "" );
clientPath.append( !Utils.isEmpty( state ) ? "state=" + state : "" );
Expand Down Expand Up @@ -94,6 +97,18 @@ public void open( String directory, String state, String filter, String origin )
}
}

private static String getClientPath() {
Properties properties = new Properties();
try {
InputStream inputStream =
RepositoryOpenSaveDialog.class.getClassLoader().getResourceAsStream( "project.properties" );
properties.load( inputStream );
} catch ( IOException e ) {
e.printStackTrace();
}
return properties.getProperty( "CLIENT_PATH" );
}

private static Integer getOsgiServicePort() {
// if no service port is specified try getting it from
ServerPort osgiServicePort = ServerPortRegistry.getPort( OSGI_SERVICE_PORT );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CLIENT_PATH=/${project.artifactId}/${project.version}/index.html

0 comments on commit 8c8e291

Please sign in to comment.