Browse files

More bits

  • Loading branch information...
1 parent 2ec8f26 commit 335fe947a7fe9e862702766ca3bd705804a285ae Samuel Cochran committed Jul 28, 2011
View
21 src/main/java/au/com/gaiaresources/bdrs/model/portal/impl/PortalInitialiser.java
@@ -112,24 +112,25 @@ public void contextInitialized(ServletContextEvent arg0) {
PortalDAO portalDAO = AppContext.getBean(PortalDAO.class);
Session sesh = portalDAO.getSessionFactory().getCurrentSession();
- if (!portalDAO.getPortals().isEmpty()) {
- log.info("ROOT portal already exists, skipping initialisation");
- } else {
- log.info("Initialising ROOT portal");
- try {
- Transaction tx = sesh.beginTransaction();
+ try {
+ Transaction tx = sesh.beginTransaction();
+
+ if (!portalDAO.getPortals().isEmpty()) {
+ log.info("ROOT portal already exists, skipping initialisation");
+ } else {
+ log.info("Initialising ROOT portal");
initRootPortal();
// XXX: This is REALLY poorly thought out
BDRSWurflLoadService loadService = AppContext.getBean(BDRSWurflLoadService.class);
loadService.loadWurflXML("wurfl.xml");
loadService.loadWurflXML("wurfl_patch.xml");
-
- tx.commit();
- } catch (Exception e) {
- log.error("Failed to initialise ROOT portal", e);
}
+
+ tx.commit();
+ } catch (Exception e) {
+ log.error("Failed to initialise ROOT portal", e);
}
}
View
10 src/main/java/au/com/gaiaresources/bdrs/servlet/filter/PortalSelectionFilter.java
@@ -110,21 +110,21 @@ public void doFilter(ServletRequest request, ServletResponse response,
} else {
List<Portal> portalList = portalDAO.getPortals(sesh);
if (!portalList.isEmpty() && !response.isCommitted()) {
-
+
PortalMatches matches = portalMatcher.match(sesh, url);
Portal defaultPortal = matches.getDefaultPortal();
Portal matchedPortal = matches.getMatchedPortal();
PortalEntryPoint matchedEntryPoint = matches.getMatchedEntryPoint();
-
+
// For each portal, test the entry points.
if (defaultPortal == null) {
- log.debug("No default Portal. Treating first portal as default.");
defaultPortal = portalList.get(0);
+ log.debug("No default Portal. Treating first portal as default: " + defaultPortal.getName());
}
-
+
if (matchedPortal == null) {
if (rawPortalId == null) {
- log.debug("URL does not match any known portal entry pattern. Using default portal.");
+ log.debug("URL does not match any known portal entry pattern. Using default portal: " + defaultPortal.getName());
matchedPortal = defaultPortal;
} else {
// The Portal ID has been set so there is nothing left to do.

0 comments on commit 335fe94

Please sign in to comment.