Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Commit

Permalink
home screen - added twitter, events and blog posts panels.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jul 27, 2011
1 parent 05ca443 commit 495e0a9
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 20 deletions.
32 changes: 13 additions & 19 deletions usergroup-portal/pom.xml
Expand Up @@ -15,12 +15,11 @@
<!-- Sets the project's default encoding. http://docs.codehaus.org/display/MAVENUSER/POM+Element+for+Source+File+Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- This is just for "eclipse:eclipse" goal to always attempt downloading
sources -->
<!-- This is just for "eclipse:eclipse" goal to always attempt downloading sources -->
<downloadSources>true</downloadSources>

<!-- Specify AppEngine version for your project. It should match SDK version
pointed to by ${gae.home} property (Typically, one used by your Eclipse plug-in) -->
<!-- Specify AppEngine version for your project. It should match SDK version pointed to by ${gae.home} property (Typically,
one used by your Eclipse plug-in) -->
<gae.version>1.5.1</gae.version>

<!-- GWT version -->
Expand All @@ -34,12 +33,12 @@

<!-- Produce detailed JS during GWT compilation for development environment -->
<gwt.style>DETAILED</gwt.style>

<gae.home>${settings.localRepository}/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}</gae.home>
<rebel.home>${env.REBEL_HOME}</rebel.home>
<maven.gae.plugin.version>0.8.4</maven.gae.plugin.version>
<objectify.version>3.0</objectify.version>

</properties>

<dependencies>
Expand Down Expand Up @@ -72,8 +71,8 @@
<version>6.6.2</version>
</dependency>

<!-- J2EE Servlet API. We need it to compile IndexServlet class. You can
probably remove it, if you don't explicitly use Servlets -->
<!-- J2EE Servlet API. We need it to compile IndexServlet class. You can probably remove it, if you don't explicitly use
Servlets -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
Expand Down Expand Up @@ -176,8 +175,7 @@
</plugin>


<!-- The actual maven-gae-plugin. Type "mvn gae:run" to run project, "mvn
gae:deploy" to upload to GAE. -->
<!-- The actual maven-gae-plugin. Type "mvn gae:run" to run project, "mvn gae:deploy" to upload to GAE. -->
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
Expand Down Expand Up @@ -215,9 +213,8 @@

<profiles>

<!-- We can configure our integration server to activate this profile and
perform gae:deploy, thus uploading latest snapshot to the http://1.latest.<applicationName>.appspot.com
automatically -->
<!-- We can configure our integration server to activate this profile and perform gae:deploy, thus uploading latest snapshot
to the http://1.latest.<applicationName>.appspot.com automatically -->
<profile>
<id>integration-build</id>
<properties>
Expand All @@ -228,10 +225,8 @@
</properties>
</profile>

<!-- This profile will activate automatically during release and upload
application to the http://2.latest.<applicationName>.appspot.com (We might
want to set the 2nd version as our applications Default version to be accessible
at http://<applicationName>.appspot.com) -->
<!-- This profile will activate automatically during release and upload application to the http://2.latest.<applicationName>.appspot.com
(We might want to set the 2nd version as our applications Default version to be accessible at http://<applicationName>.appspot.com) -->
<profile>
<id>release-build</id>
<activation>
Expand All @@ -242,8 +237,7 @@
</activation>

<properties>
<!-- During release, set application version in appengine-web.xml to
2 -->
<!-- During release, set application version in appengine-web.xml to 2 -->
<gae.application.version>release</gae.application.version>

<!-- Produce compressed JS during GWT compilation for production environment -->
Expand Down
Expand Up @@ -39,5 +39,4 @@ public void init() {
mainWindow.addComponent(layout);
setMainWindow(mainWindow);
}

}
Expand Up @@ -4,19 +4,42 @@
package ugportal.ui.vaadin.home;

import ugportal.ui.vaadin.component.UgPanel;
import ugportal.ui.vaadin.home.blogposts.BlogPostsPanel;
import ugportal.ui.vaadin.home.events.EventsPanel;
import ugportal.ui.vaadin.home.twitter.TwitterPanel;

