コード例 #1
0
  @Override
  protected void validateImport(
      Map<String, List<StagedModel>> dependentStagedModelsMap, Group group) throws Exception {

    List<StagedModel> ddmStructureDependentStagedModels =
        dependentStagedModelsMap.get(DDMStructure.class.getSimpleName());

    Assert.assertEquals(1, ddmStructureDependentStagedModels.size());

    DDMStructure ddmStructure = (DDMStructure) ddmStructureDependentStagedModels.get(0);

    DDMStructureLocalServiceUtil.getDDMStructureByUuidAndGroupId(
        ddmStructure.getUuid(), group.getGroupId());

    List<StagedModel> dlFileEntryTypesDependentStagedModels =
        dependentStagedModelsMap.get(DLFileEntryType.class.getSimpleName());

    Assert.assertEquals(1, dlFileEntryTypesDependentStagedModels.size());

    DLFileEntryType dlFileEntryType =
        (DLFileEntryType) dlFileEntryTypesDependentStagedModels.get(0);

    DLFileEntryTypeLocalServiceUtil.getDLFileEntryTypeByUuidAndGroupId(
        dlFileEntryType.getUuid(), group.getGroupId());

    List<StagedModel> folderDependentStagedModels =
        dependentStagedModelsMap.get(DLFolder.class.getSimpleName());

    Assert.assertEquals(1, folderDependentStagedModels.size());

    Folder parentFolder = (Folder) folderDependentStagedModels.get(0);

    DLFolderLocalServiceUtil.getDLFolderByUuidAndGroupId(
        parentFolder.getUuid(), group.getGroupId());
  }
コード例 #2
0
  public void addFolder(Folder folder, ServiceContext serviceContext)
      throws PortalException, SystemException {

    if (!isStagingGroup(folder.getGroupId())) {
      dlSyncLocalService.addSync(
          folder.getFolderId(),
          folder.getUuid(),
          folder.getCompanyId(),
          folder.getRepositoryId(),
          folder.getParentFolderId(),
          folder.getName(),
          folder.getDescription(),
          DLSyncConstants.TYPE_FOLDER,
          "-1");
    }
  }