Simple DAM Image retrieval Example

  1. Create a component named imageretrieval by right clicking on any project (here am taking a geometrixx-outdoors project as my project)
  2. Create a dialog as shown below node structure.imagedialog.pngimagedialogjson.png
  3. the dialog finally results as shown belowimagepagedialog.png
  4. imageretrieval.jsp code snippet (have added both scriptlet and JSTL way of retrieving)

    <%–
    image retrieval component.
    –%>
    <%
    %><%@include file=”/libs/foundation/global.jsp”%><%
    %><%@page session=”false” %><%
    %>
    <b>::This is simple test to hide/show image from dialog box::</b>

    <!– JSP Scriplet Style of retrieval –>
    <%
    boolean isChecked = properties.get(“showimage”, false);
    String imgpath = properties.get(“imgpath”, “”);
    //out.println(isChecked);
    //out.println(imgpath);
    //write the scriplet code if conditions for retrieval of dialog values and display image in page
    %>

    <!– JSTL code which displays the image based on the dialog selection –>
    </br>
    <c:if test=”${properties.showimage}”>
    <c:if test=”${not empty properties.imgpath}”>
    <img src=’${properties.imgpath}’ alt=”Smiley face” width=”100″ height=”100″>
    </c:if>
    </c:if>

  5. Finally drag and drop the component into any geometrixx-outdoors page and edit the dialog to see the functionality resultimagepage.png

 

Leave a comment