[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-client-cvs
Subject:    [Client-cvs] encodesvc/common/tokenreplacer/pub
From:       tburton () helixcommunity ! org
Date:       2010-01-27 8:53:31
Message-ID: 201001270854.o0R8sxPI006336 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/client/encodesvc/common/tokenreplacer/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv21120/pub

Modified Files:
      Tag: PRODUCER_13_0_RN
	hxtbagtokenreplacer.h hxtjobtokenreplacer.h 
Added Files:
      Tag: PRODUCER_13_0_RN
	hxtelementtokenreplacer.h 
Log Message:
Description: Fixed Bug 256585: Producer treats output filenames containing 
substitution vars as relative and prepends working dir
================================================
The problem here was that HXBuildInstanceAfterTransformFromBuffer was 
returning HXR_FAIL if a file destination was invalid 
(i.e. Filename=“%InputFilePath%/test.rm”). This result was then used to tell 
the cli or activex that the job was invalid.

The solution was to do token substitution in deserializeJobFromBuffer and 
deserializeJob.
- These two functions are called when HXBuildInstanceFromFile and 
HXBuildInstanceFromBuffer are called.
- Each function has a CHXTElement (xml element)
- Add JobFile to the CHXTElement in deserializeJob (from file).
- Do token substitution on each CHXTElement with a new token replacer.
- Let the ReadEncodingJob create the encoding job from the CHXTElement 
that has substitution.


Description: Fixed Bug 256913: 
Remove job filename argument from StartEncoding function.
================================================
Job filename was provided to StartEncoding because the token replacer in 
StartEncoding needed to know the job file path to do substitution. To provide 
this, I was passing job filename to start encoding and then to the token 
replacer. This was not a good fix because of bug 256585 preventing job creation
 and StartEncoding was a common function that should not need job filename. 
 A new fix was to add the job filename to the encoding job. 
This fix required the following:
1) Add JobFile to the job xsd
2) Remove the job filename from StartEncoding calls (remove old fix)
3) Insert the job filename into the encoding job
4) Have the gui insert JobFile into the job buffer (Dura did this)
5) Handle JobFile similar to JobName. This includes passing on it in 
OnSetString calls.
 

Files Changed:
================================================ 
client/encodesvc/activex/ctrl/ProducerCtrl.cpp
producerapps/cmdproducer/session.cpp
client/encodesvc/common/util/hxccfhelper.cpp
client/encodesvc/include/ihxtconstants.h
client/encodesvc/include/ihxtencodingjob.h
client/encodesvc/engine/encsession/encodingjob.cpp
client/encodesvc/engine/encsession/encodingjob.h
client/encodesvc/engine/encsession/jobserial.cpp
client/encodesvc/engine/encsession/settingsadvisor.cpp
client/encodesvc/common/tokenreplacer/Umakefil
client/encodesvc/common/tokenreplacer/hxtbagtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/hxtjobtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/pub/hxtbagtokenreplacer.h
client/encodesvc/common/tokenreplacer/pub/hxtjobtokenreplacer.h
producerapps/installer/root/xmlschemas/job.3.0.xsd
 

Files Added:
================================================ 
client/encodesvc/common/tokenreplacer/hxtelementtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/pub/hxtelementtokenreplacer.h


Branches:
================================================
13_0, HEAD

