Examples of ActionResult


Examples of com.jpoweredcart.common.system.file.ActionResult

 
  @RequestMapping(value="/copy")
  public @ResponseBody ActionResult copy(@RequestParam(value="path", required=false) String path,
      @RequestParam(value="name", required=false) String name, HttpServletRequest request){
   
    ActionResult result = new ActionResult();
   
    if(StringUtils.isNotEmpty(path)){
      if(name==null || name.length()<3 || name.length()> 255){
        result.setError(message(request, "error.filename"));
      }else if(!mediaFileService.exists(path) || name=="/"){
        result.setError(message(request, "error.copy"));
      }
    }else{
      result.setError(message(request, "error.select"));
    }
   
    if(!UserPermissions.canModify("common/filemanager")){
      result.setError(message(request, "error.permission"));
    }
   
    if(result.getError()==null){
      if(mediaFileService.copy(path, name)){
        result.setSuccess(message(request, "text.copy"));
      }else{
        result.setError(message(request, "error.copy"));
      }
    }
   
    return result;
  }
View Full Code Here

Examples of com.jpoweredcart.common.system.file.ActionResult

 
  @RequestMapping(value="/rename")
  public @ResponseBody ActionResult rename(@RequestParam(value="path", required=false) String path,
      @RequestParam(value="name", required=false) String name, HttpServletRequest request){
   
    ActionResult result = new ActionResult();
   
    if(StringUtils.isNotEmpty(path)){
      if(name==null || name.length()<3 || name.length()> 255){
        result.setError(message(request, "error.filename"));
      }else if(!mediaFileService.exists(path) || name=="/"){
        result.setError(message(request, "error.rename"));
      }
    }else{
      result.setError(message(request, "error.select"));
    }
   
    if(!UserPermissions.canModify("common/filemanager")){
      result.setError(message(request, "error.permission"));
    }
   
    if(result.getError()==null){
      if(mediaFileService.rename(path, name)){
        result.setSuccess(message(request, "text.rename"));
      }else{
        result.setError(message(request, "error.rename"));
      }
    }
   
    return result;
  }
View Full Code Here

Examples of com.jpoweredcart.common.system.file.ActionResult

 
  @RequestMapping(value="/upload")
  public @ResponseBody ActionResult upload(@RequestParam(value="directory", required=false) String directory,
      @RequestParam(value="image") MultipartFile multipartFile, HttpServletRequest request){
   
    ActionResult result = new ActionResult();
   
    String fileName = null;
   
    if(StringUtils.isNotEmpty(directory)){
     
      if(!mediaFileService.isDirectory(directory)){
        result.setError(message(request, "error.directory"));
      }else{
        if(multipartFile.isEmpty()){
          result.setError(message(request, "error.file"));
        }else{
          String originalName = multipartFile.getOriginalFilename();
          fileName = FilenameUtils.getName(originalName);
          String fileExt = FilenameUtils.getExtension(originalName);
          long fileSize = multipartFile.getSize();
          if(fileName==null || fileName.length()<3 || fileName.length()>255){
            result.setError(message(request, "error.filename"));
          }else if(fileSize > getSettingService().getEnvironment().getProperty("fileUpload.maxSize", Long.class)){
            result.setError(message(request, "error.fileSize"));
          }else if(!FileFilters.MEDIA_TYPES.contains(fileExt.toLowerCase())){
            result.setError(message(request, "error.fileType"));
          }
        }
      }
    }else{
      result.setError(message(request, "error.directory"));
    }
   
    if(!UserPermissions.canModify("common/filemanager")){
      result.setError(message(request, "error.permission"));
    }
   
    if(result.getError()==null){
      if(mediaFileService.upload(multipartFile, PathUtils.ensureEndingFileSeparator(directory)+fileName)){
        result.setSuccess(message(request, "text.uploaded"));
      }else{
        result.setError(message(request, "error.uploaded"));
      }
    }
    return result;
  }
View Full Code Here

Examples of de.innovationgate.wgaservices.types.ActionResult

       * @return The return value of the action
       * @throws WGAServiceException
       */
      @SuppressWarnings("unchecked")
    public Object callAction(String id, List params, Form form) throws WGAServiceException {
        ActionResult result = _services.callAction(_session, _db, id, _executionContext, params, form);
        if (result.getForm() != null) {
          return result.getForm();
        } else {
          return result.getNativeResult();
        }  
      }
View Full Code Here

Examples of de.innovationgate.wgaservices.types.ActionResult

           
            // If action result is an TMLForm, transform it back into a services form
            if (result instanceof de.innovationgate.wgpublisher.webtml.utils.TMLForm) {
                de.innovationgate.wgpublisher.webtml.utils.TMLForm tmlForm = (de.innovationgate.wgpublisher.webtml.utils.TMLForm) result;
                Form servicesForm = tmlForm.exportServicesForm();
                ActionResult actionResult = new ActionResult();
                actionResult.setForm(servicesForm);
                return actionResult;
            } else {
              ActionResult actionResult = new ActionResult();
              actionResult.setNativeResult(result);
              return actionResult;
            }
        }
        catch (TMLScriptException e) {
            throw new WGAServiceException(e.getMessage());
View Full Code Here

Examples of frwa.ActionResult

        List<Flight> flights = factory.getFlightDAO().searchForFlightsFromAirport(FlightsFrom);
        for (Flight flight: flights) {
            flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
            flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        }
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightsInformation.jsp");
        if (flights!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightsInformation.jsp");
        } else {
            actionResult.setUrlAddress("flt/FlightNotFound.jsp");
        }
        FlightsFormObject flightsFormObject = new FlightsFormObject();
        flightsFormObject.setFlights(flights);
        actionResult.setFormObject(flightsFormObject);
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

        List<Flight> flights = factory.getFlightDAO().searchForFlightsToAirport(FlightsTo);
        for (Flight flight: flights) {
            flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
            flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        }
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightsInformation.jsp");
        if (flights!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightsInformation.jsp");
        } else {
            actionResult.setUrlAddress("flt/FlightNotFound.jsp");
        }
        FlightsFormObject flightsFormObject = new FlightsFormObject();
        flightsFormObject.setFlights(flights);
        actionResult.setFormObject(flightsFormObject);
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

    public String getName() {
        return "MainAirport";
    }

    public ActionResult perform(HttpServletRequest request) {
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/MainAirport.jsp");
        actionResult.setFormObject(new FlightFormObject());
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

        return "AddFlight";
    }

    @Override
    public ActionResult perform(HttpServletRequest request) {
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/AddingFlight.jsp");
        FlightFormObject flightFormObject = new FlightFormObject();
        actionResult.setFormObject(flightFormObject);
        return actionResult;
    }
View Full Code Here

Examples of frwa.ActionResult

    @Override
    public ActionResult perform(HttpServletRequest request) {
        DAOFactory factory = DAOFactory.getDAOFactory(1);
        //List<Airport> airportList = factory.getAirportDAO().allAirportList();
        //List<Country> countryList = factory.getCountryDAO().allCountryList();
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("index.jsp");
//        if (airportList!=null && countryList!=null) {
//            actionResult.setUrlAddress("/index.jsp");
//        } else {
//            actionResult.setUrlAddress("flt/FlightNotFound.jsp");
//        }
        AirportCountryFormObject airportCountryFormObject = new AirportCountryFormObject();
        //airportCountryFormObject.setAirportList(airportList);
        //airportCountryFormObject.setCountryList(countryList);
        actionResult.setFormObject(airportCountryFormObject);
        return actionResult;
    }
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.