Scarab commit: svn commit: r10719 - trunk/src: conf/classes conf/conf schema sql/upgrade webapp/WEB-INF/templates/layouts webapp/WEB-INF/templates/layouts/help webapp/WEB-INF/templates/screens/admin/globalAttributeEdit webapp/WEB-INF/templates/viewIssue webapp/skins

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-05-12 09:51:30-0700
New Revision: 10719

Added:
   trunk/src/webapp/skins/custom.css
Modified:
   trunk/src/conf/classes/ScarabBundle_de.properties
   trunk/src/conf/classes/ScarabBundle_en.properties
   trunk/src/conf/conf/intake.xml
   trunk/src/schema/scarab-schema.xml
   trunk/src/sql/upgrade/upgrade-0.23-attribute.sql
   trunk/src/webapp/WEB-INF/templates/layouts/Default.vm
   trunk/src/webapp/WEB-INF/templates/layouts/help/Default.vm
   trunk/src/webapp/WEB-INF/templates/screens/admin/globalAttributeEdit/GlobalAttributeProperties.vm
   trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm

Log:
SCB2834:

- Added a preliminary solution.
Basically a new attribute field named "style" can be filled with css-information. IN order to provide more flexibility, i have not
tied the field to 'style' or 'class' respcetively. But i allow as input:

style='color:red;'
class='status'

or combinations. Please do NOT use double quotes!!!

- Added a new file skins/custom.css. This file should be empty (currently it is not!) and it should be generated from the builder. So this file will be removed again when this feature is fully implemented.

- Added l10n entries for the new style field:
  DisplayStyle and
  DisplayStyleExplained

- updated the upgrade-0.23-attribute.sql for the database update
- updated scarab schema and intake for the new field
- updated the templates

Modified: trunk/src/conf/classes/ScarabBundle_de.properties
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/conf/classes/ScarabBundle_de.properties?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/conf/classes/ScarabBundle_de.properties	(original)
+++ trunk/src/conf/classes/ScarabBundle_de.properties	2009-05-12 09:51:30-0700
@@ -197,7 +197,8 @@
 FormatHintExplained�ispielwert, als Default verwendet falls Eingabe leer
 DisplaySize=Display Size
 DisplaySizeExplained=Größe des Eingabefeldes (Nicht die interne Feldlänge!)
-
+DisplayStyle=Display Attribute
+DisplayStyleExplained=Extra Attribute (style='...'  oder class='...'. Achtung nur einfache  "'" verwenden!)
 ## Email generation specific strings
 AutomaticIssue=Automatisches Ticket
 Modification=Änderung

Modified: trunk/src/conf/classes/ScarabBundle_en.properties
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/conf/classes/ScarabBundle_en.properties?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/conf/classes/ScarabBundle_en.properties	(original)
+++ trunk/src/conf/classes/ScarabBundle_en.properties	2009-05-12 09:51:30-0700
@@ -217,6 +217,8 @@
 FormatHintExplained=example string will be used as default, if field is empty
 DisplaySize=Display Size
 DisplaySizeExplained=visible field size (not internal field length!)
+DisplayStyle=Display Attribute
+DisplayStyleExplained=Extra Attribute (style='...'  or class='...'. NOTE: use only single quotes "'" !)

 ## Email generation specific strings
 AutomaticIssue=Automatic Issue

Modified: trunk/src/conf/conf/intake.xml
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/conf/conf/intake.xml?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/conf/conf/intake.xml	(original)
+++ trunk/src/conf/conf/intake.xml	2009-05-12 09:51:30-0700
@@ -25,6 +25,9 @@
             <rule name="minLength" value="1">intake_AttributeNameNotAllowedEmpty</rule>
             <rule name="maxLength" value="255">intake_AttributeNameMustBeLessThan255Characters</rule>
         </field>
+        <field name="Style" key="style" type="String">
+            <rule name="maxLength" value="255">intake_AttributeFormatMustBeLessThan255Characters</rule>
+        </field>
         <field name="Format" key="format" type="String">
             <rule name="maxLength" value="255">intake_AttributeFormatMustBeLessThan255Characters</rule>
         </field>

Modified: trunk/src/schema/scarab-schema.xml
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/schema/scarab-schema.xml?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/schema/scarab-schema.xml	(original)
+++ trunk/src/schema/scarab-schema.xml	2009-05-12 09:51:30-0700
@@ -130,6 +130,7 @@
 	<table name="SCARAB_ATTRIBUTE" idMethod="idbroker" javaName="Attribute" description="Possible attributes of an issue. Example: Operating System. Example: Severity">
 		<column name="ATTRIBUTE_ID" primaryKey="true" required="true" type="INTEGER" description="Unique identifier."/>
         <column name="ATTRIBUTE_NAME" javaName="Name" required="true" type="VARCHAR" size="255" description="Name."/>
+		<column name="STYLE" javaName="Style" required="false" type="VARCHAR" size="255" description="optional string added as markup for css class or style information"/>
         <column name="FORMAT" javaName="Format" required="false" type="VARCHAR" size="255" description="An optional Format String."/>
         <column name="HINT" javaName="Hint" required="false" type="VARCHAR" size="255" description="An optional Hint string for the Format."/>
         <column name="FIELDSIZE" javaName="FieldSize" required="true" type="INTEGER" description="Maximum size of Display field"/>