Index: hxtbagtokenreplacer.h
===================================================================
RCS file: /cvsroot/client/encodesvc/common/tokenreplacer/pub/hxtbagtokenreplacer.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- hxtbagtokenreplacer.h	8 Jan 2010 11:03:10 -0000	1.1
+++ hxtbagtokenreplacer.h	27 Jan 2010 08:53:27 -0000	1.1.2.1
@@ -47,7 +47,7 @@
 {
 public:
 
-	HXTBagTokenReplacer(IHXTPropertyBag* pBag, IHXValues* pValues);
+	HXTBagTokenReplacer(IHXTPropertyBag* pBag, IHXValues* pValues, IHXCommonClassFactory* pFactory);
 	~HXTBagTokenReplacer();
 
     /****************************************************************
@@ -118,7 +118,10 @@
 	mapTimeValues m_mapTimeValues;
 
 	// For utility functions
-	HXTTokenReplacerUtils m_pAdvisorUtils;
+	HXTTokenReplacerUtils m_AdvisorUtils;
+
+    // Factory
+    IHXCommonClassFactory* m_pFactory;
 
 };
 

Index: hxtjobtokenreplacer.h
===================================================================
RCS file: /cvsroot/client/encodesvc/common/tokenreplacer/pub/hxtjobtokenreplacer.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- hxtjobtokenreplacer.h	15 Jan 2010 05:03:54 -0000	1.1.2.1
+++ hxtjobtokenreplacer.h	27 Jan 2010 08:53:27 -0000	1.1.2.2
@@ -47,7 +47,7 @@
 {
 public:
 
-	HXTJobTokenReplacer(IHXTEncodingJobPtr spJob, IHXValues* pValues, IHXCommonClassFactory* pFactory);
+	HXTJobTokenReplacer(IHXTEncodingJobPtr spJob, IHXCommonClassFactory* pFactory);
 	~HXTJobTokenReplacer();
 
     /****************************************************************
@@ -112,10 +112,10 @@
 	mapTimeValues m_mapTimeValues;
 
 	// For utility functions
-	HXTTokenReplacerUtils m_pAdvisorUtils;
+	HXTTokenReplacerUtils m_AdvisorUtils;
 
 	// Factory
-	IHXCommonClassFactory* m_spFactory;
+	IHXCommonClassFactory* m_pFactory;
 
 };
 

--- NEW FILE: hxtelementtokenreplacer.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef __HXTELEMENTTOKENREPLACER__H
#define __HXTELEMENTTOKENREPLACER__H

#include "ihxttokenreplacer.h"
#include "hxttokenreplacerutils.h"

#include "hxtxmlparser.h"



class HXTElementTokenReplacer : 
    public IHXTTokenReplacer
{
public:

    HXTElementTokenReplacer(const CHXTElement& elemEncodingJob, IHXCommonClassFactory* pFactory);
    ~HXTElementTokenReplacer();

    /****************************************************************
    *   For each output filename and known metadata, this function
    *   will call GetReplacement(). GetReplacement() tokenizes the
    *   string for individual token substitutiton.
    *****************************************************************/
    STDMETHOD_(HX_RESULT, ReplaceTokens)();

    /****************************************************************
    *   Helper function for ReplaceTokens(). Works on metadata.
    *****************************************************************/
    STDMETHOD_(HX_RESULT, ReplaceMetadataTokens)(/*in*/const CHXTElement& elemMetadata);

    /****************************************************************
    *   Takes an input string, tokenizes it based on a token character,
    *   calls GetTokenValue on each token, then returns the replacement 
    *   text
    *****************************************************************/
    STDMETHOD_(HX_RESULT, GetReplacement)(/*in*/REF(CHXString) sInput, 
                                          /*out*/REF(CHXString) sOutput);

    /****************************************************************
    *   Accepts a single token from within a full replacement string
    *   and finds the replacement value.
    *   For example, "YYYY" sInputToken results in "2009" sOutputToken.
    *
    *   Environment variables take priority over other replacements.
    *****************************************************************/
    STDMETHOD_(HX_RESULT, GetTokenValue)(/*in*/REF(CHXString) sInputToken, 
                                         /*out*/REF(CHXString) sOutputToken);

    /****************************************************************
    *   Helper function for GetTokenValue.
    *   Takes in type of time substitution (i.e. kYearYYYY) 
    *   and the output token. 
    *****************************************************************/
    STDMETHOD_(HX_RESULT, GetTimeTokenValue)(/*in*/const char* szTimeType, 
                                             /*out*/REF(CHXString) sOutputToken);

    /****************************************************************
    *   Gets the rounded value for a UINT given the job variable
    *   needing rounding.
    *****************************************************************/
    STDMETHOD_(HX_RESULT, GetRoundedUINT)(/*in*/CHXString sType, 
                                          /*out*/UINT32* uiValue);

    /****************************************************************
    *   Strips unnecessary leading and trailing zeros off of the 
    *   CHXString source.
    *****************************************************************/
    STDMETHOD_(HX_RESULT, StripUnnecessaryZeros)(/*out*/REF(CHXString) sValue);

private:

    
    
    // Job object
    const CHXTElement& m_elemEncodingJob;

    // For values needed that are not available in the job
    IHXValues* m_pValues;

    // For environment variables
    std::vector<CHXString> m_vEnvVars;

    // For a mapping of time values (i.e. month token to month value).
    mapTimeValues m_mapTimeValues;

    // For utility functions
    HXTTokenReplacerUtils m_AdvisorUtils;

    // Factory
    IHXCommonClassFactory* m_pFactory;

};

#endif


_______________________________________________
Client-cvs mailing list
Client-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/client-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic