knguyen     2004/08/18 17:39:19 CEST

  Modified files:        (Branch: JAHIA-4-0-BRANCH)
    src/java/org/jahia/services/pages ContentPage.java 
  Log:
  - ContentPage.getPageType() & return staged value if versioning doesn't exist
  
  Revision  Changes    Path
  1.72.2.4  +17 -3     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.3&r2=1.72.2.4&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.3
  retrieving revision 1.72.2.4
  diff -u -r1.72.2.3 -r1.72.2.4
  --- ContentPage.java  3 Aug 2004 13:26:09 -0000       1.72.2.3
  +++ ContentPage.java  18 Aug 2004 15:39:19 -0000      1.72.2.4
  @@ -735,13 +735,27 @@
        */
       public final int getPageType (EntryLoadRequest entryLoadRequest) {
           JahiaPageInfo pageInfo = getPageInfoVersionIgnoreLanguage 
(entryLoadRequest, false);
  -        if (pageInfo == null) {
  -            return -1;
  +
  +        if (pageInfo != null) {
  +            return pageInfo.getPageType ();
           }
  -        return pageInfo.getPageType ();
  +        if ( entryLoadRequest != null && entryLoadRequest.isVersioned() ){
  +            // If there is no versioning entry, we should at least return the type
  +            // of this page as it exist
  +            try {
  +                if ( !this.mPageInfos.isEmpty() ){
  +                    pageInfo = (JahiaPageInfo)this.mPageInfos.iterator().next();
  +                    return pageInfo.getPageType();
  +                }
  +            } catch ( Throwable t ){
  +                logger.debug(t);
  +            }
  +        }
  +        return -1;
       }
   
   
  +
       //-------------------------------------------------------------------------
       /**
        * Return the parent page unique identification number.
  

Reply via email to