2 Replies Latest reply on Dec 9, 2005 8:32 PM by unibrew

    Base Portlet Classes

      I'm just wondering... we seem to have to do this for every new portlet we write. Can't we pull some of this boiler plate code into a superclass? I'm referring to the adding of the new Poll portlet and its supporting classes. I know there's a lot of specific xml parsing code in each of these, but this seems like a pain in the ass to do every time.

      BTW, I'm not saying that Rysiek is doing anything wrong here. We just might be able to make this easier in the future.


      Begin forwarded message:

      From: jboss-svn-commits@lists.sourceforge.net
      Date: November 16, 2005 5:02:39 PM CST
      To: jboss-svn-commits@lists.sourceforge.net
      Subject: [Jboss-svn-commits] JBL Code SVN: r1582 - trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects
      Reply-To: jboss-svn-commits@lists.sourceforge.net

      Author: unibrew
      Date: 2005-11-16 18:02:33 -0500 (Wed, 16 Nov 2005)
      New Revision: 1582

      Added:
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Poll.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollDescriptor.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsWatcher.java
      Modified:
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCounterTools.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersWatcher.java
      trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java
      Log:
      [JBLAB-407] Core files for PollPortlet task.
      [JBLAB-263] Small comments update.


        • 1. Re: Base Portlet Classes
          adamw

          Yes, you are quite right. Most portlets follow similar schema. You can make a JIRA issue :). But maybe we'll do this when NodeWatchers will move to Shotoku.

          Also, I've been thinking, if it's a good approach to make a new "subproject" for every portlet. There's nothing in the way to group them into some logical parts. But maybe we'll do this when we'll have to rewrite alll the .xml descriptors, with the release of portal 2.2.

          • 2. Re: Base Portlet Classes
            unibrew

            Hello :-)

            "damon.sicore@jboss.com" wrote:
            I'm just wondering... we seem to have to do this for every new portlet we write. Can't we pull some of this boiler plate code into a superclass? I'm referring to the adding of the new Poll portlet and its supporting classes. I know there's a lot of specific xml parsing code in each of these, but this seems like a pain in the ass to do every time.


            When I was doing this commit which you have quoted I was really thinking if I'm doing something wrong. However it would be really hard to abstract more any of those files because the content of them differ way too much. The files might look similar because of the names but I'm just trying to fit into convention of naming files which I have found in already existing sources.

            "adamw" wrote:
            Also, I've been thinking, if it's a good approach to make a new "subproject" for every portlet. There's nothing in the way to group them into some logical parts.


            In my opinion this is very good solution. Not every portlet have to have separate dir in portal-extensions. It is so redundant to make or rather copy all those configuration xml-s from different project and changing only few names.
            There are many portlets which could be grouped. Like PollsPortlet, PrimatesPortlet, DownloadsCounterPortlet, Downloads portlet, AdsPortlet etc.