Package org.structr.core.property

Examples of org.structr.core.property.PropertyMap


    Map<String, Object> nodeData = webSocketData.getNodeData();

    try {

      final PropertyMap properties  = PropertyMap.inputTypeToJavaType(securityContext, nodeData);
      Class type      = SchemaHelper.getEntityClassForRawType(properties.get(AbstractNode.type));
      final NodeInterface newNode  = app.create(type, properties);

      // check for File node and store in WebSocket to receive chunks
      if (newNode instanceof FileBase) {
View Full Code Here


  @Override
  public void updateFromNode(final DOMNode newNode) throws FrameworkException {

    if (newNode instanceof DOMElement) {

      final PropertyMap properties = new PropertyMap();
      for (final Property key : htmlView.properties()) {

        properties.put(key, newNode.getProperty(key));
      }

      // copy tag
      properties.put(DOMElement.tag, newNode.getProperty(DOMElement.tag));

      updateFromPropertyMap(properties);
    }
  }
View Full Code Here

  }

  protected <T extends NodeInterface> List<T> createTestNodes(final Class<T> type, final int number) throws FrameworkException {

    final PropertyMap props = new PropertyMap();
    props.put(AbstractNode.type, type.getSimpleName());

    List<T> nodes = new LinkedList<>();

    for (int i = 0; i < number; i++) {
      props.put(AbstractNode.name, type.getSimpleName() + i);
      nodes.add(app.create(type, props));
    }

    return nodes;
  }
View Full Code Here

  private static final Logger logger = Logger.getLogger(FtpTest.class.getName());

  protected User ftpUser;

  protected User createFTPUser(final String username, final String password) throws FrameworkException {
    PropertyMap props = new PropertyMap();
    props.put(AbstractUser.name, username);
    props.put(AbstractUser.password, password);
    return (User) createTestNodes(User.class, 1, props).get(0);
  }
View Full Code Here

    props.put(AbstractUser.password, password);
    return (User) createTestNodes(User.class, 1, props).get(0);
  }

  protected Folder createFTPDirectory(final String path, final String name) throws FrameworkException {
    PropertyMap props = new PropertyMap();
    props.put(Folder.name, name);
    props.put(Folder.owner, ftpUser);
    Folder dir = (Folder) createTestNodes(Folder.class, 1, props).get(0);

    if (StringUtils.isNotBlank(path)) {
      AbstractFile parent = FileHelper.getFileByAbsolutePath(SecurityContext.getSuperUserInstance(), path);
      if (parent != null && parent instanceof Folder) {
View Full Code Here

    return dir;
  }

  protected File createFTPFile(final String path, final String name) throws FrameworkException {
    PropertyMap props = new PropertyMap();
    props.put(File.name, name);
    props.put(File.size, 0L);
    props.put(File.owner, ftpUser);
    File file = (File) createTestNodes(File.class, 1, props).get(0);

    if (StringUtils.isNotBlank(path)) {
      AbstractFile parent = FileHelper.getFileByAbsolutePath(SecurityContext.getSuperUserInstance(), path);
      if (parent != null && parent instanceof Folder) {
View Full Code Here

  public void test01SearchSingleNodeByName() {

    try {

      PropertyMap props     = new PropertyMap();
      final PropertyKey key = AbstractNode.name;
      final String name     = "89w3hkl sdfghsdkljth";

      props.put(key, name);

      final AbstractNode node = createTestNode(TestOne.class, props);
     
      Result result = null;
View Full Code Here

  public void test02SearchSingleNodeByDate() {

    try {

      PropertyMap props = new PropertyMap();
      PropertyKey key   = TestOne.aDate;
      Date date         = new Date();
      Class type        = TestOne.class;

      props.put(key, date);

      AbstractNode node = createTestNode(type, props);

      try (final Tx tx = app.tx()) {
       
View Full Code Here

  public void test04SearchByLocation() {

    try {

      final PropertyMap props = new PropertyMap();
      final PropertyKey lat   = TestSeven.latitude;
      final PropertyKey lon   = TestSeven.longitude;
      final Class type        = TestSeven.class;

      props.put(lat, 50.12284d);
      props.put(lon, 8.73923d);
      props.put(AbstractNode.name, "TestSeven-0");

      AbstractNode node = createTestNode(type, props);

      try (final Tx tx = app.tx()) {
       
View Full Code Here

  public void test05SpatialRollback() {

    try {

      final Class type        = TestSeven.class;
      final PropertyMap props = new PropertyMap();
      final PropertyKey lat   = TestSeven.latitude;
      final PropertyKey lon   = TestSeven.longitude;

      props.put(AbstractNode.type, type.getSimpleName());
      props.put(lat, 50.12284d);
      props.put(lon, 8.73923d);
      props.put(AbstractNode.name, "TestSeven-0");;

      try (final Tx tx = app.tx()) {

        // this will work
        TestSeven node = app.create(TestSeven.class, props);

        props.remove(AbstractNode.name);
        props.put(lat, 50.12285d);
        props.put(lon, 8.73924d);

        // this will fail
        TestSeven node2 = app.create(TestSeven.class, props);

        // adding another
View Full Code Here

TOP

Related Classes of org.structr.core.property.PropertyMap

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.