Changeset 10660

Show
Ignore:
Timestamp:
03/22/07 16:06:41 (2 years ago)
Author:
bergius
Message:

Using metadata properties for approval. Note the workaround for Exorcist timezone issue

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/tools/staging2live/classes/DateFunctions.java

    r10103 r10660  
    77  public static DateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); 
    88 
    9   public static String timestampFromDate(String date) throws Exception { 
    10       Date d = FORMAT.parse(date + " GMT"); 
     9  public static String timestampFromDate(String date, String timezone) throws Exception { 
     10      Date d = FORMAT.parse(date + " " + timezone); 
    1111      return String.valueOf(d.getTime() / 1000); 
    1212  } 
  • trunk/src/tools/staging2live/staging2live.xslt

    r10134 r10660  
    1313 
    1414  <xsl:template match="mgd:midgard_topic"> 
    15     <xsl:variable name="topic_approved" select="mgd:parameter[mgd:domain='midcom.helper.metadata' and mgd:name='approved']/mgd:value"/> 
    16     <xsl:if test="$topic_approved != ''"> 
    17       <xsl:if test="java:DateFunctions.timestampFromDate($topic_approved) >= java:DateFunctions.timestampFromDate(mgd:revised)"> 
    18           <xsl:copy><xsl:apply-templates/></xsl:copy> 
    19       </xsl:if> 
     15    <!-- Exorcist bug, metadata_revised is in LMT --> 
     16    <xsl:if test="java:DateFunctions.timestampFromDate(mgd:metadata_approved, 'GMT') >= java:DateFunctions.timestampFromDate(mgd:metadata_revised, 'EET')"> 
     17        <xsl:copy><xsl:apply-templates/></xsl:copy> 
    2018    </xsl:if> 
    2119  </xsl:template> 
    2220 
    2321  <xsl:template match="mgd:midgard_article[mgd:up='']"> 
    24     <xsl:variable name="article_approved" select="mgd:parameter[mgd:domain='midcom.helper.metadata' and mgd:name='approved']/mgd:value"/> 
    25     <xsl:if test="$article_approved != ''"> 
    26       <xsl:if test="java:DateFunctions.timestampFromDate($article_approved) >= java:DateFunctions.timestampFromDate(mgd:revised)"> 
    27           <xsl:copy><xsl:apply-templates/></xsl:copy> 
    28       </xsl:if> 
     22    <!-- Exorcist bug, metadata_revised is in LMT --> 
     23    <xsl:if test="java:DateFunctions.timestampFromDate(mgd:metadata_approved, 'GMT') >= java:DateFunctions.timestampFromDate(mgd:metadata_revised, 'EET')"> 
     24        <xsl:copy><xsl:apply-templates/></xsl:copy> 
    2925    </xsl:if> 
    3026  </xsl:template>