How to get the solution name in vsix project templates? - vsix

I'm creating a VS template through vsix. I can get the project name using $safeprojectname$ parameter of replacementdictionary. Like the way, is it possible to get the solution name? I can get the solution name in add-in using dte object. But how to do it in templates?

Use $SpecificSolutionName$, I think.
See:
https://msdn.microsoft.com/en-us/library/eehb4faa.aspx

Use $specifiedsolutionname$ (lower case). this is the name of the Solution.

Related

VSTS: Built in variable for organization name?

In many of the calls described in the Azure DevOps REST API documentation, I need to supply the name of the organization, e.g.:
https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases?api-version=5.0-preview.8
The project I can get from System.TeamProject. I would have expected something similar for organization name, something like:
System.TeamFoundationCollectionName
This does not seem to be available. I've even printed out all of my environment variables on the agent and don't see anything that fits the need exactly. Sure, I can parse it out of one of the other values, but this seems fragile since MS seems to like to change the format of URLs.
I also can't hard code the organization name because this release definition will live in multiple organizations and we don't want to have to manually update it for each. How are others solving this problem?
Try using System.TeamFoundationServerUri and System.TeamFoundationCollectionUri to build your API requests. They have the organization included in them.
https://learn.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=vsts&tabs=batch
edit: SYSTEM_TEAMFOUNDATIONSERVERURI/BUILD_PROJECTNAME/_apis/release/releases?api-version=5.0-preview.8
It looks like currently there is no such variable for the organization, also, the variables return the old URL (xxx.visualstudio.com) and not the new URL (dev.azure.com/xxx) so if you use the System.TeamFoundationCollectionName the API should work without the {organization}:
https://System.TeamFoundationCollectionName/{project}/_apis/release/releases?api-version=5.0-preview.8.
In Powershell, do this:
# Where SYSTEM_TEAMFOUNDATIONCOLLECTIONURI=https://some_org_name.visualstudio.com/
([System.Uri]$Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI).Host.split('.')[-3] # returns 'some_org_name'
Now, just assign that to a variable and use it anywhere you like. "SYSTEM_TEAMPROJECT" is the Project Name, so no need to do any parsing there. It is already available.

Dafactory V2 Copy Activity Json

I am trying to copy json file from one blob to another using the datafactory copyactivity and need to Set custom value for one of the property in the dest Json when copying... so I was trying to set the jsonPathDefinition as shown in the link below to then use expression like this "#{parameters('myNumber')}" ...but seems in the C# library it is not available... is not going to be available as it available in V1 library ..is it deprecated in V2 or something that has been missed or there are other ways to achieve this in V2. Please suggest....
https://learn.microsoft.com/en-au/azure/data-factory/supported-file-formats-and-compression-codecs#json-format
In V2, there is a defect whose fix is on the way and should be available in about one week. The temporary workaround is using REST API.

Eclipse Plugin Development: Adding items to a working set with the path of the item?

Hello,
I'm an eclipse plugin development newbie looking for pointers to get me started on a particular project.
I am trying to build an eclipse plugin that will automatically construct a working set from a text file that simply consists of a list of file path names. The files/items need not share any parent directories. The rough idea is represented in the following diagram:
I am not asking for the solution to this task. That's the over-arching goal. To achieve that goal, I want to conquer some smaller goals first.
With that in mind, here's the smaller goal I'm currently trying to tackle:
In Eclipse, how can I prompt the user for a single file's path, and then add that file to an existing working set?
I'm not sure where to start. Should I work directly off of the existing org.eclipse.ui.workingSets extension point? Or should I use a collection of other extension points? How do I convert strings into something that can be added to a working set? Do I write code that directly modifies the workingsets.xml file?
Even with a much simpler goal, I still feel quite overwhelmed with the vastness of eclipse extension options. There are probably many ways to go about implementing something like this, but I just need one to get started.
Thanks a bunch!
To manipulate working sets you use the working set manager interface IWorkingSetManager. Get this with:
IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
From this you can get a particular working by name with:
IWorkingSet workingSet = manager.getWorkingSet("name");
The contents of a working set is an array of IAdaptable objects:
IAdaptable [] contents = workingSet.getElements();
You add to the contents by adding to this array and setting the contents:
IAdaptable [] newContents
.... get new array with old contents + new contents
workingSet.setElements(newContents);
A lot of Eclipse objects implement IAdaptable, for a file in the workspace you would use IFile. You can use dialogs such as ResourceSelectionDialog to select resources from the workspace.

powershell create apps group in metroUI

I need to create folder in metroUI in separate group.
I can do this manually like here, but I have to do this with powershell.
Anyone know how to do this?
I think you need to use Export-StartLayout, modify the XML and then use Import-StartLayout
http://technet.microsoft.com/en-us/library/dn283401(v=wps.630).aspx

How pass the variable form config file form one plugin to another in Symfony?

I am new to Symfony 1.4
And I have a project in which I have 2 plugins. In first plugin named myPlugin1 I have the config folder and in him the app.yml file, in which I have set a predefined "variable" like that:
all:
carriage:
cost:
prepaid: 10
What I need is to pass this "variable" in a class from my other plugin, myPlugin2, which actually handle the payments costs.
How can I pass this "variable" to my class?
UPDATE:
Can I do this like that? Or this can be used only in current plugin?
sfConfig::get('all_carriage_cost_prepaid')
the actual call must be:
sfConfig::get('app_carriage_cost_prepaid')
The starting prefix is related to the configuration file name. Source here.
Regards.
I have found finally how to do it. Is like that:
$myarray = sfConfig::get('all_carriage_cost');
$thevalue = $myarray['cost'];
Here is the source.