Package org.jbpm.formapi.shared.api

Examples of org.jbpm.formapi.shared.api.FormItemRepresentation


        Map<String, Object> data = super.getDataMap();
        data.put("id", this.id);
        List<Map<String, Object>> mapItems = new ArrayList<Map<String, Object>>();
        if (this.items != null) {
            for (Map.Entry<Position, FormItemRepresentation> entry : this.items.entrySet()) {
                FormItemRepresentation item = entry.getValue();
                Position pos = entry.getKey();
                Map<String, Object> itemData = item == null ? null : item.getDataMap();
                itemData.put("x", pos.getX());
                itemData.put("y", pos.getY());
                mapItems.add(itemData);
            }
        }
View Full Code Here


        if (mapItems != null) {
            for (Map<String, Object> entry : mapItems) {
                int x = entry.get("x") == null ? 0 : ((Number) entry.get("x")).intValue();
                int y = entry.get("y") == null ? 0 : ((Number) entry.get("y")).intValue();
                Position pos = new Position(x, y);
                FormItemRepresentation item = (FormItemRepresentation) decoder.decode(entry);
                this.items.put(pos, item);
            }
        }
    }
View Full Code Here

        List<Object> mapItems = (List<Object>) data.get("items");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        if (mapItems != null) {
            for (Object obj : mapItems) {
                Map<String, Object> itemMap = (Map<String, Object>) obj;
                FormItemRepresentation item = (FormItemRepresentation) decoder
                        .decode(itemMap);
                this.items.add(item);
            }
        }
    }
View Full Code Here

                Widget widget = table.getWidget(r, c);
                int colspan = table.getFlexCellFormatter().getColSpan(r, c);
                int rowspan = table.getFlexCellFormatter().getRowSpan(r, c);
                if (widget != null && widget instanceof FBFormItem) {
                    FBFormItem item = (FBFormItem) widget;
                    FormItemRepresentation subRep = item.getRepresentation();
                    rep.setElement(r, c, subRep, colspan, rowspan);
                }
            }
        }
        return rep;
View Full Code Here

        if (mprep.getElements() != null) {
            for (int rowindex = 0; rowindex < mprep.getElements().size(); rowindex++) {
                List<FormItemRepresentation> row = mprep.getElements().get(rowindex);
                if(row != null) {
                    for (int cellindex = 0; cellindex < row.size(); cellindex++) {
                        FormItemRepresentation cell = row.get(cellindex);
                        FBFormItem subItem = super.createItem(cell);
                        this.table.setWidget(rowindex, cellindex, subItem);
                        int colspan = mprep.getColspan(rowindex, cellindex);
                        int rowspan = mprep.getRowspan(rowindex, cellindex);
                        if (colspan > 1) {
View Full Code Here

            throw new FormBuilderException(i18n.RepNotOfType(rep.getClass().getName(), "ConditionalBlockRepresentation"));
        }
        super.populate(rep);
        ConditionalBlockRepresentation srep = (ConditionalBlockRepresentation) rep;
        this.conditionScript = srep.getCondition();
        FormItemRepresentation ifRep = srep.getIfBlock();
        if (ifRep == null) {
            this.ifBlock = null;
        } else {
            this.ifBlock = createItem(ifRep);
        }
        FormItemRepresentation elseRep = srep.getElseBlock();
        if (elseRep == null) {
            this.elseBlock = null;
        } else {
            this.elseBlock = createItem(elseRep);
        }
View Full Code Here

        List<Object> mapItems = (List<Object>) data.get("items");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        if (mapItems != null) {
            for (Object obj : mapItems) {
                Map<String, Object> itemMap = (Map<String, Object>) obj;
                FormItemRepresentation item = (FormItemRepresentation) decoder
                        .decode(itemMap);
                this.items.add(item);
            }
        }
    }
View Full Code Here

   
    @GET @Path("/items/package/{pkgName}/id/{fItemId}")
    public Response getFormItem(@PathParam("pkgName") String pkgName, @PathParam("fItemId") String formItemId, @Context ServletContext context) {
        setContext(context);
        try {
            FormItemRepresentation formItem = formService.getFormItem(pkgName, formItemId);
            ListFormsItemsDTO dto = new ListFormsItemsDTO(formItemId, formItem);
            return Response.ok(dto, MediaType.APPLICATION_XML).build();
        } catch (FormServiceException e) {
            return error("Problem reading form item " + formItemId, e);
        } catch (FormEncodingException e) {
View Full Code Here

            @PathParam("pkgName") String pkgName,
            @PathParam("fItemName") String formItemName, @Context HttpServletRequest request) {
        setContext(request.getSession().getServletContext());
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        try {
            FormItemRepresentation item = decoder.decodeItem(jsonBody);
            String formItemId = formService.saveFormItem(pkgName, formItemName, item);
            return Response.ok("<formItemId>"+formItemId+"</formItemId>",
                    MediaType.APPLICATION_XML).status(Status.CREATED).build();
        } catch (FormEncodingException e) {
            return error("Problem encoding form item", e);
View Full Code Here

        return retval;
    }
   
    private FormItemRepresentation makeRepresentation(Node itemNode) throws FormEncodingException {
        NodeList list = ((Element) itemNode).getElementsByTagName("itemJson");
        FormItemRepresentation rep = null;
        if (list.getLength() > 0) {
            Node node = list.item(0);
            String json = getText(node);
            FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
            rep = (FormItemRepresentation) decoder.decodeItem(json);
View Full Code Here

TOP

Related Classes of org.jbpm.formapi.shared.api.FormItemRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.