Search in sources :

Example 11 with Property

use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.

the class Main method writeMoment.

/**
 * Recursive method used to recursively transform a Moment and its sub Moments into CSV compatible DATAZ
 */
private void writeMoment(DescriptionInterview ent, MomentExperience m, PrintWriter writer, String hierarchy) {
    LinkedList<String> classes = new LinkedList<String>();
    for (Type t : m.getTypes()) {
        for (Type prop : t.getTypes()) {
            Property p = (Property) prop;
            classes.add(format(t.getName()) + "," + format(p.getName()) + "," + format(p.getValue()));
        }
    }
    if (!classes.isEmpty()) {
        for (String s : classes) {
            writer.println(format(ent.getName()) + ",\"" + hierarchy + "\"" + "," + format(m.getName()) + "," + format(m.getDescripteme()) + "," + format(m.getColor()) + "," + format(m.getDuration()) + "," + s);
        }
    } else {
        writer.println(format(ent.getName()) + ",\"" + hierarchy + "\"" + "," + format(m.getName()) + "," + format(m.getDescripteme()) + "," + format(m.getColor()) + "," + format(m.getDuration()) + ",\"\",\"\",\"\"");
    }
    for (int i = 0; i < m.getSubMoments().size(); i++) {
        MomentExperience sub = m.getSubMoments().get(i);
        writeMoment(ent, sub, writer, hierarchy + "." + (i + 1));
    }
}
Also used : AlertType(javafx.scene.control.Alert.AlertType) ButtonType(javafx.scene.control.ButtonType) Type(model.Type) MomentExperience(model.MomentExperience) Property(model.Property) LinkedList(java.util.LinkedList)

Example 12 with Property

use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.

the class TypeClassRepresentationController method updateVue.

@Override
public void updateVue(Observable obs, Object value) {
    // TODO Auto-generated method stub
    if (obs.getClass().equals(RenameClassSchemeController.class)) {
        renameClass((String) value);
    }
    if (obs.getClass().equals(ChangeColorClassSchemeController.class)) {
        setColor((String) value);
    }
    if (obs.getClass().equals(AddPropertySchemeController.class)) {
        Property n = new Property(((Property) value).getName());
        boolean contain = false;
        for (Type t : classe.getTypes()) {
            if (t.getName().equals(n.getName())) {
                contain = true;
                break;
            }
        }
        if (!this.classe.getTypes().contains(n)) {
            addProperty((Property) n);
        } else {
        // System.out.println("AH BAH VOILA !!!!!");
        }
    }
    if (obs.getClass().equals(RemovePropertySchemeController.class)) {
        Property toRemove = (Property) value;
        // System.out.println("Remove dans TypeClassRpzCtrl "+toRemove.getName());
        RemoveProperty(toRemove);
    }
    if (obs.getClass().equals(AddPropertySchemeWithValueController.class)) {
        addProperty(stack.pop());
    }
    if (obs.getClass().equals(RemoveClassSchemeController.class)) {
        // System.out.println("DELETINGCLASS");
        moment.removeTypeClassRep(this);
    }
    if (obs.getClass().equals(AddClassSchemeController.class)) {
        // System.out.println("REPUTINGCLASS");
        moment.putPreviousClassRep();
    }
}
Also used : Type(model.Type) Property(model.Property)

Example 13 with Property

use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.

the class TypeTreeViewControllerClass method addProperty.

@FXML
public void addProperty() {
    propertiesNumber++;
    Property nt = new Property("Propriete " + propertiesNumber);
    AddPropertyToClassCommand cmd = new AddPropertyToClassCommand(type, nt, tree.getTreeItem(), this.main);
    cmd.execute();
    UndoCollector.INSTANCE.add(cmd);
}
Also used : AddPropertyToClassCommand(controller.command.AddPropertyToClassCommand) Property(model.Property) FXML(javafx.fxml.FXML)

Example 14 with Property

use of com.adobe.target.delivery.v1.model.Property in project FAAAST-Service by FraunhoferIOSB.

the class AasServiceNodeManager method setOperationArgument.

/**
 * Sets the arguments for the given Operation Variable.
 *
 * @param arg The UA argument
 * @param var The corresponding Operation Variable
 */
