Ejemplo n.º 1
0
  public static ArrayList<ContentTreeItem> addTreeItemsByParentDocFolders(
      ArrayList<CContent> calendars, ContentTree tree, DataSourceBase dataSource) {

    ArrayList<ContentTreeItem> result = new ArrayList<ContentTreeItem>();
    for (int s = 0; s < calendars.size(); s++) {
      CContent album = calendars.get(s);

      ContentTreeItem cItem = new ContentTreeItem();
      cItem.name = album.getTitle();
      cItem.contentType =
          "" + ECMContentSourceTypeTools.TypeToInteger(ECMContentSourceType.GoogleDocumentFolder);
      cItem.dataSourceUID = dataSource.uid;
      String uuid = UUID.randomUUID().toString();
      cItem.id = uuid;
      cItem.uid = album.getRefId();
      cItem.setUidStr(album.refIdStr);
      result.add(cItem);
      tree.items.add(cItem);
      cItem.type = "leaf";

      Reference ref = new Reference();
      ref._reference = "" + album.getRefIdStr();
      // ref._reference="" + cItem.id;
    }

    return result;
  }
Ejemplo n.º 2
0
  public static ArrayList<ContentTreeItem> addTreeItemsByParent(
      CList albums, ArrayList<CListItem> photos, ContentTree tree, DataSourceBase dataSource) {
    ArrayList<ContentTreeItem> result = new ArrayList<ContentTreeItem>();

    for (int s = 0; s < albums.getItems().size(); s++) {
      CListItem album = albums.getItems().get(s);

      ArrayList<CListItem> albumEntries = CListItemTools.getByGroupId(photos, album.getRef());
      if (albumEntries != null && albumEntries.size() == 0) {
        continue;
      }

      ContentTreeItem cItem = new ContentTreeItem();
      cItem.name = album.getTitle();
      cItem.contentType =
          "" + ECMContentSourceTypeTools.TypeToInteger(ECMContentSourceType.GooglePicassaAlbum);
      cItem.dataSourceUID = dataSource.uid;
      String uuid = UUID.randomUUID().toString();
      cItem.id = uuid;
      cItem.uid = album.getRefId();
      cItem.setUidStr(album.ref);
      result.add(cItem);
      tree.items.add(cItem);
      cItem.type = "leaf";
      if (albumEntries != null && albumEntries.size() > 0) {
        for (int ai = 0; ai < albumEntries.size(); ai++) {
          CListItem article = albumEntries.get(ai);

          ContentTreeItem articleItem = new ContentTreeItem();
          articleItem.name = article.title;
          // articleItem.id = ""+(article.article_id + 50000);
          String uuid3 = UUID.randomUUID().toString();

          // articleItem.id = article.getTreeUid();
          articleItem.id = uuid3;
          articleItem.uidStr = article.getRef();
          articleItem.label = article.title;
          articleItem.contentType =
              "" + ECMContentSourceTypeTools.TypeToInteger(ECMContentSourceType.GooglePicassaItem);
          articleItem.dataSourceUID = dataSource.uid;
          result.add(articleItem);
          tree.items.add(articleItem);
          // c.hasSubCategories = CategoryTools.hasSubCategories(cats, c.index);
          articleItem.type = "item";
          articleItem.setChildren(null);
          articleItem.children = new ArrayList<Reference>();

          Reference articleRef = new Reference();
          articleRef._reference = "" + articleItem.id;
          cItem.addChild(articleRef);
        }
      }
      Reference ref = new Reference();
      ref._reference = "" + album.getRef();
      // ref._reference="" + cItem.id;
    }

    return result;
  }