Examples of PlutoAdminException


Examples of org.apache.pluto.portlet.admin.PlutoAdminException

      Collection apps = null;
    try {
      apps = getApplications();
    } catch (Exception e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    }
    Iterator iter = apps.iterator();
      while (iter.hasNext()) {
        PortletApplicationEntityImpl app = (PortletApplicationEntityImpl) iter.next();
        if (app.getDefinitionId().equalsIgnoreCase(appContext)) {
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

            }
        }
        catch (FileUploadException e){
            String msg = "File Upload Exception: " + e.getMessage();
            logError(METHOD_NAME, msg, e);
            throw new PlutoAdminException(e);
        } catch (Exception e) {
            String msg = "Exception: " + e.getMessage();
            logError(METHOD_NAME, msg, e);
            throw new PlutoAdminException(e);
        }
    } else {
        //set an error message
        request.getPortletSession().setAttribute(PlutoAdminConstants.MESSAGE_ATTR, new PortletMessage("No file appears to have been selected.", PortletMessageType.ERROR));
    }
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

              }
          }
      }
      catch (Exception e) {
        logError(CLASS_NAME, METHOD_NAME, e);
        throw new PlutoAdminException(e);
      }
      return ins;
  }
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

          pmap.put(names.get(i), appId+"." +i);
        }
        ins.close();
      } else {
        String msg = "Input stream is null";
        PlutoAdminException e = new PlutoAdminException(msg);
        logError(METHOD_NAME, e);
        throw e;
      }
      request.getPortletSession().setAttribute(PlutoAdminConstants.PORTLET_MAP_ATTR, pmap);
      return args;
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

      String contentString = new String(contentByte);
      //Check for previous deployment in pageregistry.xml
      String prev = "fragment name=\"" + name;
      if (contentString.lastIndexOf(prev) != -1){
        String errMsg = "Portlet '" + name + "' already exists in pageregistry.xml";
        PlutoAdminException e = new PlutoAdminException(errMsg);
        logError(METHOD_NAME, errMsg, e);
        throw e;//throw exception here
      }
      //start before close of root element
      long pos = contentString.lastIndexOf("</portal>");
      ras.seek(pos);

      //start page fragment
      ras.writeBytes("    <fragment name=\"" + name + "\" type=\"page\" >" + PlutoAdminConstants.LS);
      ras.writeBytes("        <navigation>" + PlutoAdminConstants.LS);
      ras.writeBytes("          <title>" + page.getTitle());
      ras.writeBytes("</title>" + PlutoAdminConstants.LS);
      ras.writeBytes("          <description>" + page.getDescription());
      ras.writeBytes("</description>" + PlutoAdminConstants.LS);
      ras.writeBytes("        </navigation>" + PlutoAdminConstants.LS);

      //iterate through portlets
      List portlets = page.getPortlets();
      //Sort list using Comparable implementation in PortletTO. This makes sure
      //  the items in the list are ordered by rows
      Collections.sort(portlets);
      Iterator iter = portlets.iterator();
      int count = 0;
      int currRow = 0;
      int lastRow = 0;
      int currCol = 0;
      while (iter.hasNext()) {
          count++;
          PortletTO portlet = (PortletTO)iter.next();
          logDebug(METHOD_NAME, "Portlet: " + portlet);
          currRow = portlet.getRow();
          currCol = portlet.getCol();
          //start row fragment
          //  Add row fragment when row changes
          if (currRow != lastRow) {
            ras.writeBytes("          <fragment name=\"row" + currRow + "\" type=\"row\">" + PlutoAdminConstants.LS);
            ras.writeBytes("             <fragment name=\"col" + count + "\" type=\"column\">" + PlutoAdminConstants.LS);
          }

            ras.writeBytes("                  <fragment name=\"p" + count + "\" type=\"portlet\">" + PlutoAdminConstants.LS);
            ras.writeBytes("                    <property name=\"portlet\" value=\"" + portlet.getValue() + "\"/>" + PlutoAdminConstants.LS);
            ras.writeBytes("                  </fragment><!-- end of portlet frag -->" + PlutoAdminConstants.LS);

            //end row fragment
            if (cols == currCol) {
              ras.writeBytes("             </fragment><!-- end of col frag -->" + PlutoAdminConstants.LS);
              //end of column iteration
              ras.writeBytes("         </fragment><!-- end of row frag -->" + PlutoAdminConstants.LS);
            }
          lastRow = currRow;
      }

      //end page fragment
      ras.writeBytes("    </fragment><!-- end of 'page' frag -->" + PlutoAdminConstants.LS);
      //add a couple of newlines to separate records
      ras.writeBytes(PlutoAdminConstants.LS);
      ras.writeBytes(PlutoAdminConstants.LS);
      //replace closing root element
      ras.writeBytes("</portal>" + PlutoAdminConstants.LS);

    } catch (IOException e) {
        logError(METHOD_NAME, e);
        throw new PlutoAdminException(e);
    } finally {
      if (ras != null) {
        try {
          ras.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

    try {
      PageRegistryXao xao = new PageRegistryXao();
      exists = xao.pageExists(pageName);
    } catch (Exception e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    }
    return exists;
  }
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

        sb.append(b);
      }
      contents = sb.toString().trim();
    } catch (FileNotFoundException e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    } catch (IOException e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    finally {
      if (fis != null) {
        try {
          fis.close();
        } catch (IOException e) {
          logError(METHOD_NAME, e);
          throw new PlutoAdminException(e);
        }
      }
    }
    return contents;
  }
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

      fos = new FileOutputStream(file);
      byte[] bytes = contents.getBytes();
      fos.write(bytes);
    } catch (FileNotFoundException e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    } catch (IOException e) {
      logError(METHOD_NAME, e);
      throw new PlutoAdminException(e);
    finally {
      if (fos != null) {
        try {
          fos.close();
        } catch (IOException e) {
          logError(METHOD_NAME, e);
          throw new PlutoAdminException(e);
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

      props = new Properties();
      try {
        props.load(stream);
      } catch (IOException e) {
        PlutoAdminLogger.logError(CLASS_NAME, METHOD_NAME, e);
        throw new PlutoAdminException(e);
      }
      //add props to the cache
      _cache.put(propFileName, props);
      return props;
    } else {
View Full Code Here

Examples of org.apache.pluto.portlet.admin.PlutoAdminException

        //TODO: test for null and use of alternate path in pluto-admin.properties
        int lastSlash = 0;
        if (plutoHome == null) {
            _plutoHome = getProperties().getProperty("pluto-home");
            if (_plutoHome == null || _plutoHome.equals("")) {
                throw new PlutoAdminException("pluto-home needs to be set in pluto-admin.properties.");
            }
        //get rid of last slash if it is the last character
        } else if (plutoHome.lastIndexOf(PlutoAdminConstants.FS) == plutoHome.length()-1) {
            lastSlash = plutoHome.lastIndexOf(PlutoAdminConstants.FS);
            _plutoHome = plutoHome.substring(0, lastSlash);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.