Validation rules/Expected inner text in Load Test Project VS 2012 - visual-studio-2012

Is there an option like "contains" or "like" in sql for validating just a fragment of text.
I need to validate just a part of the code that's static, the rest is dynamic.

You could use an extraction rule of type "Extract regular expression" instead of a validation rule, just ensure that the Required property is set to true. Whilst an extraction rule must name a context parameter for saving the text found, there is no need to use that context parameter elsewhere.
Validation rules and extraction rules are very similar in what they do, it is just that extraction rules save the text that is found and, optionally via the Required property, fail or not-fail the test if the text is not-found or found respectively.

Related

ADF web activity output parameter with special character

I'm using ADF Web activity to submit a GET request to the external API.
From the web activity (2) I'm getting the following output:
Now, I want to assign a variable with value of the element that is marked on the screen.
Unfortunately, the following expressioin is invalid:
#activity('Web1').output.ADFWebActivityResponseHeaders.Total-Count
Is looks to me that ADF is not able to parse this expression due to special character ("-") in the name of property I'm trying to extract.
When I use a different expression to access a different parameter:
#activity('Web1').output.ADFWebActivityResponseHeaders.Status
it works.
Do you have any idea how I should write the expression to extract the value of "Total-Count" ?
According to this post ADF retrieves value from field with dash from json file this could work for you, too.
The expression in your case could look like this:
#activity('Web1').output.ADFWebActivityResponseHeaders['total-count']

Add Parameter Values to Query String of get request in ADF

I have a Copy Data task which is obtaining data from an API
The API is a GET call to a method and requires 2 parameters
_token
Symbols
I have defined these as parameters
What is the syntax that allows me to use the values of my parameters as the values that are in the query string? So in the screenshot above Symbols is hard coded, but I want the value to be the value of the parameters
I need a screen solution rather than code please as I am not comfortable with ADF yet and I dont know how to get to the code/ARM views
Paul
Using a feature called string interpolation where expressions are wrapped in #{ ... }
Click on the Base URL field. Add Parameters. Using Concat expression function,
Example:
#{Concat('https://stackoverflow.com/questions/GetRealTimeRates?',linkedService().Symbols,'=',linkedService()._token)}
Add first parameter:
Add second parameter:
Test connection. If you see any error, it would provide a description as to debug further.

Valid xsd:DateTimeStamp Literal value in owl

I have included into my ontology a specific data property which is of type xsd:DateTimeStamp as I am looking into this website which provides examples of supposedly acceptable literal values of that format http://www.datypic.com/sc/xsd11/t-xsd_dateTimeStamp.html
I copy pasted both those literal values suggested into my data property separately :
2004-04-12T13:20:00-05:00
2004-04-12T13:20:00Z
But unfortunately both the hermit and the pellet reasoner whine about an inconsistency there.
Can someone explain to me why this is wrong and provide a valid literal value example that would pass the reasoners ?
I am using the OWLTime ontology and this is the 'in XSD Date-Time-Stamp' data property to be more precise, and the tool I use is protege 5.5.0
Both Data properties are correct, what was needed upon insertion in the box was to select from the drop down type list the "xsd:dateTimeStamp" then the reasoner stopped complaining. Although it is weird because in other custom occasions I did not deal with the same problem

Can custom settings be "passed into" a Contentful UI extension assignment?

Is it possible to pass data into UI extensions assignments (meaning UI Extension X assigned to Field Y), in order to alter their functionality slightly for different situations, without having to reimplement the entire extension?
For example, CodeMirror is a really neat embedded editor, but it has a bunch of "modes," depending on what language you're working with. If we could even pass in a string to represent the desired mode when the extension is assigned to a field, that would remove the need to do a different extension just to use different syntax highlighting.
With this, there could now be a generic "CodeMirror Editor" UI extension which is then just configured a runtime.
On the other end of the extreme, we could specify entire JSON objects when the extension is assigned to a field, to further specify configuration options.
This would make UI extensions so much more...useful. Does this functionality exist now, or is there some way to reasonably make it work? Is there some place on the field specification where I can "park" a JSON string, then access it from inside the extension?
Contentful has launched something called "Configuration parameters" for UI extensions that could be used to solve this issue.
They have two types of parameters, installation and instance parameters. Installation parameters are set when installing the UI extension, and instance parameters are set when configuring a field on a content type to use the extension. The latter would be perfect for your use case.
To use this feature you need to:
Create a parameter definition for the UI extension in the extension.json file. E.g. a new instance parameter called "codeMirrorSettings" of type Symbol with name "CodeMirror Settings".
Within the extension, fetch the current parameters using extensionsApi.parameters.instance.codeMirrorSettings.
Documentation for configuration parameters can be found in Contentful's docs:
https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions/configuration-parameters
https://github.com/contentful/ui-extensions-sdk/blob/master/docs/ui-extensions-sdk-frontend.md#extensionparameters
What you could do is just read this setting from another field, be that a string or a json object.
For example the slug generator automatically generates its value from the title field.
You could perhaps do something like this:
const cfExt = window.contentfulExtension || window.contentfulWidget
cfExt.init(api => {
var langField = api.entry.fields.mirrorLang || 'default'
//Rest of implementation
})
Well, I wrote something for this, specific to my situation, but generalizable to others. This is an example if a UI extension that retrieves settings from another entry in the space, and uses it to dynamically configure itself.
https://github.com/deanebarker/contentful-code-editor

Is there anything that provides the kind of support PHP's filter_var does in ColdFusion?

I've found filter_var to be extremely useful in validating and sanitizing user input with PHP, but I've yet to find anything even remotely as convenient in ColdFusion (more specifically, CF8).
Obviously I can hack together something using REReplace, but that would take significantly more time to code up and would be much uglier than using the pre-defined filters available in PHP. Is there a more efficient way or do I just need to bite the bullet?
There are three different options available to you. Since you're attempting to manage user input, I assume you're using forms. isValid most closely mimics your functionality, allowing you to check if a value specified matches either a data type or a regular expression and returns true or false, and includes attributes by default to define a range. It does not support the ability to create a custom 'filter' beyond defining a regular expression however.
The second option would be using cfparam tags on your POST processing page, which allows you to specify the existance of a variable, test against a data type or define a regular expression, and optionally assign a default value if the variable doesn't exist. If you attempt to process a page where the field is not defined and no default value is assigned however, ColdFusion throws an error.
Finally, you can do validation by using cfform and cfinput fields on your form itself; which allows for client-side data validation for existence and types (it also supports server-side validation but it's implementation is sloppy), regular expressions, and input masking: taking user-inputted data and conforming it to a specific format (like adding dashes to phone numbers and zip codes).

Resources