Examples of findById()


Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  private void removeWhiteListEntry(HttpServletRequest request) {
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    String entryId = request.getParameter("entryId"); //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWhitelist entry = persistenceManager.findById(IWhitelist.class, entryId);
    if(persistenceManager.delete(entry)){
      request.setAttribute("message_value", localizedMessages.getString("WidgetAdminServlet.10"));          //$NON-NLS-1$ //$NON-NLS-2$
    }
    else{
      request.setAttribute("error_value", localizedMessages.getString("WidgetAdminServlet.11")); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  private void removeWidget(HttpServletRequest request, Configuration properties, IWidgetAdminManager manager) {
    final String WIDGETFOLDER = getServletContext().getRealPath(properties.getString("widget.widgetfolder"));//$NON-NLS-1$
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    String widgetId = request.getParameter("widgetId"); //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, widgetId);
    String guid = widget.getGuid();
    if(WidgetFactory.destroy(widgetId)){
      if(WidgetFileUtils.removeWidgetResources(WIDGETFOLDER, guid)){     
        request.setAttribute("message_value", localizedMessages.getString("WidgetAdminServlet.12"));       //$NON-NLS-1$ //$NON-NLS-2$
      }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

        //
        // test findById  for IWidget
        //
        Object widgetId = allWidgets[0].getId();
        IWidget widgetById = persistenceManager.findById(IWidget.class, widgetId);
        assertNotNull(widgetById);
        assertEquals(allWidgets[0], widgetById);
       
        //
        // test findById  for IWidgetDefault
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

       
        //
        // test findById  for IWidgetDefault
        //
        Object widgetDefaultId = allWidgetDefaults[0].getId();
        IWidgetDefault widgetDefaultById = persistenceManager.findById(IWidgetDefault.class, widgetDefaultId);
        assertNotNull(widgetDefaultById);
        assertEquals(allWidgetDefaults[0], widgetDefaultById);

        //
        // test findByValue method for IWidget
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

      HttpServletResponse response) throws ResourceNotFoundException,
      UnauthorizedAccessException, IOException {
    // attempt to get specific widget by id; note that this is the internal
    // widget integer ID and not the widget URI
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
    if (widget == null) throw new ResourceNotFoundException();
    // redirect to the UDD
    if (widget.getUpdateLocation() ==  null) throw new ResourceNotFoundException();
    response.sendRedirect(widget.getUpdateLocation());
  }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  protected void update(String resourceId, HttpServletRequest request, HttpServletResponse response)
      throws ResourceNotFoundException, InvalidParametersException,
      UnauthorizedAccessException {
      // attempt to get specific widget by id
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
      if (widget == null) throw new ResourceNotFoundException();
      // FIXME localize error messages
      try {
        W3CWidgetFactory factory  = getFactory(request.getSession().getServletContext());
        installUpdate(factory, widget, false);
View Full Code Here

Examples of org.bat.client.persistence.MerchantSessionHibernateDAO.findById()

      MerchantSessionHibernateDAO mercDAO = new MerchantSessionHibernateDAO();
      mercDAO.setSession(session);
      MerchantSession viewMS;
      try {
        Transaction tx = session.beginTransaction();
        viewMS = mercDAO.findById(new Integer(commandMatcher.group(1)), false);
        tx.commit();
        if (COMMAND_MERCHANT_VIEWSESSION.equals(commandName))
          reportReceiptSummary(viewMS, null);
        else if (COMMAND_MERCHANT_VIEWSESSION_DETAILS.equals(commandName))
          reportReceiptDetails(viewMS, null);
View Full Code Here

Examples of org.bat.client.persistence.MerchantSessionHibernateDAO.findById()

      mercDAO.setSession(session);
      MerchantSession viewMS;
      String queryPlayer = triggerMatcher.group(1);
      try {
        Transaction tx = session.beginTransaction();
        viewMS = mercDAO.findById(new Integer(triggerMatcher.group(2)), false);
        tx.commit();
        if (queryPlayer.equalsIgnoreCase(viewMS.getCustomer().getName())) {
          tx = session.beginTransaction();
          viewMS = mercDAO.fetchWithServices(viewMS);
          tx.commit();
View Full Code Here

Examples of org.chromattic.api.ChromatticSession.findById()

         throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
            + "' hasn't been persisted and thus cannot be updated.");
      }

      ChromatticSession session = persister.getSession();
      ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
      if (pim == null)
      {
         throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
      }
      String oldId = pim.getId();
View Full Code Here

Examples of org.chromattic.api.ChromatticSession.findById()

      session.save();
      chromatticManager.endRequest(true);

      chromatticManager.beginRequest();
      session = test1LF.getChromattic().openSession();
      foo = session.findById(FooEntity.class, fooId);
      session.close();
      chromatticManager.endRequest(false);

      assertNotNull(foo);
   }
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.