Examples of PlutoAdminException


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

    PortalImpl portal;
    try {
      org.apache.pluto.portlet.admin.model.PageRegistryXao xao = new org.apache.pluto.portlet.admin.model.PageRegistryXao();
      portal = xao.load();
    } catch (Exception e) {
      PlutoAdminException pae = new PlutoAdminException(e);
      logError(CLASS_NAME, METHOD_NAME, e);
      throw pae;
    }
    Collection prpages = portal.getFragments();
    Iterator iter = prpages.iterator();
View Full Code Here

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

      try {
        PortalImpl portal = load();
        frags = portal.getFragments();
      } catch (Exception e) {
        logError(METHOD_NAME, e);
        throw new PlutoAdminException(e);
      }
      Iterator iter = frags.iterator();
      while (iter.hasNext()) {
        FragmentImpl frag = (FragmentImpl) iter.next();
        String type = null;
View Full Code Here

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

            marshaller.setMapping(mappingWebXml);
            marshaller.marshal(webApp);
            } catch (Exception e) {
                writer.close();
                e.printStackTrace(System.out);
                throw new PlutoAdminException("Error found in Deploy.prepareWebArchive()", e);
            }
            // REMOVED copy of  tld b/c it's now included in the container distribution.
            //String strTo = dirDelim + "WEB-INF" + dirDelim + "tld" + dirDelim + "portlet.tld";
            //String strFrom = plutoHome + "portal" + dirDelim + "src" +
            //    dirDelim + "webapp" + strTo;

            //copy(strFrom, webAppsDir + webModule + strTo);
        } catch (Exception e) {

            e.printStackTrace(System.out);
            throw new PlutoAdminException("Error found in Deploy.prepareWebArchive()", e);
        }

        System.out.println("finished!");
    }
View Full Code Here

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

            prepareWebArchive(webAppsDir, warFile);
        } catch (PlutoAdminException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace(System.out);
            throw new PlutoAdminException("Error found in Deploy.main()", e);
        }

    }
View Full Code Here

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

            ras.writeBytes("</portlet-entity-registry>\r\n");
            ras.close();

        } catch (Exception e) {
            e.printStackTrace(System.out);
            throw new PlutoAdminException("Error found in Deploy.addToEntityReg()", e);
        }
    }
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
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.