Esempio n. 1
0
  /** Clone the data from the src type to the target */
  @Override
  public void copyDocumentRepo(
      CallingContext context, String srcAuthority, String targAuthority, final Boolean wipe) {
    Repository srcRepo = Kernel.getKernel().getRepo(srcAuthority); // $NON-NLS-1$
    final Repository targRepo = Kernel.getKernel().getRepo(targAuthority); // $NON-NLS-1$
    if (wipe) {
      targRepo.drop();
    }

    srcRepo.visitAll(
        "",
        null,
        new RepoVisitor() { //$NON-NLS-1$

          @Override
          public boolean visit(String name, JsonContent content, boolean isFolder) {
            try {
              log.info(Messages.getString("Admin.Copying") + name); // $NON-NLS-1$
              targRepo.addDocument(
                  name,
                  content.getContent(),
                  "$copy", //$NON-NLS-1$
                  Messages.getString("Admin.CopyRepo"),
                  wipe); //$NON-NLS-1$
            } catch (RaptureException e) {
              log.info(Messages.getString("Admin.NoAddDoc") + name); // $NON-NLS-1$
            }
            return true;
          }
        });
  }
Esempio n. 2
0
 @Test
 public void testStandardTemplate() {
   ConfigLoader.getConf().StandardTemplate =
       "NREP {} USING MEMORY { prefix=\"${partition}.${type}\"}";
   Repository repo = Kernel.getKernel().getRepo("repoNotYetCreated");
   assertNotNull(repo);
 }