ICEfaces
  1. ICEfaces
  2. ICE-2040

Timezone tutorial docs need updating

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7RC1, 1.7
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      All

      Description

      Specifically Step 2 does not include changes to the TimeZoneBean.java file, but generically we should review the doc to ensure that all changes regarding the image map are properly reflected in the Getting Started Guide.

        Activity

        Hide
        Mark Collette added a comment -

        There was further input on the timezone tutorial:
        http://www.icefaces.org/JForum/posts/list/6013.page

        Show
        Mark Collette added a comment - There was further input on the timezone tutorial: http://www.icefaces.org/JForum/posts/list/6013.page
        Hide
        Ken Fyten added a comment -

        Please review existing Timezone tutorial doc and complete updated content or a detailed description of necessary changes to make the doc description match the tutorial src code.

        Show
        Ken Fyten added a comment - Please review existing Timezone tutorial doc and complete updated content or a detailed description of necessary changes to make the doc description match the tutorial src code.
        Hide
        Arturo Zambrano added a comment -

        (pages refer to the absolute numbering of the document: ICEfacesGettingStartedGuide.pdf)

        +++++ Step 1 +++++

        page 28
        in web.xml
        the actual file contains an additional description line
        <description>
        ICEfaces Tutorial: Timezone Part 1
        Create TimeZone as a stock JavaServer Faces application.
        </description>

        page 29
        in web.xml
        the tutorial instructs to add this, but the actual file doesn't have it
        <context-param>
        <param-name>javax.faces.application.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
        </context-param>

        page 28
        in web.xml
        the actual file contains this, but the tutorial doesn't mention it
        <session-config>
        <session-timeout>30</session-timeout>
        </session-config>

        +++++ Step 2 +++++

        In fact, step 2 of the tutorial doesn't mention important changes to the code:

        in TimeZoneBean.java
        these are changes in timezone2 that don't appear in timezone1 but the tutorial

        deson't mention them:
        in listen(ActionEvent event)
        remove...
        String clientId = event.getComponent().getClientId(context);

        modify these two lines...
        int x = Integer.parseInt((String) requestParams.get(clientId + ".x"));
        int y = Integer.parseInt((String) requestParams.get(clientId + ".y"));
        ...for these two:
        int x = Integer.parseInt((String) requestParams.get("ice.event.x"));
        int y = Integer.parseInt((String) requestParams.get("ice.event.y"));

        add...
        x -= icefacesXOffset;
        y -= icefacesYOffset;

        add as class variables...
        // ICEfaces image map integration needs offset values to calculate the
        // correct coordinate values.
        private static int icefacesXOffset = 8;
        private static int icefacesYOffset = 142;

        +++++ Step 3 +++++

        page 33
        in TimeZoneBean.java
        the tutorial instructs to add these two imports...
        import com.icesoft.faces.webapp.xmlhttp.*;
        import com.icesoft.faces.async.render.*;

        ...but in the actual file, it is more specific...
        import com.icesoft.faces.async.render.IntervalRenderer;
        import com.icesoft.faces.async.render.RenderManager;
        import com.icesoft.faces.async.render.Renderable;
        import com.icesoft.faces.webapp.xmlhttp.PersistentFacesState;
        import com.icesoft.faces.webapp.xmlhttp.RenderingException;

        page 34
        in TimeZoneBean.java
        the tutorial instructs to add this method
        public void renderingException(RenderingException renderingException) {
        if( clock != null )

        { clock.remove(this); clock = null; }

        }

        but in the actual file, this is what appears...
        public void renderingException(RenderingException renderingException) {
        if (log.isDebugEnabled())

        { log.debug("Rendering exception called because of " + renderingException); }

        performCleanup();
        }

        protected boolean performCleanup() {
        try {
        if (clock != null)

        { clock.requestStop(); clock.remove(this); clock.dispose(); clock = null; }

        return true;
        } catch (Exception failedCleanup) {
        if (log.isErrorEnabled())

        { log.error("Failed to cleanup a clock bean", failedCleanup); }

        }
        return false;
        }

        in TimeZoneBean.java
        the actual file contains these imports, but the tutorial doesn't mention them...
        import com.icesoft.faces.context.DisposableBean;
        import org.apache.commons.logging.Log;
        import org.apache.commons.logging.LogFactory;

        it also doesn't mention anything about implementing DisposableBean and adding
        this method method...
        public void dispose() throws Exception {
        if (log.isInfoEnabled())

        { log.info("Dispose TimeZoneBean for a user - cleaning up"); }

        performCleanup();
        }

        it doesn't mention anything about using logging either...

        +++++ Step 4 +++++

        in TimeZoneBean.java
        the tutorial doesn't mention anything about importing these two classes
        import javax.faces.component.UIComponent;
        import java.util.Hashtable;

        in TimeZoneWrapper.java
        it instructs to add...
        private String checkboxId;
        ...but the actual file doesn't have it

        it instructs to modify isRelevantComponentId(String componentId)
        but the actual file doesn't reflect those changes, it is identical to the previous

        versions...

        it instructs to add getCheckboxId()
        but the actual file deosn't have that method...

        +++++ step 5 +++++

        page 44
        It is not clear what exactly are we trying to show here. Nothing is in bold. Nothing stands out. Nothing is pointed out in the code. The reader doesn't know what exactly to look for until after scanning the code.

        +++++ General Observations +++++

        It would be good to explain how image maps work with ICEfaces.

        Correction
        in pages 30, 32, 36, 43, 48, 50, 54 in the note boxes. It mentions to use "ant-projecthelp" (without a space in between ant and the argument (i.e. it should be "ant -projecthelp").

        Show
        Arturo Zambrano added a comment - (pages refer to the absolute numbering of the document: ICEfacesGettingStartedGuide.pdf) +++++ Step 1 +++++ page 28 in web.xml the actual file contains an additional description line <description> ICEfaces Tutorial: Timezone Part 1 Create TimeZone as a stock JavaServer Faces application. </description> page 29 in web.xml the tutorial instructs to add this, but the actual file doesn't have it <context-param> <param-name>javax.faces.application.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value> </context-param> page 28 in web.xml the actual file contains this, but the tutorial doesn't mention it <session-config> <session-timeout>30</session-timeout> </session-config> +++++ Step 2 +++++ In fact, step 2 of the tutorial doesn't mention important changes to the code: in TimeZoneBean.java these are changes in timezone2 that don't appear in timezone1 but the tutorial deson't mention them: in listen(ActionEvent event) remove... String clientId = event.getComponent().getClientId(context); modify these two lines... int x = Integer.parseInt((String) requestParams.get(clientId + ".x")); int y = Integer.parseInt((String) requestParams.get(clientId + ".y")); ...for these two: int x = Integer.parseInt((String) requestParams.get("ice.event.x")); int y = Integer.parseInt((String) requestParams.get("ice.event.y")); add... x -= icefacesXOffset; y -= icefacesYOffset; add as class variables... // ICEfaces image map integration needs offset values to calculate the // correct coordinate values. private static int icefacesXOffset = 8; private static int icefacesYOffset = 142; +++++ Step 3 +++++ page 33 in TimeZoneBean.java the tutorial instructs to add these two imports... import com.icesoft.faces.webapp.xmlhttp.*; import com.icesoft.faces.async.render.*; ...but in the actual file, it is more specific... import com.icesoft.faces.async.render.IntervalRenderer; import com.icesoft.faces.async.render.RenderManager; import com.icesoft.faces.async.render.Renderable; import com.icesoft.faces.webapp.xmlhttp.PersistentFacesState; import com.icesoft.faces.webapp.xmlhttp.RenderingException; page 34 in TimeZoneBean.java the tutorial instructs to add this method public void renderingException(RenderingException renderingException) { if( clock != null ) { clock.remove(this); clock = null; } } but in the actual file, this is what appears... public void renderingException(RenderingException renderingException) { if (log.isDebugEnabled()) { log.debug("Rendering exception called because of " + renderingException); } performCleanup(); } protected boolean performCleanup() { try { if (clock != null) { clock.requestStop(); clock.remove(this); clock.dispose(); clock = null; } return true; } catch (Exception failedCleanup) { if (log.isErrorEnabled()) { log.error("Failed to cleanup a clock bean", failedCleanup); } } return false; } in TimeZoneBean.java the actual file contains these imports, but the tutorial doesn't mention them... import com.icesoft.faces.context.DisposableBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; it also doesn't mention anything about implementing DisposableBean and adding this method method... public void dispose() throws Exception { if (log.isInfoEnabled()) { log.info("Dispose TimeZoneBean for a user - cleaning up"); } performCleanup(); } it doesn't mention anything about using logging either... +++++ Step 4 +++++ in TimeZoneBean.java the tutorial doesn't mention anything about importing these two classes import javax.faces.component.UIComponent; import java.util.Hashtable; in TimeZoneWrapper.java it instructs to add... private String checkboxId; ...but the actual file doesn't have it it instructs to modify isRelevantComponentId(String componentId) but the actual file doesn't reflect those changes, it is identical to the previous versions... it instructs to add getCheckboxId() but the actual file deosn't have that method... +++++ step 5 +++++ page 44 It is not clear what exactly are we trying to show here. Nothing is in bold. Nothing stands out. Nothing is pointed out in the code. The reader doesn't know what exactly to look for until after scanning the code. +++++ General Observations +++++ It would be good to explain how image maps work with ICEfaces. Correction in pages 30, 32, 36, 43, 48, 50, 54 in the note boxes. It mentions to use "ant-projecthelp" (without a space in between ant and the argument (i.e. it should be "ant -projecthelp").
        Hide
        Arturo Zambrano added a comment -

        +++++ Step 7 +++++
        page 51
        just a minor typo in the paragraph...
        3. Replace the seven selectBooleanCheckboxs and outputLabels with JSTL forEach sections, that are populate[d] by bean properties using JSF expression language bindings.

        ...it should be 'populated'

        Show
        Arturo Zambrano added a comment - +++++ Step 7 +++++ page 51 just a minor typo in the paragraph... 3. Replace the seven selectBooleanCheckboxs and outputLabels with JSTL forEach sections, that are populate [d] by bean properties using JSF expression language bindings. ...it should be 'populated'

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: