Package com.germinus.mashupbuilder.bean

Examples of com.germinus.mashupbuilder.bean.Page


            }

            if (id != null) {
                Integer intId = Integer.parseInt(id);

                Page pagePattern = new Page();
                pagePattern.setId(intId);

                DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.FactoryType.JDBC);
                PageDAO pageDAO = (PageDAO) daoFactory.getDAO(Page.class);
                Page pageFound = pageDAO.find(pagePattern);
                if (pageFound != null) {
                    StringBuilder sb = new StringBuilder();
                    if (callback != null) {
                        sb.append(callback).append("(");
                    } else if (!JSON.equals(json)) {
                        sb.append("romulus.pageEditor.app.register('");
                        sb.append(pageFound.getId()).append("', ");
                    }
                    sb.append(pageFound.getJson());
                    if (callback != null) {
                        sb.append(");");
                    } else if (!JSON.equals(json)) {
                        sb.append(");");
                    }
View Full Code Here


                description = "";
            }

            DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.FactoryType.JDBC);
            PageDAO pageDAO = (PageDAO) daoFactory.getDAO(Page.class);
            Page page = null;
            if (idSt != null) {
                int id = Integer.parseInt(idSt);
                page = new Page(id, name, description, json);
                pageDAO.updateJson(page);
            } else {
                page = new Page(name, description, json);
                int id = pageDAO.saveAndGetId(page);
                page.setId(id);
            }
            out.write(XMLFormatter.toXML(page));
        } catch (NumberFormatException nbe) {
            Logger.getLogger(PageController.class.getName()).log(Level.SEVERE, null, nbe);
            reportError(out, Errors.INSUFICIENTS_PARAMETERS);
View Full Code Here

        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;

        Page pageFound = null;

        try {
            con = JDBCDAOFactory.getConnection();
            pstmt = con.prepareStatement(query);
            pstmt.setInt(1, page.getId());
            rs = pstmt.executeQuery();
            if (rs.next()) {
                pageFound = new Page();
                pageFound.setId(rs.getInt("id"));
                pageFound.setName(rs.getString("name"));
                pageFound.setDescription(rs.getString("description"));
                pageFound.setJson(rs.getString("json"));
            }

            rs.close();
        } catch (SQLException ex) {
            throw new DAOException(ex);
View Full Code Here

        try {
            con = JDBCDAOFactory.getConnection();
            pstmt = con.prepareStatement(query);
            rs = pstmt.executeQuery();
            while (rs.next()) {
                Page page = new Page();
                page.setId(rs.getInt("id"));
                page.setName(rs.getString("name"));
                page.setDescription(rs.getString("description"));
                page.setJson(rs.getString("description"));

                pageList.add(page);
            }

            rs.close();
View Full Code Here

TOP

Related Classes of com.germinus.mashupbuilder.bean.Page

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.