Package com.germinus.mashupbuilder.bean

Examples of com.germinus.mashupbuilder.bean.Mashup


            }

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

                Mashup mashupPattern = new Mashup();
                mashupPattern.setId(intId);

                DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.FactoryType.JDBC);
                MashupDAO mashupDAO = (MashupDAO) daoFactory.getDAO(Mashup.class);
                Mashup mashupFound = mashupDAO.find(mashupPattern);
                if (mashupFound != null) {
                    StringBuilder sb = new StringBuilder();
                    if (callback != null) {
                        sb.append(callback).append("(");
                    } else if (!JSON.equals(json)) {
                        sb.append("afrous.processes.register('");
                        sb.append(mashupFound.getId()).append("', ");
                    }
                    sb.append(mashupFound.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);
            MashupDAO mashupDAO = (MashupDAO) daoFactory.getDAO(Mashup.class);
            Mashup mashup = null;
            if (idSt != null) {
                int id = Integer.parseInt(idSt);
                mashup = new Mashup(id, name, description, json);
                mashupDAO.updateJson(mashup);
            } else {
                mashup = new Mashup(name, description, json);
                int id = mashupDAO.saveAndGetId(mashup);
                mashup.setId(id);
            }
            out.write(XMLFormatter.toXML(mashup));
        } catch (NumberFormatException nbe) {
            Logger.getLogger(MashupController.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;

        Mashup mashupFound = null;

        try {
            con = JDBCDAOFactory.getConnection();
            pstmt = con.prepareStatement(query);
            pstmt.setInt(1, mashup.getId());
            rs = pstmt.executeQuery();
            if (rs.next()) {
                mashupFound = new Mashup();
                mashupFound.setId(rs.getInt("id"));
                mashupFound.setName(rs.getString("name"));
                mashupFound.setDescription(rs.getString("description"));
                mashupFound.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()) {
                Mashup mashup = new Mashup();
                mashup.setId(rs.getInt("id"));
                mashup.setName(rs.getString("name"));
                mashup.setDescription(rs.getString("description"));
                mashup.setJson(rs.getString("description"));

                mashupList.add(mashup);
            }

            rs.close();
View Full Code Here

import org.json.JSONException;
import org.json.JSONObject;

public class WADLGenerator {   
    public static String generateWADLForMashupRESTService(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
View Full Code Here

       
        return applicationDocument.xmlText(new XmlOptions().setSavePrettyPrint());
    }
   
    public static String generateWADLForMashupRESTServiceJSON(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
View Full Code Here

        Representation representation = response.addNewRepresentation();
        representation.setMediaType(mediaType);
    }
   
    private static Mashup getMashup(int mashupId) throws DAOException {
        Mashup mashupPattern = new Mashup();
        mashupPattern.setId(mashupId);
       
        DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.FactoryType.JDBC);
        MashupDAO mashupDAO = (MashupDAO) daoFactory.getDAO(Mashup.class);
        return mashupDAO.find(mashupPattern);
    }
View Full Code Here

     * </ul>
     */
    public String executeMashup(int mashupId, Map<String,String> parametersMap) {

        try {
            Mashup mashupPattern = new Mashup();
            mashupPattern.setId(mashupId);

            DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.FactoryType.JDBC);
            MashupDAO mashupDAO = (MashupDAO) daoFactory.getDAO(Mashup.class);
            Mashup mashupFound = mashupDAO.find(mashupPattern);
            if (mashupFound != null) {
               String result = mmse.executeMashup(mashupFound.getJson(), parametersMap);
               result = "{result:" + result + "}";
               return result;
            } else {
                return reportError(Errors.MASHUP_NOT_FOUND);
            }
View Full Code Here

TOP

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

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.