Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B1C51C6AC for ; Thu, 20 Jun 2013 14:04:33 +0000 (UTC) Received: (qmail 62375 invoked by uid 500); 20 Jun 2013 14:04:33 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 62262 invoked by uid 500); 20 Jun 2013 14:04:32 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 62250 invoked by uid 99); 20 Jun 2013 14:04:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 14:04:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 14:04:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0342723889BB; Thu, 20 Jun 2013 14:04:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1495009 - /cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java Date: Thu, 20 Jun 2013 14:04:09 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130620140410.0342723889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Jun 20 14:04:09 2013 New Revision: 1495009 URL: http://svn.apache.org/r1495009 Log: ALso need to check the includes in the hasCode() call Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java?rev=1495009&r1=1495008&r2=1495009&view=diff ============================================================================== --- cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java (original) +++ cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java Thu Jun 20 14:04:09 2013 @@ -344,7 +344,22 @@ public class Page extends AbstractPage i } public boolean hasCode() { - return codeTypes == null ? false : !codeTypes.isEmpty(); + if (codeTypes != null && !codeTypes.isEmpty()) { + return true; + } + if (includes != null) { + for (String i : includes) { + try { + Page p = exporter.findPage(i); + if (p != null && p.hasCode()) { + return true; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return false; } public Set getCodeScripts() throws Exception { @@ -368,6 +383,8 @@ public class Page extends AbstractPage i Page p = exporter.findPage(i); if (p != null && p.hasCode()) { scripts.addAll(p.getCodeScripts()); + } else if (p == null) { + System.out.println(" Did not find page " + i); } } catch (Exception e) { e.printStackTrace(); @@ -465,12 +482,21 @@ public class Page extends AbstractPage i state = State.NONE; break; } - case INCLUDE: + case INCLUDE: { if (page.includes == null) { page.includes = new CopyOnWriteArraySet(); } - page.includes.add(params.get("default-parameter")); + String inc = params.get("default-parameter"); + if (inc == null) { + inc = params.get("title"); + } + if (inc == null) { + System.out.println(page.title + ": Did not find an include name " + params); + } else { + page.includes.add(inc); + } break; + } case BLOG_POSTS: page.hasBlog = true; break;