ICEmobile
  1. ICEmobile
  2. MOBI-236

augmentedReality component and JSP tag

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Spring 1.0 Alpha
    • Fix Version/s: 1.1 Final
    • Component/s: Faces
    • Labels:
      None
    • Environment:
      ICEmobile

      Description

      <mobi:augmentedReality value="#{bean.location}" urlBase="#{bean.baseURL}">
        <mobi:selectLocations value="#{bean.locationList}"
                       var="place"
                       locationLabel="#{place.name}"
                       locationLat="#{place.latitude}"
                       locationLon="#{place.longitude}"
                       locationAlt="#{place.altitude}"
                       locationIcon="#{place.icon}"
                      />
      </mobi:augmentedReality>

      This will write out the following JavaScript call for the onclick of a button:

      ice.aug(id, "ub=urlBase&labelName1=lat,lon,alt,icon&labelName2=lat,lon,alt,icon");

      If altitude is not specified, the value is written as labelName=lat,lon,,icon

      If icon is not specified, the value is written as labelName=lat,lon,alt

      If icon and altitude is not specified, the value is written as labelName=lat,lon

      The selectLocations tag relies on EL providing method names to a JavaBean.

        Activity

        Hide
        Ted Goddard added a comment -

        Initial testing will likely need to be from static data in the application since the existing map component does not support markers.

        Show
        Ted Goddard added a comment - Initial testing will likely need to be from static data in the application since the existing map component does not support markers.
        Hide
        Ted Goddard added a comment -

        JSP tag now implemented.

        Show
        Ted Goddard added a comment - JSP tag now implemented.
        Hide
        Ted Goddard added a comment - - edited

        It would be enough to implement a component that just renders a button; after that I could port over the JSP tag code.

        The problem is that the tag should actually be implemented in two parts as follows (since it resembles a selectOneMenu):

        <mobi:augmentedReality value="#

        {bean.location}

        " urlBase="#

        {bean.baseURL}

        ">
        <mobi:selectLocations value="#

        {bean.locationList}

        "
        var="place"
        locationLabel="#

        {place.name}

        "
        locationLat="#

        {place.latitude}

        "
        locationLon="#

        {place.longitude}

        "
        locationAlt="#

        {place.altitude}

        "
        locationIcon="#

        {place.icon}

        "
        />
        </mobi:augmentedReality>

        Whereas the current JSP tag is as follows and expects the Bean code to format the location list as "params":

        <mobi:augmentedReality id="selection"
        style="float:right" params="$

        {reality}

        "/>

        The alpha could ship with the simplified tag and component and then be enhanced later (so a component that renders a button and has a String "params" attribute is sufficient for the first version).

        (edited to match original specification)

        Show
        Ted Goddard added a comment - - edited It would be enough to implement a component that just renders a button; after that I could port over the JSP tag code. The problem is that the tag should actually be implemented in two parts as follows (since it resembles a selectOneMenu): <mobi:augmentedReality value="# {bean.location} " urlBase="# {bean.baseURL} "> <mobi:selectLocations value="# {bean.locationList} " var="place" locationLabel="# {place.name} " locationLat="# {place.latitude} " locationLon="# {place.longitude} " locationAlt="# {place.altitude} " locationIcon="# {place.icon} " /> </mobi:augmentedReality> Whereas the current JSP tag is as follows and expects the Bean code to format the location list as "params": <mobi:augmentedReality id="selection" style="float:right" params="$ {reality} "/> The alpha could ship with the simplified tag and component and then be enhanced later (so a component that renders a button and has a String "params" attribute is sufficient for the first version). (edited to match original specification)
        Hide
        Judy Guglielmin added a comment -

        Initial jsf component writes the following:-

        Based on this:-

        <mobi:augmentedReality params="myparams" />

        renders:

        <input type="button" value="Reality" onclick="ice.aug(this);"
        data-params="myparams" id="myid" />

        If the value attribute is empty, it will default to "Reality" for the button. An input text field will be displayed if the container or icemobileSX is not detected.

        a test page has been created under mobitest/container/augmentedReality.xhtml

        Show
        Judy Guglielmin added a comment - Initial jsf component writes the following:- Based on this:- <mobi:augmentedReality params="myparams" /> renders: <input type="button" value="Reality" onclick="ice.aug(this);" data-params="myparams" id="myid" /> If the value attribute is empty, it will default to "Reality" for the button. An input text field will be displayed if the container or icemobileSX is not detected. a test page has been created under mobitest/container/augmentedReality.xhtml
        Hide
        Judy Guglielmin added a comment -

        please see mobitest/container/augmentedReality.xhtml

        my suggestion is to take the list capability and place it within the augmentedReality tag. Then the decode can deal with the change in the list selection as input into the augmentedReality container component.

        Show
        Judy Guglielmin added a comment - please see mobitest/container/augmentedReality.xhtml my suggestion is to take the list capability and place it within the augmentedReality tag. Then the decode can deal with the change in the list selection as input into the augmentedReality container component.
        Hide
        Ted Goddard added a comment -

        The main AugmentedReality component has been modified to perform iteration over any AugmentedRealityLocations found as children:

        <mobi:augmentedReality value="#

        {realityBean.selection}

        ">
        <mobi:augmentedRealityLocations
        value="#

        {realityBean.messages}

        " var="place"
        locationLabel="#

        {place.title}

        "
        locationLat="#

        {place.latitude}

        "
        locationLon="#

        {place.longitude}

        "
        locationIcon="#

        {place.fileName}

        " />
        </mobi:augmentedReality>

        Show
        Ted Goddard added a comment - The main AugmentedReality component has been modified to perform iteration over any AugmentedRealityLocations found as children: <mobi:augmentedReality value="# {realityBean.selection} "> <mobi:augmentedRealityLocations value="# {realityBean.messages} " var="place" locationLabel="# {place.title} " locationLat="# {place.latitude} " locationLon="# {place.longitude} " locationIcon="# {place.fileName} " /> </mobi:augmentedReality>
        Hide
        Ted Goddard added a comment -

        The JSF component has been fully implemented, so the JSP tag should be attempted for 1.1 Final.

        Show
        Ted Goddard added a comment - The JSF component has been fully implemented, so the JSP tag should be attempted for 1.1 Final.
        Hide
        Ted Goddard added a comment -

        JSP tag is now functional but previous params-based code is still present in the sample so will need cleanup.

        <mobi:augmentedReality id="selection"
        params="$

        {reality}

        ">
        <c:forEach items="$

        {locations}

        " var="location" >
        <mobi:augmentedRealityLocation
        locationLabel="$

        {location.title}

        "
        locationLat="$

        {location.latitude}

        "
        locationLon="$

        {location.longitude}

        "
        locationAlt="$

        {location.altitude}

        "
        locationDir="$

        {location.direction}

        "
        locationIcon="$

        {location.fileName}

        "
        />
        </c:forEach>
        </mobi:augmentedReality>

        Show
        Ted Goddard added a comment - JSP tag is now functional but previous params-based code is still present in the sample so will need cleanup. <mobi:augmentedReality id="selection" params="$ {reality} "> <c:forEach items="$ {locations} " var="location" > <mobi:augmentedRealityLocation locationLabel="$ {location.title} " locationLat="$ {location.latitude} " locationLon="$ {location.longitude} " locationAlt="$ {location.altitude} " locationDir="$ {location.direction} " locationIcon="$ {location.fileName} " /> </c:forEach> </mobi:augmentedReality>
        Hide
        Ted Goddard added a comment -

        Code cleanup is complete and params is deprecated, so use is as follows:

        <mobi:augmentedReality id="selection" >
        <c:forEach items="$

        {locations}

        " var="location" >
        <mobi:augmentedRealityLocation
        locationLabel="$

        {location.title}

        "
        locationLat="$

        {location.latitude}

        "
        locationLon="$

        {location.longitude}

        "
        locationAlt="$

        {location.altitude}

        "
        locationDir="$

        {location.direction}

        "
        locationIcon="$

        {location.fileName}

        "
        />
        </c:forEach>
        </mobi:augmentedReality>

        Show
        Ted Goddard added a comment - Code cleanup is complete and params is deprecated, so use is as follows: <mobi:augmentedReality id="selection" > <c:forEach items="$ {locations} " var="location" > <mobi:augmentedRealityLocation locationLabel="$ {location.title} " locationLat="$ {location.latitude} " locationLon="$ {location.longitude} " locationAlt="$ {location.altitude} " locationDir="$ {location.direction} " locationIcon="$ {location.fileName} " /> </c:forEach> </mobi:augmentedReality>

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: