Package com.cosmo.orm

Examples of com.cosmo.orm.OrmFactory


      // Limpia los IDs
      this.rowIds = new ArrayList<Integer>();

      // Obtiene el ResultSet
      OrmFactory ormp = new OrmFactory(dataSourceId, getWorkspace());
      rs = ormp.select(ormClass, showAllColumns);

      // Establece los datos en el grid
      this.gridData.setCells(rs, true);

      // Establece los índices de las columnas que contienen las claves principales
View Full Code Here


   }

   @Override
   public PageContext formSendedEvent(PageContext pc, HttpServletRequest request, HttpServletResponse response)
   {
      OrmFactory ormp;
      OrmApplication app;
      Class<?> cls;

      try
      {
         // Obtiene la definici�n de la aplicaci�n y genera la estructura de p�gina
         app = getWorkspace().getProperties().getOrmProperties().getOrmApplication(getApplicationId(request));

         // Obtiene la referencia a la clase CORM objeto de la aplicaci�n
         cls = Class.forName(app.getClassName());

         // Obtiene la instancia del Request
         Object instance = OrmFactory.getObjectFromRequest(cls, request);

         ormp = new OrmFactory(app.getConnectionId(), getWorkspace());
         if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_CREATE))
         {
            ormp.insert(instance);
         }
         else if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_EDIT))
         {
            ormp.update(instance);
         }
         else if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_DELETE))
         {
            ormp.delete(instance);
         }

         // Genera la URL para mostrar el listado
         URL url = new URL(URL_BASE);
         url.addParameter(PARAMETER_APPID, HttpRequestUtils.getValue(request, PARAMETER_APPID));
View Full Code Here

         // Si se trata de eliminar o editar, se act�a previamente
         if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_DELETE))
         {
            Object instance = OrmFactory.getObjectFromRequest(cls, request);

            OrmFactory ormp = new OrmFactory(app.getConnectionId(), getWorkspace());
            ormp.delete(instance);
         }

         // Seg�n el comando, realiza una acci�n. Si no hay comando, muestra el grid
         if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_CREATE))
         {
            FormControl form = new FormControl(getWorkspace(), app.getId());
            form.addGroup(cls);
            form.addHiddenValue(new FormFieldHidden(PARAMETER_APPID, HttpRequestUtils.getValue(request, PARAMETER_APPID)));
            form.addHiddenValue(new FormFieldHidden(PARAMETER_COMMAND, HttpRequestUtils.getValue(request, PARAMETER_COMMAND)));
            pc.addContent(form, ContentColumns.MAIN);
         }
         else if (HttpRequestUtils.getValue(request, PARAMETER_COMMAND, "").equals(COMMAND_EDIT))
         {
            Object instance = OrmFactory.getObjectFromRequest(cls, request);

            OrmFactory ormp = new OrmFactory(app.getConnectionId(), getWorkspace());
            instance = ormp.get(instance);

            FormControl form = new FormControl(getWorkspace(), app.getId());
            form.addGroup(instance);
            form.addHiddenValue(new FormFieldHidden(PARAMETER_APPID, HttpRequestUtils.getValue(request, PARAMETER_APPID)));
            form.addHiddenValue(new FormFieldHidden(PARAMETER_COMMAND, HttpRequestUtils.getValue(request, PARAMETER_COMMAND)));
View Full Code Here

   @Override
   public PageContext formSendedEvent(PageContext pc, HttpServletRequest request, HttpServletResponse response)
   {
      Object instance;
      OrmFactory ormp;

      try
      {
         instance = OrmFactory.getObjectFromRequest(Weather.class, request);

         ormp = new OrmFactory("cosmo.server", getWorkspace());
         ormp.insert(instance);

         response.sendRedirect("GridPage");
      }
      catch (Exception ex)
      {
View Full Code Here

   @Override
   public PageContext formSendedEvent(PageContext pc, HttpServletRequest request, HttpServletResponse response)
   {
      Object instance;
      OrmFactory ormp;
     
      try
      {
         instance = OrmFactory.getObjectFromRequest(Weather.class, request);
        
         ormp = new OrmFactory("cosmo.server", getWorkspace());
         ormp.insert(instance);

         response.sendRedirect("GridPage");
      }
      catch (Exception ex)
      {
View Full Code Here

TOP

Related Classes of com.cosmo.orm.OrmFactory

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.