Package org.jboss.as.console.mbui.model.mapping

Examples of org.jboss.as.console.mbui.model.mapping.DMRMapping


        final ModelNode operationDescription = context.getOperationDescriptions().get(operationRef);

        assert operationDescription!=null : "Operation meta data required for "+output.getId() + " on "+context.getUnit().getId();

        final List<Property> parameterMetaData = operationDescription.get("request-properties").asPropertyList();
        DMRMapping mapping = (DMRMapping) unit.findMapping(MappingType.DMR);
        String address = mapping.getAddress();

        Delegation delegation = null;

        if(parameterMetaData.isEmpty())
        {
View Full Code Here


    private void inspectUnit(InteractionUnit unit)
    {
        if(unit.hasMapping(MappingType.DMR))
        {
            DMRMapping mapping = (DMRMapping)unit.getMapping(MappingType.DMR);
            String address = mapping.getAddress();
            if(address !=null && !requiredresources.contains(address))
            {
                requiredresources.add(address);
            }
        }
View Full Code Here

        @Override
        public void add(ReificationWidget widget) {

            //System.out.println("Add "+ widget.getInteractionUnit() + " to " + unit);
            InteractionUnit unit = widget.getInteractionUnit();
            DMRMapping mapping = (DMRMapping) unit.findMapping(MappingType.DMR);

            if(unit.doesProduce())
            {
                Iterator<Resource<ResourceType>> iterator = unit.getOutputs().iterator();
                Resource<ResourceType> resource =  iterator.next();

                String resourceAddress = mapping.getAddress();
                String operationName = resource.getId().getSuffix();

                if(securityContext.getOperationPriviledge(resourceAddress, operationName).isGranted())
                    tools.addToolWidgetRight(widget.asWidget());
            }
View Full Code Here

        {
            this.panel = new VerticalPanel();
            this.table = new ModelNodeCellTable(5);
            this.interactionUnit = interactionUnit;

            DMRMapping DMRMapping = this.interactionUnit.findMapping(MappingType.DMR);

            List<ResourceAttribute> attributes = DMRMapping.getAttributes();
            for (ResourceAttribute attribute : attributes)
            {
                final String attributeKey = attribute.getLabel() != null ? attribute.getLabel() : attribute.getName();
                // TODO: How do we resolve the column names?
                // See "entity.key" usage as well
View Full Code Here

    }

    @Override
    public DMRMapping fromXML(Node node) {

        DMRMapping mapping = new DMRMapping();
        Node address = node.getAttributes().getNamedItem("address");
        if(address !=null)
        {
            mapping.setAddress(address.getNodeValue());
        }

        NodeList children = node.getChildNodes();
        List<String> attributes = new LinkedList<String>();
        List<String> objects = new LinkedList<String>();
        for(int i=0; i<children.getLength(); i++)
        {
            Node child = children.item(i);
            if(!( Node.ELEMENT_NODE == child.getNodeType()))
                continue;

            if(child.getNodeName().equals("attribute"))
            {
                attributes.add(child.getAttributes().getNamedItem("name").getNodeValue());
            }
            else if(child.getNodeName().equals("object"))
            {
                objects.add(child.getAttributes().getNamedItem("name").getNodeValue());
            }
        }
        mapping.addAttributes(attributes);
        mapping.addObjects(objects);
        return mapping;
    }
View Full Code Here

    }

    private void init() {
        unit = dialog.findUnit(getJustification());

        DMRMapping mapping = (DMRMapping) unit.findMapping(MappingType.DMR);
        address = AddressMapping.fromString(mapping.getResolvedAddress());

    }
View Full Code Here

                            {
                                context.set(MODEL_DESCRIPTIONS, new HashMap<QName, ModelNode>());
                            }

                            // Correlation ID matters! See CollectOperationsVisitor as well...
                            DMRMapping mapping = (DMRMapping) visitor.stepReference.get(step).findMapping(DMR);
                            context.<Map>get(MODEL_DESCRIPTIONS).put(mapping.getCorrelationId(), description);

                            // aliases
                            String mappedAddress = mapping.getResolvedAddress();
                            StatementContext stmtContext = contexts.get(mappedAddress);

                            AddressMapping addressMapping = AddressMapping.fromString(mappedAddress);
                            String addressKey = addressMapping.asResource(stmtContext).toString();
View Full Code Here

        {
            final InteractionCoordinator coordinator = context.get(ContextKey.COORDINATOR);
            final StatementContext delegate = coordinator.getDialogState().getContext(interactionUnit.getId());
            assert delegate != null : "StatementContext not provided";

            DMRMapping mapping = (DMRMapping) interactionUnit.findMapping(DMR, new Predicate<DMRMapping>()
            {
                @Override
                public boolean appliesTo(final DMRMapping candidate)
                {
                    // the read-resource operation only needs the address of a resource
                    // hence we can skip mapping without address declarations (i.e. just attributes)
                    return candidate.getAddress() != null;
                }
            });

            if (mapping != null)
            {

                FilteringStatementContext stmtContext = new FilteringStatementContext(
                        delegate,
                        new FilteringStatementContext.Filter() {
                            @Override
                            public String filter(String key) {
                                if ("selected.entity".equals(key))
                                    return "*";
                                else
                                    return null;
                            }

                            @Override
                            public String[] filterTuple(String key) {
                                return null;
                            }
                        }
                ) {

                };

                String step = "step-" + (steps.size()+1);

                String mappedAddress = mapping.getResolvedAddress();
                contexts.put(mappedAddress, stmtContext);

                AddressMapping addressMapping = AddressMapping.fromString(mappedAddress);
                ModelNode op = addressMapping.asResource(stmtContext);
                String addressKey = addressMapping.asResource(stmtContext).toString(); // mapping.getResolvedAddress();

                if (!resolvedAdresses.contains(addressKey))
                {
                    op.get(OP).set(READ_RESOURCE_DESCRIPTION_OPERATION);
                    steps.add(op);

                    // retain references
                    resolvedAdresses.add(addressKey);
                    stepReference.put(step, interactionUnit);

                }
                else
                {
                    // create an alias for later reference
                    if(null==aliasMappings.get(addressKey))
                        aliasMappings.put(addressKey, new HashSet<QName>());

                    // if a mapping resolves to the same address we can reuse the model description later on
                    aliasMappings.get(addressKey).add(mapping.getCorrelationId());
                }
            }
        }
View Full Code Here

                builder.end();
        }
        else if (DMRMapping.class == adapter.getType())
        {
            // dmr mapping contents
            DMRMapping mapping = (DMRMapping) adapter.fromXML(root);
            builder.mappedBy(mapping);
        }

    }
View Full Code Here

        private void marshallMapping(InteractionUnit unit, Element target)
        {
            if(unit.hasMapping(MappingType.DMR))
            {
                DMRMapping mapping = (DMRMapping) unit.getMapping(MappingType.DMR);
                Element el = getAdapter("dmr").toXML(document, mapping);
                target.appendChild(el);
            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.console.mbui.model.mapping.DMRMapping

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.