// the last part of the gedcomURL should be the individual id
// if the gedcomURL does not end in an individual id then the
// data for the first person in the gedcom is retrieved
Gedcom gedcom = gedcomURL.loadGedcom(networkReload, request);
Indi indi;
if(gedcomURL.isValidIndividualId())
{
indi = (Indi)gedcom.getEntity(Gedcom.INDI, gedcomURL.getIndividualId());
if(indi == null)
{
throw new ServletException(ErrorCodes.NONEXISTANT_INDI.getErrorMessage(new Object[] {gedcomURL.getIndividualId(), gedcomURL.getGedcomURL()}));
}
}
else
{
indi = (Indi)gedcom.getFirstEntity(Gedcom.INDI);
if(indi == null)
{
throw new ServletException(ErrorCodes.NO_INDIVIDUALS.getErrorMessage(new Object[] {gedcomURL.getGedcomURL()}));
}
gedcomURL.setIndividualId(indi.getId());
}
//switch on the view to know how to get the correct view data into X-JSON format
BaseView baseView = null;
switch(view)