Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.BadParameterEx


        try {
            final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
            processedMetadata = XslProcessing.get().process(id, process,
                    true, context.getAppPath(), report, true, siteURL, request);
            if (processedMetadata == null) {
                throw new BadParameterEx("Processing failed", "Not found:"
                        + report.getNotFoundMetadataCount() + ", Not owner:" + report.getNotEditableMetadataCount()
                        + ", No process found:" + report.getNoProcessFoundCount() + ".");
            }
        } catch (Exception e) {
            throw e;
View Full Code Here


    String todaysDate = sdf.format(cal.getTime());
    boolean passwordMatches = PasswordUtil.encoder(context.getServlet().getServletContext()).matches(scrambledPassword+todaysDate, changeKey);

    //check change key
    if (!passwordMatches)
      throw new BadParameterEx("Change key invalid or expired", changeKey);
   
    // get mail details
    SettingManager sm = context.getBean(SettingManager.class);

    String adminEmail = sm.getValue("system/feedback/email");
View Full Code Here

        try {
            final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
            processedMetadata = XslProcessing.get().process(id, process,
                    true, context.getAppPath(), report, true, siteURL, request);
            if (processedMetadata == null) {
                throw new BadParameterEx("Processing failed", "Not found:"
                        + report.getNotFoundMetadataCount() + ", Not owner:" + report.getNotEditableMetadataCount()
                        + ", No process found:" + report.getNoProcessFoundCount() + ".");
            }
        } catch (Exception e) {
            throw e;
View Full Code Here

        final SchematronCriteriaGroupRepository repository = context.getBean(SchematronCriteriaGroupRepository.class);
        try {
            repository.delete(new SchematronCriteriaGroupId(groupName, schematronId));
        } catch (EmptyResultDataAccessException e) {
            if (!context.getBean(SchematronRepository.class).exists(schematronId)) {
                throw new BadParameterEx(PARAM_SCHEMATRON_ID, ""+schematronId);
            } else {
                throw new BadParameterEx(PARAM_GROUP_NAME, groupName);

            }
        }
        return new Element("ok");
    }
View Full Code Here

    String access = Util.getParam(params, Params.ACCESS, Params.Access.PUBLIC);

    boolean doNotify = false;

    if (fname.contains("..")) {
      throw new BadParameterEx("Invalid character found in resource name.", fname);
    }
   
    if (access.equals(Params.Access.PRIVATE))
    {
      Lib.resource.checkPrivilege(context, id, ReservedOperation.download);
View Full Code Here

            element = criteriaRepository.findAllAsXml(spec);
        } else {
            final SchematronCriteria criteria = criteriaRepository.findOne(Integer.parseInt(id));

            if (criteria == null) {
                throw new BadParameterEx(Params.ID, id);
            }
            element = new Element(Jeeves.Elem.RESPONSE).addContent(criteria.asXml());
        }

        @SuppressWarnings("unchecked")
View Full Code Here

            } else {
                throw new IOException("Error deleting criteria object");
            }
        }

        throw new BadParameterEx(Params.ID, id);
    }
View Full Code Here

                }
                final FacetConfig facetConfig = _summaryConfig.get(item.trim());
                if (facetConfig != null) {
                    tmpConfig.put(item.trim(), facetConfig);
                } else {
                    throw new BadParameterEx(Geonet.SearchResult.SUMMARY_ITEMS, item + " Legal values are: " + _summaryConfig.keySet());
                }
            }

            _summaryConfig = tmpConfig;
        }
View Full Code Here

        File formatDir = getAndVerifyFormatDir(Params.ID, xslid);
        File desiredFile = new File(formatDir, fileName.replace("/", File.separator));
       
        if(!containsFile(formatDir, desiredFile)) {
            throw new BadParameterEx(Params.FNAME, fileName+" does not identify a file in the "+xslid+" format bundle");
        }
        if(!desiredFile.exists() || !desiredFile.isFile()) {
            throw new BadParameterEx(Params.FNAME, fileName+" does not identify a file");
        }
       
        return BinaryFile.encode(200, desiredFile.getAbsolutePath(), fileName, false);
    }
View Full Code Here

        if (id == null) {
            result = repository.findAllAsXml();
        } else {
            final Schematron one = repository.findOne(Integer.parseInt(id));
            if (one == null) {
                throw new BadParameterEx(Params.ID, id);
            }
            result = new Element("schematron").addContent(one.asXml());
        }

        result.setName("schematron");
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.BadParameterEx

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.