-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #21 - make menu and foot fragments
Fixes #244 - make source not found page have full menu Fixes #243 - make person not found page have full menu
- Loading branch information
1 parent
fafb018
commit e185b82
Showing
25 changed files
with
298 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexHrefRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.schoellerfamily.gedbrowser.renderer; | ||
|
||
import org.schoellerfamily.gedbrowser.datamodel.GedObject; | ||
|
||
/** | ||
* Provides the pattern of returning an index query. The default goes to the | ||
* letter A. | ||
* | ||
* @author Dick Schoeller | ||
* @param <T> the GedObject type to render | ||
*/ | ||
public interface IndexHrefRenderer<T extends GedObject> { | ||
/** | ||
* @return the GedObject | ||
*/ | ||
T getGedObject(); | ||
|
||
|
||
/** | ||
* @return the href string to the index page containing this person. | ||
*/ | ||
default String getIndexHref() { | ||
return "surnames?db=" + getGedObject().getDbName() + "&letter=" + "A"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...ain/java/org/schoellerfamily/gedbrowser/controller/exception/ObjectNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.schoellerfamily.gedbrowser.controller.exception; | ||
|
||
import org.schoellerfamily.gedbrowser.renderer.RenderingContext; | ||
|
||
/** | ||
* @author Dick Schoeller | ||
*/ | ||
public class ObjectNotFoundException extends RuntimeException { | ||
/** */ | ||
private static final long serialVersionUID = 3L; | ||
|
||
/** */ | ||
private final String id; | ||
|
||
/** */ | ||
private final String datasetName; | ||
|
||
/** */ | ||
private final RenderingContext context; | ||
|
||
/** | ||
* @param message the message to display | ||
* @param id the ID of the object not found | ||
* @param datasetName the name of the dataset being searched | ||
* @param context the rendering context | ||
*/ | ||
public ObjectNotFoundException(final String message, final String id, | ||
final String datasetName, final RenderingContext context) { | ||
super(message); | ||
this.id = id; | ||
this.datasetName = datasetName; | ||
this.context = context; | ||
} | ||
|
||
|
||
/** | ||
* Get the ID of the person that was not found. | ||
* | ||
* @return the ID | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* @return get the name of the dataset being searched | ||
*/ | ||
public String getDatasetName() { | ||
return datasetName; | ||
} | ||
|
||
/** | ||
* @return href string to the index page for surnames beginning with A. | ||
*/ | ||
public String getIndexHref() { | ||
return "surnames?db=" + datasetName + "&letter=" + "A"; | ||
} | ||
|
||
/** | ||
* Check if the user has a particular role. | ||
* | ||
* @param role role that we are looking for | ||
* @return true if the user has the role | ||
*/ | ||
public boolean hasRole(final String role) { | ||
return context.hasRole(role); | ||
} | ||
|
||
/** | ||
* @return the href string to the living estimator. | ||
*/ | ||
public String getLivingHref() { | ||
return "living?db=" + datasetName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.