コード例 #1
0
ファイル: RepositoryTestCase.java プロジェクト: dwins/GeoGig
 public boolean delete(GeogitTransaction transaction, Feature f) throws Exception {
   final WorkingTree workTree =
       (transaction != null ? transaction.getWorkingTree() : repo.getWorkingTree());
   Name name = f.getType().getName();
   String localPart = name.getLocalPart();
   String id = f.getIdentifier().getID();
   boolean existed = workTree.delete(localPart, id);
   return existed;
 }
コード例 #2
0
ファイル: RepositoryTestCase.java プロジェクト: dwins/GeoGig
 /** Inserts the feature to the index but does not stages it to be committed */
 public ObjectId insert(GeogitTransaction transaction, Feature f) throws Exception {
   final WorkingTree workTree =
       (transaction != null ? transaction.getWorkingTree() : repo.getWorkingTree());
   Name name = f.getType().getName();
   String parentPath = name.getLocalPart();
   Node ref = workTree.insert(parentPath, f);
   ObjectId objectId = ref.getObjectId();
   return objectId;
 }
コード例 #3
0
ファイル: RepositoryTestCase.java プロジェクト: dwins/GeoGig
  /** Inserts the Feature to the index and stages it to be committed. */
  public ObjectId insertAndAdd(GeogitTransaction transaction, Feature f) throws Exception {
    ObjectId objectId = insert(transaction, f);

    if (transaction != null) {
      transaction.command(AddOp.class).call();
    } else {
      geogit.command(AddOp.class).call();
    }
    return objectId;
  }
コード例 #4
0
ファイル: RepositoryTestCase.java プロジェクト: dwins/GeoGig
  /**
   * Deletes a feature from the index
   *
   * @param f
   * @return
   * @throws Exception
   */
  public boolean deleteAndAdd(GeogitTransaction transaction, Feature f) throws Exception {
    boolean existed = delete(transaction, f);
    if (existed) {
      if (transaction != null) {
        transaction.command(AddOp.class).call();
      } else {
        geogit.command(AddOp.class).call();
      }
    }

    return existed;
  }