Author: sevein
Date: Mon Oct 17 15:51:32 2011
New Revision: 10126

Log:
Add personalized error doc and show summary only if is set

Added:
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorNotImplementedSuccess.xml.php
Modified:
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorBadRequestSuccess.xml.php
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorChecksumMismatchSuccess.xml.php
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorContentSuccess.xml.php
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorMaxUploadSizeExceeded.xml.php
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/MediationNotAllowedSuccess.xml.php
   
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/TargetOwnerUnknown.xml.php

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorBadRequestSuccess.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorBadRequestSuccess.xml.php
    Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorBadRequestSuccess.xml.php
    Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorChecksumMismatchSuccess.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorChecksumMismatchSuccess.xml.php
      Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorChecksumMismatchSuccess.xml.php
      Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorContentSuccess.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorContentSuccess.xml.php
       Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorContentSuccess.xml.php
       Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorMaxUploadSizeExceeded.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorMaxUploadSizeExceeded.xml.php
        Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorMaxUploadSizeExceeded.xml.php
        Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

Added: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorNotImplementedSuccess.xml.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/ErrorNotImplementedSuccess.xml.php
        Mon Oct 17 15:51:32 2011        (r10126)
@@ -0,0 +1,20 @@
+<?php echo '<?xml version="1.0" encoding="'.sfConfig::get('sf_charset', 
'UTF-8').'" ?>' ?>
+<sword:error href="http://purl.org/net/sword/error/ErrorNotImplemented";
+             xmlns="http://www.w3.org/2005/Atom";
+             xmlns:sword="http://purl.org/net/sword/";>
+
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
+
+  <title type="text">ERROR</title>
+
+  <updated><?php $dt = new DateTime(); echo $dt->format('c'); ?></updated>
+
+  <generator uri="<?php echo url_for('@homepage', true) ?>" version="<?php 
echo qubitConfiguration::VERSION ?>">Qubit <?php echo 
qubitConfiguration::VERSION ?></generator>
+
+  <sword:userAgent><?php echo $_SERVER['HTTP_USER_AGENT'] ?></sword:userAgent>
+
+  <link rel="alternate" 
href="http://www.qubit-toolkit.org/wiki/index.php?title=SWORD"; 
type="text/html"/>
+
+</sword:error>

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/MediationNotAllowedSuccess.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/MediationNotAllowedSuccess.xml.php
        Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/MediationNotAllowedSuccess.xml.php
        Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

Modified: 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/TargetOwnerUnknown.xml.php
==============================================================================
--- 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/TargetOwnerUnknown.xml.php
        Mon Oct 17 15:44:57 2011        (r10125)
+++ 
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/templates/error/TargetOwnerUnknown.xml.php
        Mon Oct 17 15:51:32 2011        (r10126)
@@ -3,7 +3,9 @@
              xmlns="http://www.w3.org/2005/Atom";
              xmlns:sword="http://purl.org/net/sword/";>
 
-  <summary type="text"><?php echo $summary ?></summary>
+  <?php if isset($summary): ?>
+    <summary type="text"><?php echo $summary ?></summary>
+  <?php endif; ?>
 
   <title type="text">ERROR</title>
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to