MSDeploy SetParameters.xml create empty value - publish

So my question is relatively simple.
In my Parameters.xml file I have the following line:
<parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags="">
<parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[#key='SEND_TO_FRIEND_BCC']/#value" />
</parameter>
When publish this is creating a file that ends up like this:
<setParameter value="" name="SEND_TO_FRIEND_BCC" />
When going live, this should replace the current web.config value for SEND_TO_FRIEND_BCC to an empty string. Instead, when I try an publish I get the following:
Error: The 'SEND_TO_FRIEND_BCC" argument cannot be null or empty.
Error count: 1.
at InRelease.MSDeploy.Program.Main(String[] args)

Have to tell MSDeploy that it is okay for the value to be empty ...
<parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags="">
<parameterValidation kind="AllowEmpty" />
<parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[#key='SEND_TO_FRIEND_BCC']/#value" />
</parameter>

So, by pure chance I tried entering a single empty space and it worked.
If there is a better way I am still eager to learn more...

Related

Work Item HTMLFieldControl Content

I am trying to pre-populate some a few different objects in a User Story in my TFS2012 work items list. The HTMLFieldControl is can be found in the Work Item Types section and I can see that it's created here:
<Tab Label="Details">
<Control FieldName="System.Description" Type="HtmlFieldControl" Dock="Fill" />
</Tab>
I've been looking on Google but I just can't seem to find anything around adding text into this field so that it is always available, perhaps I'm just doing something wrong.
Would doing something similar to this give me the results I require? I can't really just try it and potentially break the system (which is unfortunate) so I need some guidance so that I could quickly fix any formatting / spelling without having to roll back any changes.
<Tab Label="Details">
<Control FieldName="System.Description" Type="HtmlFieldControl" Dock="Fill" >
<FIELD name="Description" refname="System.Description" type="Text" Content="Hello there"/>
</Control>
</Tab>
Obviously the above is purely made up (from the FIELD section) but I included here just along the lines of what I was thinking and hopefully to show what I'm trying to do.
You were looking in the wrong place; those are the definitions for the form (aka, how the Work Item is displayed graphically). You need to scroll up to the top, under FIELDS, and find this:
<FIELD name="Description" refname="System.Description" type="HTML" />
...then change it to this:
<FIELD name="Description" refname="System.Description" type="HTML">
<DEFAULT from="value" value="Hello there" />
</FIELD>

php code send a value without showing asking for type definition

if I want to send some value and I do not want to show it on the php screen.
How do i set up for the type for this case??
is it possible to conceal it?
<input type='sometype???' name='eid' value = $myrow[eid] />
which type should I put to conceal from the screen but it will pass to next php file?
This is a really basic question that you could've solved just by Googling, but here you go:
<input type='hidden' name='eid' value='$myrow[eid]'>

Spring Security multiple filterChainProxy mapping/filters, custom filters Json Output

I have a part of my web application that is an RESTfull api and part a more standard web-pages.
I wish to have the REST part with some custom filters such as the EntryPoint, SuccessHandler and FailureHandler. This part is within the /rest/** mapping.
In the other hand, everything else needs to have more common filters and is mapped with /**.
The problem is to find an easy way to define the filterChainProxy with different mapping-filters.
Right now this solution doesn't work:
<!-- Normal web app -->
<http auto-config="true" use-expressions="true" authentication-manager-ref="authenticationManager">
<form-login/>
<logout/>
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
</http>
<!-- Configure RESTfull services -->
<http use-expressions="true" authentication-manager-ref="authenticationManager" entry-point-ref="restAuthenticationEntryPoint" >
<form-login authentication-success-handler-ref="restAuthenticationSuccessHandler" login-page="/rest/login" username-parameter="username" password-parameter="password" />
<logout logout-url="/rest/logout" />
<intercept-url pattern="/rest/**" method="GET" access="hasRole('ROLE_USER')" />
<intercept-url pattern="/rest/**" method="POST" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/rest/**" method="PUT" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/rest/**" method="DELETE" access="hasRole('ROLE_ADMIN')" />
</http>
It complains with: the univseral match being before other patterns.
Is there a way to define such a thing without resorting to define the filterChainProxy with the definition? The http version does help quite a lot to reduce the amount of configuration as I will have to manually set a UsernamePasswordAuthenticationFilter etc.
The next problem is more simple: I have to respond, after the form-login authentication with a JSON object.
So far, I have implemented a SuccessHandler (actually a version of the SimpleUrlAuthenticationSuccessHandler without the redirect part).
How do I write my JSON output?
I must have something like this:
HTTP 200 OK
with:
{"success":true,"customer {"email":"customer#email.com","session_id":"b83a41dfaca6785399f00837888886e646ff9088"}}
and a similar thing with the FailureHandler. It must be quite simple and it's surely is some very basic thing, but how do you do that? Redirecting to a custom controller is not a solution since I will have the 301 redirect status that a very simple REST client might not be able to understand.
At the very least, I wish to have only the http header and no body at all.
thanks!
If you can upgrade to Spring Security 3.1 it supports multiple chains using namespace configuration.

How to parse an .as (AS3) file

I am looking to get as close as I can to parsing out an AS3 file into objects or XML. For instance, imagine the following class:
package {
class SomeClass extends AnotherClass {
private var someVariable:Number
public function someMethod(someParameter:Number = 4):void {
var someLocalVariable:Number = someParameter * (2 + someVariable);
}
}
}
When parsed, it might be something like:
<package name="">
<class id="783" name="SomeClass" extendsId="782">
<variable id="784" visibility="private" type="Number"/>
<function id="785" name="someMethod" returnType="void">
<parameter id="786" name="someParameter" type="Number">
<expression>
<number value="4"/>
</expression>
</parameter>
<variable id="787" name="someLocalVariable" type="Number"/>
<code>
<assign toId="787">
<expression>
<variable id="786"/>
<operator type="*"/>
<expression>
<number value="2"/>
<operator type="+"/>
<variable id="786"/>
</expression>
</expression>
</assign>
</code>
</function>
</class>
</package>
.. even if I don't get a nice, neat xml structure like this, even if it could just parse AS3 to some kind of capacity, it would be way beyond where I am now.
Any thoughts?
Thanks,
Eric
I have actually ported the PMD parser to AS3.
You can check out http://github.com/teotigraphix/as3parser-framework
Mike
FlexPMD has an as3 parser. (FlexPMD is a Java project by Adobe that does reporting of best practices violations in as3 source code.)
FlexPMD is hosted at http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD
The code is on a subversion repo at http://opensource.adobe.com/svn/opensource/flexpmd/trunk
The down side is you would need to use Maven to build FlexPMD (me, I never managed to get it to work), but since you need just one or three projects, it might be possible to extract those by hand without too much cursing and shouting.
You may also want to wander further into the Flex SDK source code (also on opensource.adobe.com) to see if Adobe provides any other software for parsing as3,but I have not looked there.
There's a lexer, parser, and tokenizer in the AS3eval project:
AS3eval
Take a look at the flash.utils.describeType() documentation.
http://livedocs.adobe.com/flex/gumbo/langref/flash/utils/package.html#describeType()
It's for describe actionscript items at runtime, but should have some use in this case.

Windsor Method interception (AOP)

I'm trying to create interceptors for specific methods but I'm having a hard time. I can't bind an aspect to a specific method. I create the faicilities most of examples show but it still doesn't work. Can anyone give me an example of how to do this? I prefer xml conifguration, if possible.
Another question, I have this code:
<component id="SampleAspect"
service="WindsorSample.Aspect.SampleAspect, WindsorSample"
type="WindsorSample.Aspect.SampleAspect, WindsorSample">
</component>
<component id="HtmlTitleRetriever"
type="WindsorSample.DummyObject, WindsorSample">
<parameters>
<interceptors>
<interceptor>${SampleAspect}</interceptor>
</interceptors>
</parameters>
</component>
Then...
IWindsorContainer container = new WindsorContainer(new XmlInterpreter());
IDummyObject retriever = container.Resolve<DummyObject>();
retriever.SomeMethod();
This aspect is not executed. Am I missing something? Am I using the wrong approach for aop?
Thanks
You can only intercept virtual method, you know that, right?