Skip to content

Commit 1a0a565

Browse files
fix image resource path using portlet.properties (#61)
* build image resource path using portlets.properties
1 parent 5ac4971 commit 1a0a565

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>projectwizard-portlet</artifactId>
77
<groupId>life.qbic</groupId>
8-
<version>1.13.0-SNAPSHOT</version>
8+
<version>1.13.0</version>
99
<name>ProjectWizard Portlet</name>
1010
<url>https://github.com/qbicsoftware/projectwizard-portlet</url>
1111
<description>Creates hierarchical experiments using factorial design.</description>

src/main/java/life/qbic/portal/portlet/ProjectWizardUI.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.List;
1010
import java.util.Map;
1111
import java.util.Properties;
12+
1213
import org.apache.logging.log4j.LogManager;
1314
import org.apache.logging.log4j.Logger;
1415
import org.vaadin.teemu.wizards.Wizard;
@@ -33,8 +34,6 @@
3334
import life.qbic.omero.BasicOMEROClient;
3435
import life.qbic.openbis.openbisclient.IOpenBisClient;
3536
import life.qbic.openbis.openbisclient.OpenBisClient;
36-
import life.qbic.portal.portlet.QBiCPortletUI;
37-
import life.qbic.portal.samplegraph.GraphPage;
3837
import life.qbic.portal.utils.ConfigurationManager;
3938
import life.qbic.portal.utils.ConfigurationManagerFactory;
4039
import life.qbic.portal.utils.PortalUtils;
@@ -64,7 +63,7 @@ public class ProjectWizardUI extends QBiCPortletUI {
6463
List<String> expTypes = new ArrayList<String>(
6564
Arrays.asList("Q_EXPERIMENTAL_DESIGN", "Q_SAMPLE_EXTRACTION", "Q_SAMPLE_PREPARATION"));
6665

67-
private Logger logger = LogManager.getLogger(ProjectWizardUI.class);
66+
private final static Logger logger = LogManager.getLogger(ProjectWizardUI.class);
6867

6968
private ConfigurationManager config;
7069

@@ -284,17 +283,16 @@ public static String getPathToVaadinFolder() {
284283
if (PortalUtils.isLiferayPortlet()) {
285284
Properties prop = new Properties();
286285
// workaround
287-
GraphPage p = new GraphPage();
288-
InputStream in = p.getClass().getClassLoader()
289-
.getResourceAsStream("WEB-INF/liferay-plugin-package.properties");
286+
InputStream in = ProjectWizardUI.class.getClassLoader()
287+
.getResourceAsStream("portlet.properties");
290288
try {
291289
prop.load(in);
292290
in.close();
293291
} catch (IOException e1) {
294-
// TODO Auto-generated catch block
292+
logger.error("Could not load portlet.properties");
295293
e1.printStackTrace();
296294
}
297-
String portletName = prop.getProperty("name");
295+
String portletName = prop.getProperty("artifact.id");
298296

299297
URI location = UI.getCurrent().getPage().getLocation();
300298
// http

src/main/java/life/qbic/projectwizard/views/ExperimentImportView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ public void buttonClick(ClickEvent event) {
160160

161161
Resource res =
162162
new ExternalResource(ProjectWizardUI.getPathToVaadinFolder() + "img/isatools.png");
163-
Image imNotYourC_Pal = new Image(null, res);
164-
layout.addComponent(imNotYourC_Pal);
163+
Image isaTools = new Image(null, res);
164+
layout.addComponent(isaTools);
165165

166166
subWindow.setContent(layout);
167167
// Center it in the browser window

src/main/resources/portlet.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ include-and-override=${liferay.home}/qbic-ext.properties
33
# Do not modify the values. These are automatically resolved by maven during the build.
44
version=${project.version}
55
repository.url=${project.url}
6+
artifact.id=${artifactId}

0 commit comments

Comments
 (0)