I found this mentioned in a few books I have on TFS2010, but the documentation is pretty sparse, and searching on Google and Bing returns nothing I don't already know.
Does anyone have and detailed information on the using CustomActivitiesAndExtensions.xml and how it works?
The CustomActivitiesAndExtensions.xml file is primarily used to specify additional activities and/or workflow extensions to be loaded by the Build Service to support your build process.
Here's an example:
<?xml version="1.0" encoding="utf-8"?>
<Assemblies DownloadListedItemsOnly="true">
<Assembly LoadListedItemsOnly="true" FileName="CustomAssembly.dll" HostEnvironmentOption="All">
<Activities>
<Activity FullName="CustomAssembly.OnAgentActivity" HostEnvironmentOption="Agent"/>
<Activity FullName="CustomAssembly.OnControllerActivity" HostEnvironmentOption="Controller"/>
<Activity FullName="CustomAssembly.OnBothActivity" HostEnvironmentOption="All"/>
</Activities>
<Extensions>
<Extension FullName="CustomAssembly.OnAgentExtension" HostEnvironmentOption="Agent"/>
<Extension FullName="CustomAssembly.OnControllerExtension" HostEnvironmentOption="Controller"/>
<Extension FullName="CustomAssembly.OnBothExtension" HostEnvironmentOption="All"/>
</Extensions>
</Assembly>
</Assemblies>
The DownloadListedItemsOnly attribute is an optimization you can use to only download the assemblies specified in this file and ignore any others.
Lastly, it's important to note that if you specify an assembly beneath the Activities or Extensions element that doesn't actually have an Activity or Extension (as appropriate) that's discoverable via reflection, then that assembly won't be loaded. The most likely case where this would be a problem would be if you implemented the design-time experience for your activity in a separate assembly.
As you you know TFS based on WF so you just need the documentation of how to create WF custom activity, To create a basic custom activity, you inherit from the Activity class or a derived type. To create a custom composite activity, you inherit from the CompositeActivity class or a derived type.
See this link:
Creating Custom Activities
Related
I currently have a package on my class path called MyResources with multiple property files that struts uses. Works great:
<constant name="struts.custom.i18n.resources" value="com.company.MyResources"/>
I am trying to move the properties files to a file location, so they can be updated without having to rebuild the package. Is it possible in Struts 2 to refer to this file location?
For example, my new file location with the properties files is:
/g01/properties/
And I would like Struts to use that location for the resource.
Yes, by providing an implementation of ResourceBundleTextProvider and initializing it in your struts.xml configuration file.
The default implementation, com.opensymphony.xwork2.TextProviderSupport defers the text lookup to com.opensymphony.xwork2.util.LocalizedTextUtil.
There are a number of ways to go about this, but if you don't need any of the default S2 behavior, here's the place to start:
<bean type="com.opensymphony.xwork2.TextProvider" name="struts"
class="com.opensymphony.xwork2.TextProviderSupport" scope="default" />
Provide your own ResourceBundleTextProvider implementation that uses whatever configuration management you want, for example, we implemented a DB-backed version (with caching, of course) that allowed translations to live in, and be managed by, a normal DB and I18N front end.
I'll see if I can dig up my original work this weekend and provide a link to a stripped-down solution.
The location of the file cannot be off the class path when you run your app. You should determine which classloader is used to load the resource. Then you should find a way to configure this classloader to be able to use the location as resource. So, it's possible. A short answer.
I have to do custom JAXB external mapping file.
Already red tutorial about this and can not find any suitable example of JAXB customization. My scenario is that I have two WSDL files main WSDL and secondary WSDL which is included in main one. And in secondary WSDL file is one complexType definition which has a name that I want to customize. BTW name of that complexType is objectFactory. So now you know what I really really need that external customization.
I have came so far that when I run wsimport path-to-my-main-wsdl -b customBindings.jaxb
output is like
[ERROR] XPath evaluation of "//xs:complexType[#name='objectFactory']" results in empty target node
line 2 of file:/customBindings.jaxb
File customBindings.jaxb looks like
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="path-to-my-secondary-wsdl#types?schema1" node="//xs:complexType[#name='objectFactory']">
<jxb:class name="MyObjectFactory" />
</jxb:bindings>
</jxb:bindings>
At second line of my customBindings.jaxb file are two properties schemaLocation and node. Does property schemaLocation need to point at main WSDL or secondary WSDl? And does property node be exact path (XPath) to wanted complexType or is like this ok? And what is with namespaces within XPath (node property), it has to be xs or what? And what actually this types and schema1 stands for in schemaLocation?
thx
I came across your question while researching the same problem.
A few vague hints are found on this page: http://jaxb.java.net/guide/Dealing_with_errors.html
Causes for the "empty target node" message are suggested at the bottom of that page.
How can I specify a JAXB Binding for an imported XSD within a WSDL when using wsimport?
I tried following binding, which causes the error "XPath evaluation of //xs:element[#name='isFoobar'] results in an empty target node".
<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="example.wsdl"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<jaxws:bindings node="wsdl:definitions">
<jaxws:bindings node="wsdl:types" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<jaxws:bindings
node="//xs:schema[#targetNamespace='http://www.example.org/']">
<jaxb:globalBindings>
<xjc:serializable uid="10000001" />
</jaxb:globalBindings>
<jaxb:bindings
node="//xs:element[#name='isFoobar']">
<jaxb:typesafeEnumClass name="IsFoobar">
<jaxb:typesafeEnumMember value="01" name="TRUE" />
<jaxb:typesafeEnumMember value="02" name="FALSE" />
</jaxb:typesafeEnumClass>
</jaxb:bindings>
</jaxws:bindings>
</jaxws:bindings>
</jaxws:bindings>
</jaxws:bindings>
Any ideas?
Sorry for the necro-threading, I encountered this problem and although this is one of the first answer that showed up on google with various key word combination it didn't hold the answer I ended up using.
For imported schemas, the easiest way to specify a JAXB binding on an imported XSD within a WSDL is... to treat it as a completely different schema !
Short example :
MyXSD.xsd
<xsd:schema targetNamespace="whatever"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="ThingThatNeedsToBeBound">
<!-- Whatever this is made of -->
</xs:complexType>
</xsd:schema>
No matter where this xsd is imported (wether it's at the root of the of my wsdl or within a nested import), all I need to write to bind my "ThingThatNeedsToBeBound" in my custom binding is :
customBindings.xml
<jaxb:bindings schemaLocation="Path/To/MyXSD.xsd" node="/xs:schema/xs:complexType[#name='ThingThatNeedsToBeBound']">
<!-- your custom binding -->
</jaxb:bindings>
So, it's just like a regular case, except that you specify the schemaLocation, but then you can consider the imported schema as a whole itself instead of a part of something.
I hope this will help others stumbling upon this problem.
Source : http://www.oracle.com/technetwork/articles/grid/jax-ws-jaxb-customization-082750.html
(Note : in the source, the solution seems way more complicated, so my case might have been simpler than what they described, I found my solution using that none the less !)
I did something similar ages ago, I think you need to specify the node to select with XPath as follows:
//xs:element[#name='isFoobar']/xs:complexType
Or replace xs:complexType with whatever kind of type you are using here. Hopefully it will fix your probelm.
My first try at resolving this was trying to somehow use XPath or multiple jxb:binding elements, but that didn't work. As far as I know the XPath just isn't validated properly against imported schemas unless it would all be rewritten and mashed together with DOM.
So the way I resolved this problem was by using inline customizations in the imported XSD. I didn't test this approach with multiple nested imports, but if you got access and time to modify all the imported XSDs this should work out ok. In my opinion this is only necessary if you need to generate the mapping and can be scrubbed/removed from the XSD once the mapping is done.
I'm trying to build my flex 4 project using ant. In Flash Builder 4, in project properties it's possible to set the "Framework linkage" to one of "Merged into code", "Runtime Shared Library (RSL)" or "Use SDK Default (Runtime Shared library)". How can I set the equivalent as mxmlc options in build.xml?
My current build.xml looks like this:
<target name="myapp">
<mxmlc
file="${PROJECT_ROOT}/myapp.mxml"
output="${DEPLOY_DIR}/myapp.swf"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="false"
warnings="false" optimize="true" incremental="false" >
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_FRAMEWORKS}"/>
<compiler.debug>true</compiler.debug>
<runtime-shared-library-path path-element="${FLEX_FRAMEWORKS}/libs/framework.swc">
<url rsl-url="framework_4.0.0.14159.swz"/>
<url rsl-url="framework_4.0.0.14159.swf"/>
</runtime-shared-library-path>
<compiler.source-path path-element="src"/>
<!-- List of external libraries -->
<compiler.source-path path-element="${MY_LIB}/src" />
<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="libs" append="true">
<include name="*.swc" />
</compiler.library-path>
<copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swz"/>
<copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swf"/>
</mxmlc>
</target>
I assumed that setting the runtime-shared-library-path directive and copying the framework swf, swz files into my target folder would make things work, but this does not seem to be the case.
The way I'm assessing whether this works is as follows: I use a custom preloader, and for it to work I need to have framework linkage as RSL. With "merged into code", my preloader gets stuck at a certain point and does not progress to my application swf. This is the same behavior i see when i use the above build.xml, which makes me think that the SWF is being built with framework linkage merged into code (rather than RSL linked).
A related question to this is how to determine if my swf is using RSL or not. I guess I could look at the size of the compiled output. But it seems there should be a way to tell if I'm using the external framework file or it's being bundled into the SWF somehow, without my knowledge.
This is a little tricky because the documentation is a little scarce on this. You probably need to set the following option either on the command line or a config file.
static-link-runtime-shared-libraries=false
The documentation from Adobe gives the following slightly cryptic description of what this option does.
Determines whether to compile against libraries statically or use RSLs. Set this option to true to ignore the RSLs specified by the runtime-shared-library-path option. Set this option to false to use the RSLs. The default value is true.
This option is useful so that you can quickly switch between a statically and dynamically linked application without having to change the runtime-shared-library-path option, which can be verbose, or edit the configuration files.
Here is a link to the documentation.
"About the application compiler options"
Note that from the documentation the default value is true. HOWEVER if you are loading a flex-config.xml file (default or custom) you should also check if this setting is present in that file and what it is. In my experience the default value for the frameworks/flex-config.xml is actually false. It appears however that in the example above that this may be set the other way.
(We use a different build system than ANT so I am not that familiar with the build.xml syntax you would need.)
I am attempting to use spring.net 's IoC conatiner in a class library which in and of itself is not an executable. A web project simply calls this library , this library contains the references to the spring binaries and to spring's config files.
Essentially the question is:
Does spring.net need to reside in an executable to start, or canit reside in a classs library that will be referenced by an executable?
Any help will be appreciated.
You can include part of your configuration in the class library project as an embedded resource file. Let's say you called it LibraryConfig.xml. Then in your executable's application config file, you include the embedded resource using the assembly: prefix. Here's an example:
<spring>
<context type="Spring.Context.Support.XmlApplicationContext, Spring.Core">
<resource uri="assembly://FooLibrary/FooLibrary/LibraryConfig.xml"/>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<object id="mainForm" type="FooApp.MainForm, FooApp">
<!-- mainController is some object defined in LibraryConfig.xml -->
<property name="Controller" ref="mainController"/>
</object>
</objects>
</spring>
If your main application doesn't need to use Spring itself, I think you can set up the whole application context in the library. Embed the config file as described above, then define a singleton object to hold the application context and load it from the embedded config file. Finally, you need to define some kind of factory methods for the client code to create your classes with. The factory methods can either go on the singleton itself (probably using generics), or have a separate factory method on each class that needs to be instantiated. Those factory methods make the actual requests from the application context and the client code never sees it.
it can reside in a dll which is referenced by an executable, but make sure that the configuration is included in (or referenced by) the executable's config file.