Layouting

Printer-friendly versionSend to friendPDF version
Rookie

This sample code has been developed by Streamezzo.
Its purpose is to illustrate layouting.

RSP (sample_layout.rsp):
<%@page import="com.streamezzo.odp.utils.ShapeUtils" %> <%@page import="com.streamezzo.odp.connector.AdaptationTransaction" %> <%@page import="com.streamezzo.odp.connector.AdaptationConnector" %> <%@page import="com.streamezzo.odp.adaptation.layout.Container" %> <%@page import="com.streamezzo.odp.connector.StzConnectorsManager" %> <% int screenWidth = userAgent.getScreenWidth(); int screenHeight = userAgent.getScreenHeight(); %>
" colorBits="8" lengthBits="16" resolution="2" idBits="16" scaleBits="15" encodingType="0"/> <% String skinId = "SkinThemeId"; String layoutId = "LayoutSetId"; int connectorTtl = 3600; AdaptationConnector adaptationConnector = StzConnectorsManager.getAdaptationConnector(stzRequest.getService(), connectorTtl); AdaptationTransaction tx = (AdaptationTransaction) adaptationConnector.beginTransaction(stzRequest, skinId, layoutId); // Accessing the layout Container root = tx.getRootContainer("main"); Container container1 = root.getChildByIdRecurs("Container1"); Container container2 = root.getChildByIdRecurs("Container2"); Container container3 = root.getChildByIdRecurs("Container3"); Container container4 = root.getChildByIdRecurs("Container4"); Container container5 = root.getChildByIdRecurs("Container5"); Container container6 = root.getChildByIdRecurs("Container6"); Container container7 = root.getChildByIdRecurs("Container7"); Container container8 = root.getChildByIdRecurs("Container8"); Container container9 = root.getChildByIdRecurs("Container9"); Container containerImage = root.getChildByIdRecurs("ContainerImage"); %> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/> " color="#000000"/>

Adaptation configuration (adaptation.xml):

Layout (main.xml):
<?xml version="1.0" encoding="UTF-8"?>




AttachmentSize
Sample_Layout.swz585.7 KB
Share this