I know there're powerful TFS command line tools from TFS Power tools that provide much more that can be achieved through Visual Studio integrated capabilities.
I have several changesets that aren't associated with any workitem. I would like to create a new workitem and associate these existing changesets with it.
Is this possible? I don't see any particular reason why not, but it depends whether command line tools provide such functionality.
Sure you can associate a work item to an existing changeset. You can do that directly in the Visual Studio IDE. Here's how:
First open the work item - and select the All Links tab:
Then click on Link to and select the changeset and click Ok:
Yes, read bellow.
This can be achieved from workitems links section, in your definition i don't see reason why you would want to use something else.
If you are interested in some bulk solution, then Tfs has full-fledged API any tool will likely using it as well.
Following covers your case in api:
http://social.technet.microsoft.com/wiki/contents/articles/3280.tfs-2010-api-create-workitems-bugs.aspx
TFS2010: How to link a WorkItem to a ChangeSet, you can use VersionControlServer.QueryHistory method to get changesets you need
For powershell this covers item creation:
http://programmaticponderings.wordpress.com/2012/07/18/automating-work-item-creation-in-tfs-2010-with-powershell-continued/
Related
i'm about to setup a new server that will be dedicated for CC views i'm wondering if there is any way to move the existing views to the new server?
In theory, yes: you can unregister a view (cleartool untegister + cleartool rmtag -view), and register it again on the new server.
See:
"Moving a view to a host with the same architecture or to a NAS device"
"Moving a view to a host with a different architecture": it involves a cleartool reformatview -dump/-load in addition of the unregister/register steps.
(after the more general page "About moving ClearCase servers")
Honestly, in the past, I've just found it easier to throw away views and start over. We used a standard set of config specs that created task-specific branches per view. We worked with dynamic views (if you're working with snapshot views in clearcase, I think that you're using the wrong Version Control System), but had our developers checkin all of their changes (which by default would checkin against their feature branch), we'd then delete all of the views for the host being decommisioned, and had developers re-create their views normally (which would automatically start them up on the new server). We naturally abstracted away a lot of the customized config specs and setting up metadata for them so they only needed to run a simple command to continue.
We were not using UCM, however.
Now that I think about it, we just had a small handful of scripts that were used to do this work - basically wraps all of the dirty "view" details away from the developers (which honestly, they don't need to know about in general).
I need to be able to perform all of the available functions that the Package Manager Console performs for code first DB migrations. Does anyone know how I could accomplish these commands strictly through user defined code? I am trying to automate this whole migration process and my team has hit the dreaded issue of getting the migrations out of sync due to the number of developers on this project. I want to write a project that the developer can interact with that will create and if need be rescaffold their migrations for them automatically.
PM is invoking through PowerShell and PS cmdlets (like for active directory etc.)
http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference
The Package Manager Console is a PowerShell console within Visual
Studio
...there is essentially very little info about this - I've tried that before on couple occasions and it gets down to doing some 'dirty work' if you really need it (not really sure, it might not be that difficult - providing you have some PS experience)
Here are similar questions / answers - working out the PS comdlets is pretty involving - in this case it has some additional steps involved. And PS tends to get very version dependent - so you need to check this for the specific EF/CF you're using.
Run entityframework cmdlets from my code
Possible to add migration using EF DbMigrator
And you may want to look at the source code for EF that does Add-Migration
(correction: this is the link to official repository - thanks to #Brice for that)
http://entityframework.codeplex.com/SourceControl/changeset/view/f986cb32d0a3#src/EntityFramework.PowerShell/Migrations/AddMigrationCommand.cs
http://entityframework.codeplex.com/SourceControl/BrowseLatest
(PM errors also suggest the origins of the code doing the Add-Migrations to be the 'System.Data.Entity.Migrations.Design.ToolingFacade')
If you need 'just' an Update - you could try using the DbMigrator.Update (this guy gave it a try http://joshmouch.wordpress.com/2012/04/22/entity-framework-code-first-migrations-executing-migrations-using-code-not-powershell-commands/) - but I'm not sure how relevant is that to you, I doubt it.
The scaffolding is the real problem (Add-Migration) which to my knowledge isn't accessible from C# directly via EF/CF framework.
Note: - based on the code in (http://entityframework.codeplex.com/SourceControl/changeset/view/f986cb32d0a3#src/EntityFramework.PowerShell/Migrations/AddMigrationCommand.cs) - and as the EF guru mentioned himself - that part of the code is calling into the System.Data.Entity.Migrations.Design library - which does most of the stuff. If it's possible to reference that one and actually repeat what AddMigrationCommand is doing - then there might not be a need for PowerShell at all. But I'm suspecting it's not that straight-forward, with possible 'internal' calls invisible to outside callers etc.
At least as of this post, you can directly access the System.Data.Entity.Migrations.Design.MigrationScaffolder class and directly call the Scaffold() methods on it, which will return you an object that contains the contents of the "regular" .cs file, the "Designer.cs" file and the .resx file.
What you do with those files is up to you!
Personally, I'm attempting to turn this into a tool that will be able to create EF6 migrations on a new ASPNET5/DNX project, which is not supported by the powershell commands.
We have a requirement that on a page publish, we need to:
Find a component presentation that has a component based upon a particular schema.
Extract certain field vales from that component and store them in a custom database table that's available to our .NET application (on the Content Delivery side).
I think this is a good candidate for either a Deployer extension or a Storage extension - but I'm a little unclear which and why having never written either?
I've ruled out the Event System as this kind of code would be located on the CM, which seems like the wrong "side" to me - my focus is on extending what happens on the CD-side after a page is published.
Read a few articles on Tridion World (this, this, this and this) and I think a storage extension would be the better choice?
Mihai's article seems to be very close to what we need, where he uses a new item type mapping:
<ItemTypes defaultStorageId="brokerdb" cached="true">
<Item typeMapping="PublishAction" cached="false" storageId="searchdb" /></ItemTypes>
But how does Tridion "know" to use this new item type when content is published, (its not one of the defined TYPE_NAMEs, which is kind of the point)?
I should clarify I'm a .NET/C# dev not a Java dev so this is probably really obvious to Java people - apologies if it is!
Cheers
Tridion will not know by default how to deploy your new entity. My advise is to create a Deployer Module (your links should give you enough information about how you can do that) that executes in post-processing phase (of the deployment process), that processes all components from the deployment/transport package, extracts the needed information and uses a custom Storage Extension to store the needed information.
Be careful: you need to set-up in config your new type but you also need to use it yourself from that Deployer Module.
Hope this helps.
Needed to understand your inputs on: Is there a way in Tridion 2011 to Publish or Unpublish components/pages/templates in a custom resolver code. I understand we can play with the list of resolved items. (By giving a CP,etc). But is there a way to push an item in the publishing Q from a custom resolver code.
You can add or remove any number of items to be part of the existing package / transaction.
If you want it to be part of a new entry in the Publishing Queue instead, the event system seems more appropriate than a resolver. But the items you are publishing automatically won't show up in the "Items to Publish" screen if you Publish them separately, so you need to decide if that's a good thing or not.
Peter (and Nuno) have really answered your question in the best way. You should use a resolver to add the Pages or Component Presentations to the package rather than making new publish transactions. However you can publish items using the core service, so there is no reason you could not call the core service from a resolver and initiate your new publish actions that way.
However it does not sound like a good idea, perhaps you can update you question to explain why you need to do this.
I used to use the PublishEngine object in my templates to add items to the Publish Queue (see http://www.tridiondeveloper.com/the-story-of-sdl-tridion-2011-custom-resolver-and-the-allowwriteoperationsintemplates-attribute), but custom resolvers and other techniques are far superior.
I'm trying to automate InstallShield from my build process, and I need to set a type 51 Custom Action's Property Value from my Release's Product Configuration Flags property. What is the syntax (something in square brackets?) to do that?
From here...
...to here:
You'll probably need to do a string replace on the InstallShield project to pull this off:
1) Under General Information | Project File Format, set the format to "XML", and save the project.
2) Next write a script to search the xml file for the name of your custom action, and replace the value with your Product Configuration Flags.
We've used this straightforward technique to change a number of properties at build time, including version numbers.
InstallShield also has an automation interface. FYI:
http://kb.flexerasoftware.com/doc/Helpnet/installshield12helplib/IHelpAutoISWiProject.htm
For advanced developers, InstallShield
exposes a COM interface that allows
you to perform many of the same tasks
from a program, such as a Visual
Basic� executable, or a script, such
as a VBScript file in Windows
Scripting Host. By calling methods,
setting properties, accessing
collections, and so on, through the
automation interface, you can open a
project and modify its features and
component data in many of the same
ways that you would in the
InstallShield interface.
MSI Tip: Building Releases with the InstallShield Automation Interface
There's a bit of a learning curve, but once you've got it, it more reliable and robust than editing the XML file manually.