Package com.trustyoram.web.storage.config

Examples of com.trustyoram.web.storage.config.Storage


  {
    super();
   
    String s;
    int i;
    Storage storage;
    Category category;
   
    this.categories = new ArrayList<Category>();
   
    if ((storages == null) || (storages.size() == 0))
      return;
   
    Collections.sort(storages, new CompareStorage());
    s = null;
    category = null;
   
    for (i = 0; i < storages.size(); i++)
    {
      storage = storages.get(i);
     
      if ((s == null) || (!s.equals(storage.getCategory())))
      {
        if (category != null)
          category.sort();
       
        s = storage.getCategory();
        category = new Category();
       
        categories.add(category);
      }
       
View Full Code Here


   * @throws ServletException
   */
  public static final ArrayList<Storage> getStorageDefintion(String subfolder)
      throws StorageServletException {
    IFile[] files;
    Storage storage;
    TreeMap<String, Storage> storages;
    ArrayList<Storage> storagelist;
    HtmlStorage htmlStorage;
    InternalStorage internalStorage;
    PhotoInternalStorage photoInternalStorage;
    ImageLinkStorage imageLinkStorage;
    int i;
    Iterator<String> keys;

    try {
      IPath root = Configuration.getSystemRoot().getRoot().getFolderItem(subfolder);

      files = getDefinitionFiles(root, "storage.xml");
      storages = new TreeMap<String, Storage>();

      for (i = 0; i < files.length; i++) {
        try {
          storage = Storage.load(files[i]);

          if (storage instanceof ImageLinkStorage) {
            imageLinkStorage = (ImageLinkStorage) storage;

            imageLinkStorage.setImage(getUrl(files[i].getParent(), imageLinkStorage.getImage()));
          } else if (storage instanceof InternalStorage) {
            internalStorage = (InternalStorage) storage;

            internalStorage.setUrl(getUrl(files[i].getParent(), internalStorage.getUrl()));
          } else if (storage instanceof PhotoInternalStorage) {
            photoInternalStorage = (PhotoInternalStorage) storage;

            photoInternalStorage.setFullSizeBW(
                getUrl(files[i].getParent(), photoInternalStorage.getFullSizeBW()));

            photoInternalStorage.setFullSizeColor(
                getUrl(files[i].getParent(), photoInternalStorage.getFullSizeColor()));

            photoInternalStorage.setThumbnailBW(
                getUrl(files[i].getParent(), photoInternalStorage.getThumbnailBW()));

            photoInternalStorage.setThumbnailColor(
                getUrl(files[i].getParent(), photoInternalStorage.getThumbnailColor()));

            photoInternalStorage.setTitle(files[i].getParent().getName());
          } else if (storage instanceof HtmlStorage) {
            htmlStorage = (HtmlStorage) storage;

            htmlStorage.setFile(
              getNonServletUrl(files[i].getParent(), htmlStorage.getFile()));
          }

          storages.put(storage.getTitle() + i, storage);
        } catch (Exception e) {
          log.log(Level.SEVERE,
              "could not load storage at '"
                  + files[i].getAbsoluteName() + "'", e);
        }
View Full Code Here

TOP

Related Classes of com.trustyoram.web.storage.config.Storage

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.