Package org.jitterbit.integration.data.entity.id

Examples of org.jitterbit.integration.data.entity.id.FolderId


     * always a bad idea. (If you don't understand what <code>equals</code> and
     * <code>hashCode</code> has to do with anything, you shouldn't call this method at all,
     * period.)
     */
    public void generateNewId() {
        setID(new FolderId());
    }
View Full Code Here


        // Change entity type.
        iCurrentEntityType = iEntityType;
        entityType = EntityType.fromId(iCurrentEntityType);
      }

      FolderId folderId = getFolderId(keyValues.get(Folder.FOLDER_ID));

      // NOTE: FolderItemTab.ParentFolder_Id must have been joined with FolderTab to be able to do this!
      //
      FolderId parentFolderId = getFolderId(keyValues.get(FolderItem.PARENT_FOLDER_ID));
      String stName = keyValues.get(Folder.FOLDER_NAME);
      Folder folder = new Folder(folderId, stName, entityType);

      m_folderIdFolderMap.put(folderId, folder);

      // Assign to InterchangeProject if possible.
      IntegrationProject project = null;
      String sProjectId = keyValues.getString(IntegrationProject.PROPERTY_INTERCHANGE_PROJECT_ID);
      if ( sProjectId != null ) {
        IntegrationProjectId projectId = (IntegrationProjectId)EntityType.Project.getIntegrationId(sProjectId);
        project = m_integrationProjectMap.get(projectId);
      }

            if( parentFolderId == null ) {
        RootFolder rootFolder = getRootFolder(entityType, project);
        if ( rootFolder == null ) {
          System.out.println("Failed to find RootFolder for Folder " + folder.getName());
        }
        else
          rootFolder.addSubFolder(folder);
      }
      else {
        Folder parentFolder = m_folderIdFolderMap.get(parentFolderId);
        if ( parentFolder == null )
          orphanFolders.add(new OrphanFolder(folder, parentFolderId));
        else
          parentFolder.addSubFolder(folder);
      }
    }

    // Handle all the orphan folders.
    int nOrphanedFolders = orphanFolders.size();
    while ( nOrphanedFolders > 0 ) {
      int currentNumber = nOrphanedFolders;
      for( int iFolder = 0; iFolder < nOrphanedFolders; /*iFolder updated in the loop*/) {
        Folder orphanFolder = orphanFolders.get(iFolder).getFolder();
        FolderId parentFolderId = orphanFolders.get(iFolder).getParentFolderId();
        Folder parentFolder = m_folderIdFolderMap.get(parentFolderId);
        if ( parentFolder != null ) {
          parentFolder.addSubFolder(orphanFolder);

          // Remove the current folder from the list of orphaned folders and continue iterating from the same index.
View Full Code Here

    InterchangeDataRow[] arrData = folderItems.getRows();

    for( InterchangeDataRow row : arrData ) {
      StringKeyValuePairs keyValues = dataParser.parse(row);

      FolderId parentFolderId = getFolderId(keyValues.get(FolderItem.PARENT_FOLDER_ID));
      if ( parentFolderId != null ) {
        Folder folder = m_folderIdFolderMap.get(parentFolderId);
        if ( folder != null ) {
          int iEntityTypeId = keyValues.getInt(FolderItem.ENTITY_TYPE_ID);
          EntityType et = EntityType.fromId(iEntityTypeId);
View Full Code Here

            }
        }

        private void restoreFolder(Folder parent, EntityType type, Persistor child) {
            String name = restoreName(child);
            FolderId id = restoreId(child, FolderId.class);
            Folder folder = new Folder(id, name, type);
            parent.addItem(folder);
            populateFolder(folder, child, type);
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.entity.id.FolderId

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.