Package org.structr.core.app

Examples of org.structr.core.app.App.tx()


  @Override
  public void afterCreation(SecurityContext securityContext) {
   
    final App app = StructrApp.getInstance(securityContext);

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

      final int value = getIncreasedValue(modifiedInAfterCreation);
      setProperty(modifiedInAfterCreation, value);
     
      tx.success();
View Full Code Here


  @Override
  public void afterModification(SecurityContext securityContext) {
   
    final App app = StructrApp.getInstance(securityContext);
    try (final Tx tx = app.tx()) {

      final int value = getIncreasedValue(modifiedInAfterModification);
     
      setProperty(modifiedInAfterModification, value);
      tx.success();
View Full Code Here

    final String id = (String)attributes.get("id");

    if (id != null) {

      final App app     = StructrApp.getInstance();
      try (final Tx tx = app.tx()) {

        CloudService.doRemote(new PullTransmission(id, true, "admin", "admin", "localhost", 54556), new LoggingListener());
      }
    }
  }
View Full Code Here

          } else if (MaintenanceCommand.class.isAssignableFrom(taskOrCommand)) {

            MaintenanceCommand cmd = (MaintenanceCommand)StructrApp.getInstance(securityContext).command(taskOrCommand);
            if (cmd.requiresEnclosingTransaction()) {

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

                cmd.execute(propertySet);
                tx.success();
              }
View Full Code Here

        tx.success();
      }

      app = StructrApp.getInstance(securityContext);

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

        // Ensure access mode is frontend
        securityContext.setAccessMode(AccessMode.Frontend);

        request.setCharacterEncoding("UTF-8");
View Full Code Here

              threadPool.submit(new Runnable() {

                @Override
                public void run() {

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

                    //final long start = System.currentTimeMillis();

                    // render
                    rootNode.render(securityContext, renderContext, 0);
View Full Code Here

        tx.success();
      }

      app = StructrApp.getInstance(securityContext);

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

        // Ensure access mode is frontend
        securityContext.setAccessMode(AccessMode.Frontend);

        request.setCharacterEncoding("UTF-8");
View Full Code Here

    final String key                     = (String)properties.get("key");

    if (host != null && port != null && username != null && password != null && key != null) {

      final App app    = StructrApp.getInstance();
      try (final Tx tx = app.tx()) {

        // create push transmission to be filled later
        final PushTransmission tms = new PushTransmission(username, password, host, port.intValue());

        for (final SchemaNode node : app.nodeQuery(SchemaNode.class).getAsList()) {
View Full Code Here

    if (CONFIRM_REGISTRATION_PAGE.equals(path)) {

      final App app = StructrApp.getInstance();

      Result<Principal> results;
      try (final Tx tx = app.tx()) {

        results = app.nodeQuery(Principal.class).and(User.confirmationKey, key).getResult();
      }

      if (!results.isEmpty()) {
View Full Code Here

      if (!results.isEmpty()) {

        final Principal user = results.get(0);

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

          // Clear confirmation key and set session id
          user.setProperty(User.confirmationKey, null);

          if (auth.getUserAutoLogin()){
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.