I'm trying to create a basic proxy server so I can keep track of what my kids are doing web wise - I know there are products out there but I thought it would be an interesting exercise to write one myself.
I have the following code that kind of works but doesn't pull any images or css through - I guess because it makes another call to the remote server and gets confused
<cfhttp url="https://www.bbc.co.uk">
<cfhttpparam type="header" name="Proxy-Connection" value="keep-alive" >
<cfhttpparam type="header" name="Accept" value="application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5">
<cfhttpparam type="header" name="Accept-Language" value="en-US,en;q=0.8">
<cfhttpparam type="header" name="Accept-Charset" value="ISO-8859-1,utf-8;q=0.7,*;q=0.3">
</cfhttp>
<cfset html = cfhttp.FileContent />
<cfoutput>#html#</cfoutput>`
What am I missing?
What you want to use is the resolveurl parameter of - set it to yes/true. This defaults to no.
What this parameter does is resolves relative paths to absolute paths automatically for you.
Now, if you want to change those paths as well, you would change them to also route through your http proxy script, but there won't be much use as you won't know much about the content regardless.
resolveurl should hook you up with what you are looking for. cheers.
https://cfdocs.org/cfhttp (look for resolveurl tag attribute)
I've been trying to develop an AUTOSAR 4.2.1 module to generate code using Xpand/Xtend. I'm using artext demonstrator 1.6.0. But my query is that the concept of defining a variation point is not found in the PDF(ECUConfigurationParameters.arxml) when I create a new Ecu platform project in the demonstrator (or maybe I'm not familiar with finding out how).
By default I'm able to fetch parameter values from an arxml. But when there is more than one value for a parameter which is defined in a different post build variant condition, I'm getting only the first value.
For example, if the arxml contains this
<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>1</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>1</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>
<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>2</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>0</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>
it gives me value as 'true' in Xpand if I do Com.ComConfig.ComIpdus.ComIPduCancellationSupport. I’m unable to access the second value ‘false’.
How may I proceed to fetch the parameter values based on the post-build variant conditions?
I'm trying to do the following:
«DEFINE Gen1 FOR varianthandling::VariationPoint»
«EXPAND Gen1::GetThings»
«ENDDEFINE»
«DEFINE GenMain FOR AUTOSAR::EcucDefs::Com»
«EXPAND Gen1 FOR varianthandling::VariationPoint»
«ENDDEFINE»
This gives me an error as 'Couldn't find definition ComOtherVarGen for type xpand2::Type'. How do I achieve the above?
Please note that I am not trying to add/modify any functionality to the template of 'MainObj' so 'AROUND' is not what I'm looking for.
Any help is greatly appreciated.
The tool which you are using to create the model (which is created from the PDF file + EcuC Values file) must be able to build a model which is post-build compatible.
If you are sure, this being done- Then try the below method
Com.ComConfig.ComIpdus.ComIPduCancellationSupport changes to
<FOREACH Com.ComConfig.ComIpdus.ComIPduCancellationSupport AS ele>
<ele>
<ENDFOREACH>
or
Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(0)
Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(1)
I am wanting to run a standard script task in package level events (OnError, OnPreExecute, OnPostExecute) for logging.
Ideally I would like to be able to just copy and paste the Script task, but it needs to know the Event that it is running inside of. Currently I pass that in as a use variable, but this means that I need to manually set the variable to store the name of the event. That's not too arduous, but it is easily forgotten. Thus my question is, is there a performant way to detect which event the script task is running within.
My suspicion is that this is not easy as essentially this is the same as finding out the name of the parent container, which turns out to be next to impossible.
Another option is to be able to sniff the scope of standard event variables, such as 'EventHandlerStartTime', but I can't find a way to determine the scope of a variable from within the script task.
Any help is much appreciated.
Since #Mark mentioned Biml, I thought I'd take a moment to explode out the concept of using some very basic concepts to make this happen.
Assuming I had a pathetic logging table like
CREATE TABLE
dbo.DoWhat
(
PackageName nvarchar(150) NULL
, ParentContainerGUID varchar(38) NULL
, SourceDescription nvarchar(1000) NULL
, SourceName nvarchar(150) NULL
, SourceParentGUID varchar(38) NULL
, EventName varchar(20) NULL
);
then I could define a "function" in a file called inc_events.biml
What that says, this file expects a parameter of type string that will populate the eventName variable. I then use a classic ASP style syntax for subbing in that value <#=eventName#>
So, this biml will create an Event. That event has a Variable named WhereAmI that is scoped to the Event. I then have an Execute SQL Task in there that does an insert into the logging table passing along System variables and my local variable name.
You're looking to use a Script Task so you'd replace the Execute SQL Task but the concept is the same. There's a something in there that's going to use our local variable that had the event's name assigned to it.
<## property name="eventName" type="String" #>
<Event EventType="<#=eventName#>" ConstraintMode="Linear" Name="<#=eventName#>">
<Variables>
<Variable DataType="String" Name="WhereAmI"><#=eventName#></Variable>
</Variables>
<Tasks>
<ExecuteSQL ConnectionName="tempdb" Name="SQL Log notes">
<VariableInput VariableName="User.QueryLog"></VariableInput>
<Parameters>
<Parameter DataType="String" VariableName="System.PackageName" Name="0" />
<Parameter DataType="AnsiString" VariableName="System.ParentContainerGUID" Name="1" DataTypeCodeOverride="129" />
<Parameter DataType="String" VariableName="System.SourceDescription" Name="2" />
<Parameter DataType="String" VariableName="System.SourceName" Name="3" />
<Parameter DataType="AnsiString" VariableName="System.SourceParentGUID" Name="4" DataTypeCodeOverride="129" />
<Parameter DataType="AnsiString" VariableName="User.WhereAmI" Name="5" DataTypeCodeOverride="129" />
</Parameters>
</ExecuteSQL>
</Tasks>
</Event>
Using the include file
I add a second Biml file, so_27378254_inc.biml to my project. This one is going to demonstrate how we use the function/include file.
I define an OLE DB database connection in Connections collection called tempdb
In my Packages collection, I define a new package called so_27378254_inc. It has a Variable, QueryLog which just contains the format for an insert statement into my log table.
In the package's Events collection, I then invoke CallBimlScript 3 times, one for each Event Handler I want to add at the package level scope.
Into the Tasks collection, I add a Sequence Container just so I can get some variety in my log.
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<OleDbConnection Name="tempdb" ConnectionString="Data Source=localhost\dev2014;Initial Catalog=tempdb;Provider=SQLNCLI10.1;Integrated Security=SSPI;" />
</Connections>
<Packages>
<Package ConstraintMode="Linear" Name="so_27378254_inc">
<Variables>
<Variable DataType="String" Name="QueryLog">
<![CDATA[INSERT INTO
dbo.DoWhat
(
PackageName
, ParentContainerGUID
, SourceDescription
, SourceName
, SourceParentGUID
, EventName
)
SELECT
? /* AS PackageName */
, ? /* AS ParentContainerGUID */
, ? /* AS SourceDescription */
, ? /* AS SourceName */
, ? /* AS SourceParentGUID */
, ? /* AS EventName */
;]]>
</Variable>
</Variables>
<Events>
<#=CallBimlScript("inc_events.biml", "OnError")#>
<#=CallBimlScript("inc_events.biml", "OnPreExecute")#>
<#=CallBimlScript("inc_events.biml", "OnPostExecute")#>
</Events>
<Tasks>
<Container Name="SEQC Container on Control Flow" ConstraintMode="Linear">
</Container>
</Tasks>
</Package>
</Packages>
</Biml>
So, what do you do with it? You right click on the so_27378254_inc.biml file and whoosh, a new package is generated.
How the heck do I sell this?
You mention in your comments, and rightfully so, concerns over anything that would "add friction to adoption".
My counter to that is
BIDS Helper is free and if you're not using it, you're not being as effective in your delivery as you could be. Especially pre-2012, there's just too many sharp edges in the product.
Using an approach like this will get everyone to a consistent starting point, without some of the hassles that come with template packages (IDs are not automatically updated until 2012)
You don't have to go all in on the Biml approach. Assuming you're the architect/lead developer, use it to define best practices. Everyone has logging turned on, apply configurations, get the standard connections defined, etc. All people have to do is instead of creating new SSIS, they right click and generate the template package and then rename it to something appropriate and they're off the races worrying about data flows and file acquisition, etc.
I'm trying to load em spots using massload. I'm finding the internal alias method of idresgen.bat is only resolving the internal alias for foreign key references, but I need to use the value in dmelementnvp value column which doesn't have a foreign key reference.
In the sample code below the last dmelementnvp definition is rejected with an error that value could not be resolved. Does anyone know how to resolve the emspot id to populate the value column required?
<emspot
emspot_id="#emspot_id_1"
storeent_id="&MAR_STOREENT_ID;"
name="Home_BestSellers"
description="Display catalog entry recommendations from Coremetrics Intelligent Offer on the home page."
usagetype="MARKETING"
supportedtypes="P"
/>
<dmactivity
dmactivity_id="#dmactivity_bestseller1"
storeent_id="&MAR_STOREENT_ID;"
name="HomePageBestSellersActivity"
description="The test activity for the home page best sellers"
published="1"
state="1"
behavior="1"
dmcampaign_id="#campaign_initial_launch"
/>
<dmelement
dmelement_id="#dmactivity_bestseller_elem1"
name="Flow0.0"
dmeletemplate_id="6"
dmactivity_id="#dmactivity_bestseller1"
sequence="0"
/>
<dmelement
dmelement_id="#dmactivity_bestseller_elem2"
name="Coremetrics Target"
dmeletemplate_id="339"
dmactivity_id="#dmactivity_bestseller1"
sequence="1500"
parent="Flow0.0"
/>
<dmelement
dmelement_id="#dmactivity_bestseller_elem3"
name="Espot Target"
dmeletemplate_id="105"
dmactivity_id="#dmactivity_bestseller1"
sequence="1000"
parent="Flow0.0"
/>
<dmelementnvp
dmelement_id="#dmactivity_bestseller_elem2"
name="zoneIdList"
value="ZoneA"
/>
<dmelementnvp
dmelement_id="#dmactivity_bestseller_elem3"
name="emsId"
value="#emspot_id_1"
/>
I would ask this question to IBM Software Support.
I'm developing a magento script to import products from a XML file using the API and a SOAP wsdl connection.
I would like to know the faultcode list, I've been searching it for several days without luck, anyone know if there is one at all and where I can find it?
I need to handle the error codes to avoid the code to stop instead of just skipping the errors and continue importing what is correct.
At the moment I just discovered that the faultcode 101 is "Product not exists.".
Here's how to grab the list for your version of Magento. (I can't imagine this would be radically different between versions, but one never knows what's been done to a system)
Find all your api.xml files.
$ find app/code/core -name 'api.xml'
app/code/core/Mage/Api/etc/api.xml
app/code/core/Mage/Catalog/etc/api.xml
app/code/core/Mage/CatalogInventory/etc/api.xml
app/code/core/Mage/Checkout/etc/api.xml
app/code/core/Mage/Core/etc/api.xml
app/code/core/Mage/Customer/etc/api.xml
app/code/core/Mage/Directory/etc/api.xml
app/code/core/Mage/Downloadable/etc/api.xml
app/code/core/Mage/GiftMessage/etc/api.xml
app/code/core/Mage/Sales/etc/api.xml
app/code/core/Mage/Tag/etc/api.xml
Each file will have one or many <faults/> nodes which will contain the code and message.
<!-- File: app/code/core/Mage/CatalogInventory/etc/api.xml -->
<faults module="cataloginventory">
<not_exists>
<code>101</code>
<message>Product not exists.</message>
</not_exists>
<not_updated>
<code>102</code>
<message>Product inventory not updated. Details in error message.</message>
</not_updated>
</faults>
It's probably worth mentioning that the numeric codes aren't unique. Each "soap object" (unsure what to call these) defines its own.
<!-- File: app/code/core/Mage/Sales/etc/api.xml -->
<faults module="sales">
<not_exists>
<code>100</code>
<message>Requested order not exists.</message>
</not_exists>
<filters_invalid>
<code>101</code>
<message>Invalid filters given. Details in error message.</message>
</filters_invalid>
Good luck!