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

List:       helix-client-cvs
Subject:    [Client-cvs] encodesvc/engine/encsession audserial.cpp,1.8,1.9
From:       vtyagi () helixcommunity ! org
Date:       2010-03-31 4:24:52
Message-ID: 201003310425.o2V4Pj3P013601 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/client/encodesvc/engine/encsession
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv32481

Modified Files:
	audserial.cpp 
Log Message:
Changes to evaluate audiences and server templates in starting

Index: audserial.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encsession/audserial.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- audserial.cpp	1 Dec 2009 21:42:19 -0000	1.8
+++ audserial.cpp	31 Mar 2010 04:24:49 -0000	1.9
@@ -69,6 +69,8 @@
 #include "hxbuffer.h"
 #include "hxheap.h"
 
+#include "hxsettingsadvisorutils.h"
+
 #if defined(_WINDOWS)
 #include "xmlvalidator.h"
 #endif // _WINDOWS
@@ -390,7 +392,80 @@
 
 	if(!bRet)
 	{
-		res = HXR_FAIL;
+            IUnknown* pContext = NULL;
+            res = m_spFactory->QueryInterface(IID_IUnknown, (void**)&pContext);
+            if(SUCCEEDED(res))
+            {
+                const char* pszTempleteType = "audiences";
+                CHXString strTemplateName = "";
+                CHXString strTemplatesDirectory = "";
+                int pos = m_szFilename.ReverseFind('\\');
+                if (pos != -1)
+                {
+                    strTemplateName = m_szFilename.Right(m_szFilename.GetLength() - \
(pos+1)); +                    strTemplatesDirectory = m_szFilename.Left(pos);
+                }
+                // Found invalid audience, Make a settings advisor call and throw \
SA105. +                HXCallSettingsAdvisor(pContext,
+                                    105,
+                                    LC_APP_WARN,
+                                    FILEREAD,
+                                    3,
+                                    "TemplateType",
+                                    eTypeCString,
+                                    pszTempleteType,
+                                    "TemplateName",
+                                    eTypeCString,
+                                    (const char*)strTemplateName,
+                                    "TemplatesDirectory",
+                                    eTypeCString,
+                                    (const char*)strTemplatesDirectory);
+            }
+
+            // Get the number of errors or warnings
+            UINT32 ulNumErrorsOrWarnings = xv.getNumErrorsOrWarnings();
+            // Did we encounter an validation errors or warnings?
+            if (ulNumErrorsOrWarnings > 0)
+            {
+                if(SUCCEEDED(res) && pContext)
+                {
+                    // Loop through each of the errors
+                    for (UINT32 i = 0; i < ulNumErrorsOrWarnings; i++)
+                    {
+                        XercesXMLValidatorErrorType eType     = \
NumXercesXMLValidatorErrorTypes; +                        UINT32                      \
ulLineNum = 0; +                        UINT32                      ulColNum  = 0;
+                        const char*                 pszMsg    = NULL;
+                        if (xv.getErrorOrWarning(i, &eType, &ulLineNum, &ulColNum, \
&pszMsg)) +                        {
+                            // For any schema parsing errors for audiences, Make a \
settings advisor call and throw SA216. +                            \
HXCallSettingsAdvisor(pContext, +                                                216,
+                                                LC_APP_ERROR,
+                                                FILEREAD,
+                                                5,
+                                                "LineNo",
+                                                eTypeUINT32,
+                                                ulLineNum,
+                                                "ColumnNo",
+                                                eTypeUINT32,
+                                                ulColNum,
+                                                "XMLFilename",
+                                                eTypeCString,
+                                                (const char*)m_szFilename,
+                                                "XMLParserError",
+                                                eTypeCString,
+                                                pszMsg,
+                                                "XSDName",
+                                                eTypeCString,
+                                                kValueAudienceXSDFileName);
+                        }
+                    }
+                }
+            }
+            HX_RELEASE(pContext);
+            // As we have failed to validate the audience file So set res to fail.
+            res = HXR_FAIL;
 	}
 	else
 	{	


_______________________________________________
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