private void setOperationArgument(Argument arg, OperationVariable operVar) {
    try {
        if (operVar.getValue() instanceof Property) {
            Property prop = (Property) operVar.getValue();
            arg.setName(prop.getIdShort());
            arg.setValueRank(ValueRanks.Scalar);
            arg.setArrayDimensions(null);
            // Description
            addDescriptions(arg, prop.getDescriptions());
            NodeId type = ValueConverter.convertValueTypeStringToNodeId(prop.getValueType());
            if (type.isNullNodeId()) {
                LOG.warn("setOperationArgument: Property {}: Unknown type: {}", prop.getIdShort(), prop.getValueType());
                // Default type is String. That's what we receive from the AAS Service
                arg.setDataType(Identifiers.String);
            } else {
                arg.setDataType(type);
            }
        } else {
            LOG.warn("setOperationArgument: unknown Argument type");
        }
    } catch (Exception ex) {
        LOG.error("setOperationArgument Exception", ex);
        throw ex;
    }
}
Also used : NodeId(com.prosysopc.ua.stack.builtintypes.NodeId) Property(io.adminshell.aas.v3.model.Property) MultiLanguageProperty(io.adminshell.aas.v3.model.MultiLanguageProperty) PlainProperty(com.prosysopc.ua.server.nodes.PlainProperty) ServiceResultException(com.prosysopc.ua.stack.common.ServiceResultException) StatusException(com.prosysopc.ua.StatusException) MessageBusException(de.fraunhofer.iosb.ilt.faaast.service.exception.MessageBusException) ServiceException(com.prosysopc.ua.ServiceException) UaNodeFactoryException(com.prosysopc.ua.nodes.UaNodeFactoryException) AddressSpaceException(com.prosysopc.ua.client.AddressSpaceException)

Example 15 with Property

use of com.adobe.target.delivery.v1.model.Property in project FAAAST-Service by FraunhoferIOSB.

the class DeepCopyHelperTest method testDeepCopyReferableSupertype.

@Test
public void testDeepCopyReferableSupertype() {
    Property expected = new DefaultProperty.Builder().idShort("property1").build();
    SubmodelElement actual = DeepCopyHelper.deepCopy(expected, SubmodelElement.class);
    Assert.assertEquals(expected, actual);
}
Also used : SubmodelElement(io.adminshell.aas.v3.model.SubmodelElement) Property(io.adminshell.aas.v3.model.Property) DefaultProperty(io.adminshell.aas.v3.model.impl.DefaultProperty) Test(org.junit.Test)

Aggregations

TargetDeliveryRequest (com.adobe.target.edge.client.model.TargetDeliveryRequest)10 Property (com.adobe.target.delivery.v1.model.Property)9 Test (org.junit.jupiter.api.Test)9 Context (com.adobe.target.delivery.v1.model.Context)8 ExecuteRequest (com.adobe.target.delivery.v1.model.ExecuteRequest)8 TargetDeliveryResponse (com.adobe.target.edge.client.model.TargetDeliveryResponse)8 TargetTestDeliveryRequestUtils.getContext (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getContext)8 TargetTestDeliveryRequestUtils.getMboxExecuteRequest (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getMboxExecuteRequest)8 TimingTool (com.adobe.target.edge.client.utils.TimingTool)8 PrefetchRequest (com.adobe.target.delivery.v1.model.PrefetchRequest)7 Property (io.adminshell.aas.v3.model.Property)7 DeliveryResponse (com.adobe.target.delivery.v1.model.DeliveryResponse)5 TargetTestDeliveryRequestUtils.getNoContentDeliveryResponse (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getNoContentDeliveryResponse)5 TargetTestDeliveryRequestUtils.getTestDeliveryResponse (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getTestDeliveryResponse)5 ArrayList (java.util.ArrayList)5 TelemetryEntry (com.adobe.target.delivery.v1.model.TelemetryEntry)4 SubmodelElement (io.adminshell.aas.v3.model.SubmodelElement)4 HashMap (java.util.HashMap)4 Property (model.Property)4 Type (model.Type)3