import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;

/**
* @author Ondrej Kvasnovsky
*/
public class HomePanel extends UgPanel {

/**
* serialVersionUID
*/
private static final long serialVersionUID = 3663031940629380280L;

/**
* Creates new instance.
*
* @param caption
*/
public HomePanel(String caption) {
super(caption);
GridLayout layoutMain = new GridLayout(3, 1);
layoutMain.setSizeFull();
TwitterPanel twitterPanel = new TwitterPanel("Twitter");
layoutMain.addComponent(twitterPanel, 0, 0);
layoutMain.setComponentAlignment(twitterPanel, Alignment.TOP_LEFT);
BlogPostsPanel lblBlogNews = new BlogPostsPanel("Blog posts");
layoutMain.addComponent(lblBlogNews, 1, 0);
layoutMain.setComponentAlignment(lblBlogNews, Alignment.TOP_CENTER);
EventsPanel lblEvents = new EventsPanel("Events");
layoutMain.addComponent(lblEvents, 2, 0);
layoutMain.setComponentAlignment(lblEvents, Alignment.TOP_RIGHT);
setContent(layoutMain);
}

}
@@ -0,0 +1,31 @@
/**
* BlogPostsPanel.java, 27.7.2011 13:04:45
*/
package ugportal.ui.vaadin.home.blogposts;

import com.vaadin.ui.Label;

import ugportal.ui.vaadin.component.UgPanel;

/**
* @author Ondrej Kvasnovsky
*/
public class BlogPostsPanel extends UgPanel {

/**
* serialVersionUID
*/
private static final long serialVersionUID = -2991931688786507107L;

/**
* Creates new instance.
*
* @param caption
*/
public BlogPostsPanel(String caption) {
super(caption);
Label lblTitle = new Label("Blog posts");
addComponent(lblTitle);
}

}
@@ -0,0 +1,31 @@
/**
* EventsPanel.java, 27.7.2011 13:04:31
*/
package ugportal.ui.vaadin.home.events;

import com.vaadin.ui.Label;

import ugportal.ui.vaadin.component.UgPanel;

/**
* @author Ondrej Kvasnovsky
*/
public class EventsPanel extends UgPanel {

/**
* serialVersionUID
*/
private static final long serialVersionUID = 5460100070350560381L;

/**
* Creates new instance.
*
* @param caption
*/
public EventsPanel(String caption) {
super(caption);
Label lblTitle = new Label("Events");
addComponent(lblTitle);
}

}
@@ -0,0 +1,44 @@
/**
* TwitterPanel.java, 27.7.2011 12:59:52
*/
package ugportal.ui.vaadin.home.twitter;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import ugportal.ui.vaadin.component.UgPanel;

import com.vaadin.ui.CustomLayout;

/**
* @author Ondrej Kvasnovsky
*/
public class TwitterPanel extends UgPanel {

/**
* serialVersionUID
*/
private static final long serialVersionUID = -1258239136644410258L;

/**
* Creates new instance.
*
* @param caption
*/
public TwitterPanel(final String caption) {
super(caption);
final String javaScript = "<div /><script src=\"http://widgets.twimg.com/j/2/widget.js\"></script>"
+ "<script> new TWTR.Widget({ version: 2, type: 'faves', rpp: 10, interval: 6000, title: 'Tweets by', subject: 'Java User Group - Ostrava',"
+ "width: 'auto', height: 300, theme: { shell: { background: '#f14d1a', color: '#ffffff' }, tweets: { background: '#ffffff',"
+ "color: '#444444', links: '#f14d1a' } }, features: { scrollbar: true, loop: false, live: true, hashtags: true, timestamp: true,"
+ "avatars: true, behavior: 'all' }}).render().setUser('@OstravaJUG').start();</script>";
try {
CustomLayout custom = new CustomLayout(new ByteArrayInputStream(javaScript.getBytes()));
custom.setWidth("290px");
custom.setHeight("390px");
addComponent(custom);
} catch (IOException e) {
e.printStackTrace();
}
}
}

0 comments on commit 495e0a9

Please sign in to comment.