Examples of PObject


Examples of org.jresearch.flexess.core.model.uam.PObject

    pack.setName("orders"); //$NON-NLS-1$
    pack.setNsPrefix("ord"); //$NON-NLS-1$
    pack.setNsURI("http://www.jresearchsoft.com/schemas/orders"); //$NON-NLS-1$
    EcoreUtil.setAnnotation(pack, UamPackage.eNS_URI, "#description", "test application"); //$NON-NLS-1$ //$NON-NLS-2$

    PObject order = UamFactory.eINSTANCE.createPObject();
    order.setId("order_pobject"); //$NON-NLS-1$
    order.setName("order"); //$NON-NLS-1$

    EcoreUtil.setAnnotation(order, UamPackage.eNS_URI, "#class_name", "com.jresearchsoft.uam.client.tests.Order"); //$NON-NLS-1$ //$NON-NLS-2$
    EcoreUtil.setAnnotation(order, UamPackage.eNS_URI, "#mapper_name", "com.jresearchsoft.uam.client.mappers.impl.JavaInstanceMapper"); //$NON-NLS-1$ //$NON-NLS-2$
    EcoreUtil.setAnnotation(order, UamPackage.eNS_URI, "#description", "customer order"); //$NON-NLS-1$ //$NON-NLS-2$
    pack.getEClassifiers().add(order);

    // region is an attribute for pObject and
    EAttribute region = EcoreFactory.eINSTANCE.createEAttribute();
    region.setName("region"); //$NON-NLS-1$
    EcoreUtil.setAnnotation(region, UamPackage.eNS_URI, "#description", "region where the order comes"); //$NON-NLS-1$ //$NON-NLS-2$
    region.setEType(EcorePackage.eINSTANCE.getEString());

    order.getEStructuralFeatures().add(region);
    // user id is an attribute - id of the current user
    EAttribute userID = EcoreFactory.eINSTANCE.createEAttribute();
    EcoreUtil.setAnnotation(userID, UamPackage.eNS_URI, IAttributeConstant.ANNOTATION_KEY_RUNTIME, "true"); //$NON-NLS-1$
    userID.setName("userId"); //$NON-NLS-1$
    userID.setEType(EcorePackage.eINSTANCE.getEString());
    order.getEStructuralFeatures().add(userID);

    // Now we create basic operations and add them to order
    POperation createOp = UamFactory.eINSTANCE.createPOperation();
    createOp.setId("create_operation"); //$NON-NLS-1$
    createOp.setName("create"); //$NON-NLS-1$

    POperation viewOp = UamFactory.eINSTANCE.createPOperation();
    viewOp.setId("view_operation"); //$NON-NLS-1$
    viewOp.setName("view"); //$NON-NLS-1$

    POperation deleteOp = UamFactory.eINSTANCE.createPOperation();
    deleteOp.setId("delete_operation"); //$NON-NLS-1$
    deleteOp.setName("delete"); //$NON-NLS-1$

    POperation updateOp = UamFactory.eINSTANCE.createPOperation();
    updateOp.setId("update_operation"); //$NON-NLS-1$
    updateOp.setName("update"); //$NON-NLS-1$

    order.getEOperations().add(createOp);
    order.getEOperations().add(viewOp);
    order.getEOperations().add(deleteOp);
    order.getEOperations().add(updateOp);

    final String USER_EXPRESSION = "context orders::user_permission inv: login=object.userId"; //$NON-NLS-1$
    final String REGION_EXPRESSION = "context orders::regional_permission inv: region=object.region"; //$NON-NLS-1$

    Permission regionalPermission = UamFactory.eINSTANCE.createPermission();
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

  @SuppressWarnings("unchecked")
  @Override
  public SecurityModel rawConvert() throws LoadModelException {
    SecurityModel result = super.rawConvert();
    for (ProtectedObjectType object : getXmlElement().getProtectedObject()) {
      PObject pObject = new PObjectConverter(object, getConverted()).convert();
      result.getEClassifiers().add(pObject);
      for (Permission permission : (EList<Permission>)pObject.getPermission()) {
        result.getEClassifiers().add(permission);
      }
    }
    for (RoleTemplateType role : getXmlElement().getRoleTemplate()) {
      result.getEClassifiers().add(new RoleTemplateConverter(role, getConverted()).convert());
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

        }

        final DataSourceAttributeValue value = new DataSourceAttributeValue();
        value.attributesValues = new Map[pValue.size()];
        for (int i = 0; i < pValue.size(); i++) {
            PObject rowData = pValue.getObject(i);
            final Values valuesForParsing = new Values();
            valuesForParsing.populateFromAttributes(template, parser, this.attributes, rowData);
            value.attributesValues[i] = valuesForParsing.asMap();
        }
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

    @Override
    public final PObject optObject(final String key) {
        List<PObject> results = new ArrayList<PObject>();
        for (PObject obj : this.objs) {
            PObject result = obj.optObject(key);
            if (result != null) {
                results.add(result);
            }
        }
        if (results.size() == 0) {
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

        } else if (type.isEnum()) {
            value = parseEnum(type, layer.getPath(fieldName), layer.getString(name));
        } else {
            try {
                value = type.newInstance();
                PObject object = layer.getObject(name);
                parse(errorOnExtraProperties, object, value, extraPropertyToIgnore);
            } catch (InstantiationException e) {
                throw new UnsupportedTypeException(type, e);
            } catch (IllegalAccessException e) {
                throw ExceptionUtils.getRuntimeException(e);
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

        } else if (type.isEnum()) {
            value = parseEnum(type, array.getPath("" + i), array.getString(i));
        } else {
            try {
                value = type.newInstance();
                PObject object = array.getObject(i);
                parse(errorOnExtraProperties, object, value, extraPropertyToIgnore);
            } catch (InstantiationException e) {
                throw new UnsupportedTypeException(type, e);
            } catch (IllegalAccessException e) {
                throw ExceptionUtils.getRuntimeException(e);
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

    }

    private static PObject getOldMapPage(final PJsonObject oldRequest) {
        final PArray pages = oldRequest.getArray("pages");

        PObject mapPage = null;
        for (int i = 0; i < pages.size(); i++) {
            final PObject page = pages.getObject(i);

            if (isMapPage(page)) {
                if (mapPage == null) {
                    mapPage = page;
                } else {
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

    }

    private static PObject getOldTablePage(final PJsonObject oldRequest) {
        final PArray pages = oldRequest.getArray("pages");

        PObject tablePage = null;
        for (int i = 0; i < pages.size(); i++) {
            final PObject page = pages.getObject(i);

            if (isTablePage(page)) {
                if (tablePage == null) {
                    tablePage = page;
                } else {
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

            //    ],
            //    "columns":[
            //       "col0"
            //    ]
            // }
            PObject table = page.getObject("table");
            if (table.getArray("columns").size() == 1 && table.getArray("data").size() == 1) {
                String columnName = table.getArray("columns").getString(0);
                String value = table.getArray("data").getObject(0).getString(columnName);
                return !Strings.isNullOrEmpty(value);
            }
            return true;
        }
        return false;
View Full Code Here

Examples of org.mapfish.print.wrapper.PObject

        final List<JSONArray> tableData = new LinkedList<JSONArray>();
        if (table != null) {
            final PArray oldTableRows = table.optArray("data", new PJsonArray(table, new JSONArray(), "data"));

            for (int i = 0; i < oldTableRows.size(); i++) {
                final PObject oldRow = oldTableRows.getObject(i);
                if (!oldRow.keys().hasNext()) {
                    // row is empty, skip
                    continue;
                }

                // copy the values for each column
                final JSONArray row = new JSONArray();
                for (String key : columnKeys) {
                    row.put(oldRow.getString(key));
                }
                tableData.add(row);
            }
        }
        return tableData;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.