Modified: trunk/src/sql/upgrade/upgrade-0.23-attribute.sql
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/sql/upgrade/upgrade-0.23-attribute.sql?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/sql/upgrade/upgrade-0.23-attribute.sql	(original)
+++ trunk/src/sql/upgrade/upgrade-0.23-attribute.sql	2009-05-12 09:51:30-0700
@@ -1,10 +1,15 @@
 /*
- * Added Attribute Format Field size and Hinted field (release 0.23)
+ * Added more fields (release 0.23)
+ * Style     : used as style and or class markup for display
+ * Format    : regular expression which the input must conform too
+ * Field size: size of displayfield (not field length!)
+ * Hint      : example input as viusal hint for user entries
  *
  * Creates the fields that support the enhanced formatting capabilities
  * of user defined Attributes
  *
  */
+ALTER TABLE SCARAB_ATTRIBUTE ADD ( STYLE VARCHAR(255) );
 ALTER TABLE SCARAB_ATTRIBUTE ADD ( FORMAT VARCHAR(255) );
 ALTER TABLE SCARAB_ATTRIBUTE ADD ( HINT VARCHAR(255) );
 ALTER TABLE SCARAB_ATTRIBUTE ADD ( FIELDSIZE INTEGER );

Modified: trunk/src/webapp/WEB-INF/templates/layouts/Default.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/layouts/Default.vm?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/webapp/WEB-INF/templates/layouts/Default.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/layouts/Default.vm	2009-05-12 09:51:30-0700
@@ -14,6 +14,7 @@
       <meta http-equiv="refresh" content="$updateFrequency" />
     #end
     <link rel="stylesheet" type="text/css" href="$staticLink.setPath("/skins/classic.css")" />
+    <link rel="stylesheet" type="text/css" href="$staticLink.setPath("/skins/custom.css")" />

     <script src="$staticLink.setPath("/scripts/debug.js")" type="text/javascript"></script>
     <script src="$staticLink.setPath("/scripts/inputs.js")" type="text/javascript"></script>

Modified: trunk/src/webapp/WEB-INF/templates/layouts/help/Default.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/layouts/help/Default.vm?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/webapp/WEB-INF/templates/layouts/help/Default.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/layouts/help/Default.vm	2009-05-12 09:51:30-0700
@@ -7,6 +7,7 @@
   <title>$page.Title</title>
   <meta http-equiv="Content-type" content="$data.ContentType" />
   <link rel="stylesheet" type="text/css" href="$staticLink.setPath("/skins/classic.css")" />
+  <link rel="stylesheet" type="text/css" href="$staticLink.setPath("/skins/custom.css")" />
  </head>
  <body class="docs" onload="self.focus()">
   $renderer.render("screens", $template)

Modified: trunk/src/webapp/WEB-INF/templates/screens/admin/globalAttributeEdit/GlobalAttributeProperties.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/screens/admin/globalAttributeEdit/GlobalAttributeProperties.vm?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/webapp/WEB-INF/templates/screens/admin/globalAttributeEdit/GlobalAttributeProperties.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/screens/admin/globalAttributeEdit/GlobalAttributeProperties.vm	2009-05-12 09:51:30-0700
@@ -62,6 +62,23 @@


           #* ================================================================ *#
+          #* FIELD STYLE                                                     *#
+          #* ================================================================ *#
+          <tr>
+            <th>$l10n.DisplayStyle</th>
+            <td>
+              #if(!$immutable)
+                <input type="text" name="$attgroup.Style.Key" value="$!attgroup.Style" />
+              #else
+                <input type="hidden" name="$attgroup.Style.Key" value="$!attgroup.Style" />
+                $!attgroup.Name
+              #end
+            </td>
+            <td>$l10n.DisplayStyleExplained</td>
+          </tr>
+
+
+          #* ================================================================ *#
           #* FIELD FORMAT                                                     *#
           #* ================================================================ *#
           <tr>

Modified: trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm?view=diff&pathrev719&r1718&r2719
=============================================================================--- trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm	2009-05-12 09:51:30-0700
@@ -67,6 +67,8 @@
               #elseif ($attVal.isSet())
                 #set ($display = true)
                 #set ($isOptionAttr = $attVal.Attribute.isOptionAttribute())
+                #set ($fieldStyle = "")
+                #set ($fieldStyle = $!attVal.Attribute.Style)
                 #if ($isOptionAttr)
                   #if ($attVal.AttributeOption.Deleted.toString().equals("true"))
                     #set ($display = false)
@@ -75,7 +77,7 @@
                 #if ($display)
                   <tr>
                     <th>$attVal.RModuleAttribute.DisplayValue</th>
-                    <td>
+                    <td $fieldStyle >
                       #set ($attrInput = $intake.AttributeValue.mapTo($attVal))

                       ## Output the value of the attribute. How this is done

Added: trunk/src/webapp/skins/custom.css
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/skins/custom.css?view=markup&pathrev719
=============================================================================--- (empty file)
+++ trunk/src/webapp/skins/custom.css	2009-05-12 09:51:30-0700
@@ -0,0 +1,16 @@
+/*
+   This file contains custom classes. Classes specified here override
+   scarab default settings. Data in this file is considered as testdata
+   only and can safely be removed.
+
+   NOTE: This is work in progress. The final custom css file will probably be
+   located elsewhere !(Hussayn, May-2009)
+*/
+
+/* attribute specific classes */
+
+.status {
+ color:#d61a1e;
+ font-weight:bold;
+}
+
\ No newline at end of file

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2217339
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.