Package org.nextime.ion.framework.business

Examples of org.nextime.ion.framework.business.Section


      // add sections
      Mapping.begin();
      Vector sections = Section.listAll();
      Mapping.rollback();
      for (int i = 0; i < sections.size(); i++) {
        Section section = (Section) sections.get(i);
        try {
          URL url =
            new URL(
              frontUrl+"/section/"
                + section.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
              content += line;
            }
          }

          ZipEntry ze =
            new ZipEntry("section/" + section.getId() + ".html");
          zip.putNextEntry(ze);
          zip.write(content.getBytes());
          zip.closeEntry();
        } catch (Exception e) {
          System.out.println(
            "Static export error, section " + section.getId());
        }
      }

      // add publications
      Mapping.begin();
View Full Code Here


      if (requestedId == null) {
        requestedId = getDefaultSectionId();
      }

      // recup�re une instance sur la Section
      Section section = Section.getInstance(requestedId)
     
      // cache
      if( shouldBeCached && !"disabled".equalsIgnoreCase(SectionTypes.getSectionBean(this,section.getMetaData("template")+"").getCache()) ) {
        SmartCacheManager.cacheSection(requestedId);
      }   

      // cr�� le bean de status
      IonStatus status = new IonStatus();
      status.setCurrentSection(section);
      if( request.getParameter("static")!=null ) status.setIsStatic(true);
      request.setAttribute("ionStatus", status);

      // utilise la metaData "template" de la section
      // pour decider vers quelle vue rediriger le flux
      String template = (String) section.getMetaData("template");
      if (template == null)
        template = "default";
       
      String jsp = SectionTypes.getSectionBean(this,template).getJsp();
       
View Full Code Here

  public Collection selectObjects(Hashtable params) throws SelectException {
    try {
      String rootSection = (String) params.get("rootSection");
      //Mapping.begin();
      Section root = Section.getInstance(rootSection);
      Vector v = root.listSubSections();
      //Mapping.rollback();
      return v;
    } catch (Exception e) {
      Logger.getInstance().error("Erreur du SelectObject", this, e);
      throw new SelectException(e.getMessage());
View Full Code Here

  public Collection selectObjects(Hashtable params) throws SelectException {
    try {
      Vector v = new Vector();
      int level = Integer.parseInt(params.get("level")+"");
      Section s = Section.getInstance(params.get("section")+"");
      if( level > s.getLevel() ) return v;
      Section parent = s;
      while( parent.getLevel() > level ) {
        parent = parent.getParent();
      }
      v.add(parent);
      return v;
    } catch (Exception e) {
      Logger.getInstance().error("Erreur du SelectObject : "+e.getMessage(),this,e);
View Full Code Here

    HttpServletResponse response)
    throws IOException, ServletException {

    try {
      Mapping.begin();
      Section s = Section.getInstance(request.getParameter("id"));
      if (request.getParameter("type").equals("up")) {
        s.up();
      } else {
        s.down();
      }
      Mapping.commit();
    } catch (MappingException e) {
      Mapping.rollback();
      throw new ServletException(e);
View Full Code Here

        if (getPublication() != null) {
          publication = Publication.getInstance(getPublication());
        }
      } catch (Exception e) {
      }
      Section section = null;
      try {
        if (getSection() != null) {
          section = Section.getInstance(getSection());
        }
      } catch (Exception e) {
View Full Code Here

public class ListOnlineSubSections implements ObjectSelector {

  public Collection selectObjects(Hashtable params) throws SelectException {
    try {
      String rootSection = (String) params.get("rootSection");
      Section root = Section.getInstance(rootSection);
      Vector v = root.listSubSections();
      Vector result = new Vector();
      for( int i=0; i<v.size(); i++ ) {
          Section s = (Section)v.get(i);
          if( !"offline".equalsIgnoreCase(s.getMetaData("status")+"") ) {
            result.add(s);
          }
      }
      return result;
    } catch (Exception e) {
View Full Code Here

     
      // recup�re une instance sur la Publication
      Publication publication = Publication.getInstance(requestedId);
     
      // recup�re la section de cette publication
      Section section = (Section)publication.listSections().firstElement();
     
      // cr�� le bean de status
      IonStatus status = new IonStatus();
      status.setCurrentSection(section);
      status.setCurrentPublication(publication);
      if( request.getParameter("static")!=null ) status.setIsStatic(true);
      request.setAttribute("ionStatus", status);

      // utilise la metaData "template" de la section
      // pour decider vers quelle vue rediriger le flux
      String template = (String) section.getMetaData("template");
      if (template == null)
        template = "default"
       
      String jsp = SectionTypes.getSectionBean(this,template).getJsp();
     
View Full Code Here

  public Collection selectObjects(Hashtable params) throws SelectException {
    try {
      //Mapping.begin();
      String currentSection = (String)params.get("currentSection");
      Vector v = new Vector();
      Section current = Section.getInstance(currentSection);
      while( current != null ) {
        v.add( current );
        current = current.getParent();
      }
      Collections.reverse(v);
      //Mapping.rollback();
      return v;
    } catch (Exception e) {
View Full Code Here

    TreeControlNode node = tree.findNode(selectedId);

    try {
      Mapping.begin();

      Section section = Section.getInstance(selectedId);
      section.remove();
      // update tree
      try {
        TreeControlNode parent = node.getParent();
        node.remove();
        if (parent != null) {
View Full Code Here

TOP

Related Classes of org.nextime.ion.framework.business.Section

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.