Examples of ViewEnum


Examples of net.sourceforge.gedapi.view.ViewEnum

  {
    LOG.finest("Invoking the doGet method of the GedapiServlet.");
    StringBuilder uri = new StringBuilder(request.getRequestURI());
    LOG.finest("The GedapiServlet request URI is: "+uri);

    ViewEnum view = getView(uri);
    if(view == null)
    {
      return;
    }
   
    //String searchCriteria = request.getParameter("searchCriteria");
    String searchCriteria = null;
    String searchScope = "INDI:NAME";
    if(view.equals(ViewEnum.GEDCOM_SEARCH_VIEW))
    {
      int searchCriteriaIndex = uri.indexOf("/");
      if(searchCriteriaIndex == -1)
      {
        throw new ServletException(ErrorCodes.NO_SEARCH_CRITERIA.getErrorMessage(new Object[] {uri.toString()}));
View Full Code Here

Examples of net.sourceforge.gedapi.view.ViewEnum

 
 
    public ViewEnum getView(StringBuilder uri)
      throws IOException, ServletException
    {
      ViewEnum view = null;
    // start at the beginning of the uri and look for the index of '/%d/'
    int tabIndex = uri.indexOf("/"+ViewEnum.FAMILY_VIEW.view()+"/");
    if(tabIndex == -1)
    {
      tabIndex = uri.indexOf("/"+ViewEnum.PEDIGREE_VIEW.view()+"/");
    }
    else if(view == null)
    {
      view = ViewEnum.FAMILY_VIEW;
    }

    if(tabIndex == -1)
    {
      tabIndex = uri.indexOf("/"+ViewEnum.INDIVIDUAL_VIEW.view()+"/");
    }
    else if(view == null)
    {
      view = ViewEnum.PEDIGREE_VIEW;
    }
   
    if(tabIndex == -1)
    {
      tabIndex = uri.indexOf("/"+ViewEnum.GEDCOM_SEARCH_VIEW.view()+"/");
    }
    else if(view == null)
    {
      view = ViewEnum.INDIVIDUAL_VIEW;
    }

   
    if(tabIndex == -1)
    {
      tabIndex = uri.indexOf("/"+ViewEnum.SUBMITTER_VIEW.view()+"/");
    }
    else if(view == null)
    {
      view = ViewEnum.GEDCOM_SEARCH_VIEW;
    }
   
    if(tabIndex == -1)
    {
      tabIndex = uri.indexOf("/"+ViewEnum.ALL_GLINKS_VIEW.view()+"/");
    }
    else if(view == null)
    {
      view = ViewEnum.SUBMITTER_VIEW;
    }
   
    if(tabIndex == -1)
    {
      // If an invalid view does occur then it is not the fault of the end
      // user so just throw an exception into the console log but don't tell the end
      // user about it.
      new Exception("Invalid view in uri: "+uri).printStackTrace();
      view = null;
    }
    else if(view == null)
    {
      view = ViewEnum.ALL_GLINKS_VIEW;
    }
   
    if(view != null)
    {
      uri.delete(0,tabIndex+view.view().length()+2);
    }
    return view;
    }
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.