shuber      2004/10/25 19:06:31 CEST

  Modified files:        (Branch: JAHIA-4-0-BRANCH)
    src/java/org/jahia/services/pages ContentPage.java 
  Log:
  Bugfix :
  - In case the DB contains a page link with a value at -1, we put a warning for the 
validation, instead of generation a page not found exception that prevented the 
validation from working at all.
  
  Revision   Changes    Path
  1.72.2.14  +19 -2     jahia/src/java/org/jahia/services/pages/ContentPage.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/services/pages/ContentPage.java.diff?r1=1.72.2.13&r2=1.72.2.14&f=h
  
  
  
  Index: ContentPage.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/src/java/org/jahia/services/pages/Attic/ContentPage.java,v
  retrieving revision 1.72.2.13
  retrieving revision 1.72.2.14
  diff -u -r1.72.2.13 -r1.72.2.14
  --- ContentPage.java  25 Oct 2004 16:22:51 -0000      1.72.2.13
  +++ ContentPage.java  25 Oct 2004 17:06:31 -0000      1.72.2.14
  @@ -73,6 +73,7 @@
   import java.util.*;
   import org.jahia.exceptions.JahiaForbiddenAccessException;
   import org.jahia.bin.Jahia;
  +import org.jahia.exceptions.JahiaPageNotFoundException;
   
   /**
    * <p>Title: ContentPage - all the content for a page</p>
  @@ -3262,8 +3263,24 @@
               JahiaPageInfo curPageInfo = (JahiaPageInfo) pageInfoIter.next ();
               pageType = curPageInfo.getPageType ();
               if (pageType == JahiaPage.TYPE_LINK) {
  -                ContentPage linkedPage = ServicesRegistry.getInstance 
().getJahiaPageService ()
  -                        .lookupContentPage (curPageInfo.getPageLinkID (), true);
  +                ContentPage linkedPage = null;
  +                try {
  +                    ServicesRegistry.getInstance().getJahiaPageService()
  +                        .lookupContentPage(curPageInfo.getPageLinkID(), true);
  +                } catch (JahiaPageNotFoundException jpnfe) {
  +                    linkedPage = null;
  +                    try {
  +                        activationTestResults.appendWarning(new
  +                            IsValidForActivationResults(ContentPageKey.
  +                            PAGE_TYPE,
  +                            getID(),
  +                            curPageInfo.getLanguageCode(),
  +                            "Link doesn't point to a page"));
  +                    } catch (ClassNotFoundException cnfe) {
  +                        logger.debug ("Error while creating activation test node 
result",
  +                                      cnfe);
  +                    }
  +                }
                   if (linkedPage != null) {
                       if (!linkedPage.hasActiveEntries ()) {
                           logger.debug (
  

Reply via email to