Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-googlemap/src/java/com/finalist/portlets/googlemap
In directory 
james.mmbase.org:/tmp/cvs-serv25090/portlets-googlemap/src/java/com/finalist/portlets/googlemap

Modified Files:
        GoogleMapPortlet.java 
Log Message:
CMSC-871 - Updated GoogleMap code: added height & width portlet parameters; 
refactored edit screen.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-googlemap/src/java/com/finalist/portlets/googlemap
See also: http://www.mmbase.org/jira/browse/CMSC-871


Index: GoogleMapPortlet.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-googlemap/src/java/com/finalist/portlets/googlemap/GoogleMapPortlet.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- GoogleMapPortlet.java       12 Apr 2008 14:25:37 -0000      1.5
+++ GoogleMapPortlet.java       25 Apr 2008 11:56:11 -0000      1.6
@@ -16,25 +16,37 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class GoogleMapPortlet extends CmscPortlet
+public class GoogleMapPortlet extends CmscPortlet {
 
-{
-    private static Log log = LogFactory.getLog(GoogleMapPortlet.class);
-
-   private static final String GOOGLE_KEY_PROPERTY = "google.key";
+   /**
+    * Configuration constants.
+    */
+   public static final String GOOGLE_KEY_PROPERTY = "google.key";
+   public static final String ACTION_PARAM = "action";
+   public static final String WINDOW = "window";
+   public static final String PAGE = "page";
+   public static final String ADDRESS = "address";
+   public static final String INFO = "info";
+   public static final String KEY = "key";
+   public static final String HEIGHT = "height";
+   public static final String WIDTH = "width";
+
+   /**
+    * Configuration default constants.
+    */
+   public static final String HEIGHT_ATTR_DEFAULT = "260px";
+   public static final String WIDTH_ATTR_DEFAULT = "370px";
 
-   private static final String ACTION_PARAM = "action";
-   private static final String WINDOW = "window";
-   private static final String PAGE = "page";
-   private static final String ADDRESS = "address";
-   private static final String INFO = "info";
-   private static final String KEY = "key";
+   private static Log log = LogFactory.getLog(GoogleMapPortlet.class);
 
 
    protected void doView(RenderRequest request, RenderResponse response) 
throws PortletException, IOException {
       PortletPreferences preferences = request.getPreferences();
       request.setAttribute(ADDRESS, preferences.getValue(ADDRESS, null));
       request.setAttribute(INFO, preferences.getValue(INFO, null));
+      request.setAttribute(HEIGHT, preferences.getValue(HEIGHT, 
HEIGHT_ATTR_DEFAULT));
+      request.setAttribute(WIDTH, preferences.getValue(WIDTH, 
WIDTH_ATTR_DEFAULT));
+      
       String key = StringUtils.isEmpty(preferences.getValue(KEY, null)) ? 
PropertiesUtil.getProperty(GOOGLE_KEY_PROPERTY)
             : preferences.getValue(KEY, null);
       request.setAttribute(KEY, key);
@@ -54,6 +66,8 @@
             setPortletParameter(portletId, INFO, request.getParameter(INFO));
             setPortletParameter(portletId, WINDOW, 
request.getParameter(WINDOW));
             setPortletParameter(portletId, KEY, request.getParameter(KEY));
+            setPortletParameter(portletId, WIDTH, request.getParameter(WIDTH));
+            setPortletParameter(portletId, HEIGHT, 
request.getParameter(HEIGHT));
             setPortletNodeParameter(portletId, PAGE, 
request.getParameter(PAGE));
          }
          else if (log.isDebugEnabled())
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to