|
From: <mpe...@us...> - 2013-03-28 15:51:53
|
Revision: 16183
http://unicore.svn.sourceforge.net/unicore/?rev=16183&view=rev
Author: mpetrova
Date: 2013-03-28 15:51:45 +0000 (Thu, 28 Mar 2013)
Log Message:
-----------
Links to related websites on Main page
Modified Paths:
--------------
unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/icons/IconRepository.java
unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/views/MainView.java
unicore-portal/trunk/ui/src/main/resources/eu/unicore/portal/ui/i18n/UnicoreUIMessages.properties
Added Paths:
-----------
unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/
unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_juelich.png
unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_ogf.png
unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_sourcef.png
unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_unicore.png
Modified: unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/icons/IconRepository.java
===================================================================
--- unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/icons/IconRepository.java 2013-03-28 15:41:24 UTC (rev 16182)
+++ unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/icons/IconRepository.java 2013-03-28 15:51:45 UTC (rev 16183)
@@ -18,17 +18,21 @@
public static final String ICON_ID_REFRESH = ICON_ID_PREFIX_VFSACTION + "refresh"; //$NON-NLS-1$
public static final String ICON_ID_SUBMIT = ICON_ID_PREFIX_VFSACTION + "accept"; //$NON-NLS-1$
public static final String ICON_ID_TO_JOBS = ICON_ID_PREFIX_VFSACTION + "to_jobs"; //$NON-NLS-1$
- public static final String ICON_ID_ARROW_LEFT = ICON_ID_PREFIX_VFSACTION + "arrow_left";
- public static final String ICON_ID_ARROW_RIGHT = ICON_ID_PREFIX_VFSACTION + "arrow_right";
+ public static final String ICON_ID_ARROW_LEFT = ICON_ID_PREFIX_VFSACTION + "arrow_left"; //$NON-NLS-1$
+ public static final String ICON_ID_ARROW_RIGHT = ICON_ID_PREFIX_VFSACTION + "arrow_right"; //$NON-NLS-1$
public static final String ICON_ID_PREFIX_CUSTOM = "custom/"; //$NON-NLS-1$
public static final String ICON_ID_APPLICATIONS = ICON_ID_PREFIX_CUSTOM + "application"; //$NON-NLS-1$
public static final String ICON_ID_RESOURCES = ICON_ID_PREFIX_CUSTOM + "computer"; //$NON-NLS-1$
public static final String ICON_ID_INPUT_FILES = ICON_ID_PREFIX_CUSTOM + "input_files"; //$NON-NLS-1$
- public static final String ICON_ID_PIN = ICON_ID_PREFIX_CUSTOM + "pinned_ovr";
+ public static final String ICON_ID_PIN = ICON_ID_PREFIX_CUSTOM + "pinned_ovr"; //$NON-NLS-1$
public static final String ICON_ID_PREFIX_USER = "user/"; //$NON-NLS-1$
public static final String ICON_ID_USER_IMAGE = ICON_ID_PREFIX_USER + "user_image"; //$NON-NLS-1$
-
+ public static final String ICON_ID_PREFIX_LOGOS = "logos/"; //$NON-NLS-1$
+ public static final String ICON_ID_UNICORE = ICON_ID_PREFIX_LOGOS + "logo_unicore"; //$NON-NLS-1$
+ public static final String ICON_ID_JUELICH = ICON_ID_PREFIX_LOGOS + "logo_juelich"; //$NON-NLS-1$
+ public static final String ICON_ID_SOURCEF = ICON_ID_PREFIX_LOGOS + "logo_sourcef"; //$NON-NLS-1$
+ public static final String ICON_ID_OGF = ICON_ID_PREFIX_LOGOS + "logo_ogf"; //$NON-NLS-1$
}
Modified: unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/views/MainView.java
===================================================================
--- unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/views/MainView.java 2013-03-28 15:41:24 UTC (rev 16182)
+++ unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/views/MainView.java 2013-03-28 15:51:45 UTC (rev 16183)
@@ -5,11 +5,14 @@
import java.util.Date;
import java.util.List;
+import com.vaadin.server.ExternalResource;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
+import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
@@ -24,7 +27,6 @@
import eu.unicore.portal.core.threads.BackgroundWorker;
import eu.unicore.portal.core.threads.IProgressMonitor;
import eu.unicore.portal.ui.IconUtil;
-import eu.unicore.portal.ui.PortalApplication;
import eu.unicore.portal.ui.Styles;
import eu.unicore.portal.ui.i18n.UII18N;
import eu.unicore.portal.ui.icons.IconRepository;
@@ -40,11 +42,13 @@
private static final long serialVersionUID = 1L;
- Label welcomeLabel;
+ private Label welcomeLabel;
private Embedded image;
private Panel imagePanel;
-
- VerticalLayout whatsNew;
+ private GridLayout mainPage;
+ private VerticalLayout whatsNew;
+ private VerticalLayout links;
+ private Label news;
public MainView () {
}
@@ -60,6 +64,7 @@
// init() to make switching language easier.
// app.getMainWindow().setCaption(PortalMessages.getMessage(PortalMessages.AppTitle));
imagePanel = new Panel();
+ imagePanel.setImmediate(true);
System.out.println("-------- locale: " + Session.getCurrent().getLocale());
if(user != null) {
@@ -82,24 +87,65 @@
addComponent(welcomeLabel);
setComponentAlignment(welcomeLabel, Alignment.MIDDLE_CENTER);
+ //Add an empty element as a margin
+// addComponent((new Label(" ", ContentMode.HTML)), 1);
+
addComponent(imagePanel);
- setComponentAlignment(imagePanel, Alignment.TOP_LEFT);
-
- whatsNew = new VerticalLayout();
+ setComponentAlignment(imagePanel, Alignment.TOP_CENTER);
- addComponent(whatsNew);
- setComponentAlignment(whatsNew, Alignment.TOP_LEFT);
+ createMainViewComponents();
+ addComponent(mainPage);
+
+// setComponentAlignment(whatsNew, Alignment.TOP_LEFT);
+// setComponentAlignment(news, Alignment.TOP_CENTER);
BackgroundWorker bg=createUpdater();
bg.scheduleWithFixedDelay(0, 10000);
}
}
+
+ private void createMainViewComponents(){
+ mainPage = new GridLayout(3, 1);
+ mainPage.setColumnExpandRatio(0, 1);
+ mainPage.setColumnExpandRatio(1, 2);
+ mainPage.setColumnExpandRatio(2, 1);
+ mainPage.setWidth(1000f, Unit.PIXELS);
+
+ Label line = new Label("<hr/>", ContentMode.HTML);
+
+ createLinks();
+
+ VerticalLayout container = new VerticalLayout();
+
+ Label eventsLabel = new Label(GlobalState.getMessage(UII18N.ID, "MainView.events"));
+ eventsLabel.setStyleName(Styles.CAPTION2);
+ container.addComponent(eventsLabel, 0);
+// container.addComponent(line, 1);
+ container.addComponent(new Label(" ", ContentMode.HTML), 1);
+ container.addComponent(new Label(" ", ContentMode.HTML), 2);
+ container.addComponent(new Label(" ", ContentMode.HTML), 3);
- Component formatEvent(eu.unicore.portal.core.events.Event ev) {
+ whatsNew = new VerticalLayout();
+ container.addComponent(whatsNew);
+
+ VerticalLayout newsContainer = new VerticalLayout();
+ news = new Label(GlobalState.getMessage(UII18N.ID, "MainView.news"));
+ news.setStyleName(Styles.CAPTION2);
+ news.setSizeUndefined();
+
+ newsContainer.addComponent(news);
+ newsContainer.addComponent(line);
+
+ mainPage.addComponent(links);
+ mainPage.addComponent(newsContainer);
+ mainPage.addComponent(container);
+ }
+
+ private Component formatEvent(eu.unicore.portal.core.events.Event ev) {
String time = DateFormat.getDateTimeInstance().format(new Date(ev.getTime()));
Table message = new Table();
- message.setSizeUndefined();
+ message.setWidth(200f, Unit.PIXELS);
message.setImmediate(true);
message.addContainerProperty(time, String.class, null);
@@ -112,7 +158,45 @@
}
- BackgroundWorker createUpdater(){
+ private void createLinks(){
+ links = new VerticalLayout();
+ links.setHeight(450f, Unit.PIXELS);
+ links.setSpacing(true);
+
+ Label linksLabel = new Label(GlobalState.getMessage(UII18N.ID, "MainView.links"));
+ linksLabel.setStyleName(Styles.CAPTION2);
+ links.addComponent(linksLabel);
+
+// Label line = new Label("<hr/>", ContentMode.HTML);
+// links.addComponent(line);
+
+ Link unicore = new Link();
+ unicore.setTargetName("_blank");
+ unicore.setIcon(IconUtil.getIconFromTheme(IconRepository.ICON_ID_UNICORE));
+ unicore.setResource(new ExternalResource("http://unicore.eu/"));
+ links.addComponent(unicore);
+
+ Link sourcef = new Link();
+ sourcef.setTargetName("_blank");
+ sourcef.setIcon(IconUtil.getIconFromTheme(IconRepository.ICON_ID_SOURCEF));
+ sourcef.setResource(new ExternalResource("http://sourceforge.net/projects/unicore/"));
+ links.addComponent(sourcef);
+
+ Link juelich = new Link();
+ juelich.setTargetName("_blank");
+ juelich.setIcon(IconUtil.getIconFromTheme(IconRepository.ICON_ID_JUELICH));
+ juelich.setResource(new ExternalResource("http://www.fz-juelich.de/ias/jsc/EN/Home/home_node.html"));
+ links.addComponent(juelich);
+
+ Link ogf = new Link();
+ ogf.setTargetName("_blank");
+ ogf.setIcon(IconUtil.getIconFromTheme(IconRepository.ICON_ID_OGF));
+ ogf.setResource(new ExternalResource("http://www.gridforum.org/"));
+ links.addComponent(ogf);
+
+ }
+
+ private BackgroundWorker createUpdater(){
final EventFilter f = new EventFilter(){
@Override
Modified: unicore-portal/trunk/ui/src/main/resources/eu/unicore/portal/ui/i18n/UnicoreUIMessages.properties
===================================================================
--- unicore-portal/trunk/ui/src/main/resources/eu/unicore/portal/ui/i18n/UnicoreUIMessages.properties 2013-03-28 15:41:24 UTC (rev 16182)
+++ unicore-portal/trunk/ui/src/main/resources/eu/unicore/portal/ui/i18n/UnicoreUIMessages.properties 2013-03-28 15:51:45 UTC (rev 16183)
@@ -27,7 +27,9 @@
#------------Main View------------------
MainView.welcome=Welcome
MainView.welcome_usr=Welcome, dear {0}
-MainView.events=Latest events
+MainView.events=LATEST ACTIVITY
+MainView.news=NEWS
+MainView.links=RELATED LINKS
#------------User Profile View----------------
UserProfileView.username=Username
Added: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_juelich.png
===================================================================
(Binary files differ)
Property changes on: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_juelich.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_ogf.png
===================================================================
(Binary files differ)
Property changes on: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_ogf.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_sourcef.png
===================================================================
(Binary files differ)
Property changes on: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_sourcef.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_unicore.png
===================================================================
(Binary files differ)
Property changes on: unicore-portal/trunk/webapp/src/main/webapp/VAADIN/themes/unicore/logos/logo_unicore.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|