Umbraco limit number of child nodes under a parent - umbraco

Is there a way to limit the number of children that can be created under a parent node in Umbraco, ideally I would like to only allow one?
I am not sure if this can be done either via the CMS or set via code in a config file.

Short answer: no, there's no such functionality built into Umbraco, nor are there options to configure it directly.
Longer answer: you could implement a bit of code that hooks into the Saving event (https://our.umbraco.com/documentation/Reference/Events/ContentService-Events#events). There you could check the number of siblings (or rather if there are siblings at all) of any node that hasn't been saved previously - and cancel further saving if any siblings already exist.
Sounds a bit funny to need that, though. What is the scenario?

This is a valid scenario and depending on your Umbraco version, you can use a package, namely NodeRetrict, to restrict the number of nodes that could be created under a parent node.
Please be aware that this package currently supports some Umbraco v7 versions, but not Umbraco v8 and v9 versions.
If you want to check this package to create your own solution or contribute to this package, please take a look at the source code here.

Related

Add a field to a work item in tfs 2017

I have a request to add a new field to a work item and we are using TFS 2017. My organization has done this before in previous versions of TFS. However, I remember customizing any process template to add new fields causes headaches when upgrading to the next version of TFS.
My question is if this is still a concern? If so, is there a work-around for this issue?
Thanks!
Tim
Basically, you would have the same procedure if you want to upgrade a on-premises TFS with customizations.
So, before you customize, you should understand which customizations support an easy update path and which do not.
Recommended practices:
Identify the best options for customizing WITs that support your
tracking requirements. When you change objects that track work items,
you should identify how these changes will affect existing and future
team projects.
Put processes and all XML definition files under version control. Do
not deploy objects that you define but have not stored in a
repository.
Test your customized objects just as you would test your software.
Minimize the number of custom fields that you introduce. Minimize the
number of fields that you make reportable.
Please refer to the link below for more information:
https://learn.microsoft.com/en-us/vsts/work/customize/on-premises-xml-process-model#before-you-customize

Add a comment to an action/component in Release Management

I'm using TFS 2013 Update 3 and Release Management 2013 with Update 3 (agent-based templates).
In the Release Management client, I'd find very useful the ability to add a comment for any action/component (or even a group of them) that is part of a deployment sequence. This is because often it's obvious what an action/component does (e.g. "Move File or Folder"), but it might be useful to know why that is done, also in the context of that particular deployment sequence.
I haven't found a way to achieve that, is it actually possible?
If not, do you have any alternative solution or do you know if a similar feature is available in newer
versions?
One thing you can try (but I am not sure if Agent-based Update 3 allows it) is to rename the action/component once dropped on the canvas. I know vNext templates allows it, and some earlier versions of Agent-based allowed it (but not the recent one... it seems to be broken).
Another less optimal option would be to add a parameter (which would be ignored during the actual deployment) - call it 'Notes' or similar - and just fill its value with the description of what this action/component does. It is less obvious and you may need to scroll to see it when you have many params, but it would be available. Also, this would only work with custom actions and components.
Last option would be to put your action/component (or group of) inside a 'Sequence'. You can rename those by clicking on the name. That would give some context on what that action(s) does.

TFS: How to represent the application version that each change request, bug etc will be addressed in

We have recently transitioned from Gemini to TFS for application change control. There is one aspect of TFS I can't get my head around - the lack of a built-in concept of the application version that each work item will be addressed in.
In Gemini every feature request, enhancement, bug etc can be tagged with a version number. If the field was left blank, the item was "unscheduled", i.e. on the backlog. Each version could be flagged as either released or not. Reports could be then created listing the issues addressed in each released version, i.e. release notes, and the issues to be addressed in future versions, i.e. a roadmap. I was completely happy with this!
Now in TFS I can't find any built-in concept of version. It seems like there are 2 ways to represent version:
As a parent item in the iteration tree, e.g.
Version 1.0.0
Sprint 1
Sprint 2
etc
Version 1.1.0
Sprint 3
Sprint 4
etc
As a parent item in the work items tree, e.g.
Version 1.0.0
Requirement 1
Requirement 2
etc
Version 1.1.0
Requirement 3
Bug 4
etc
The latter approach looks better because it allows versions to be worked on simultaneously (e.g. a major release will be worked on at the same time as bug-fix release).
So what is the recommended approach to managing work by version?
Finally, with the version property not actually being present in the work item itself, is it possible to make reports on issues addressed in each version?
For now I am going to use iteration path to capture the version number. This doesn't lend itself so well to managing development on different versions concurrently, but we are trying to get away from that practise (i.e. be working on the next release while simultaneously working on multiple bug fixes to past releases) and adopt short release cycles, i.e. a more linear path, so maybe that is a good thing.
Earlier I though Area Path might be a good place to put Version, but its too valuable as a way to split up a huge application into parts to sacrifice for versioning.
1. Tags (TFS 2013+) are the easiest way to append metadata such as build#. (same as mentioned above.)
2. The CMMI Process Template > Requirement and Bug Work Item Types have an "Integrated In" field that links to TFS Builds for direct correlation from requirement to build# [to related code changes] [to related test cases [to related test results]]. Note you must select from retained TFS Build system builds (that have not been deleted). This hard reference drop-down limits this field significantly over time or if you use a different build system. (That and build versioning are entirely different discussions :-).) The Build CMMI template fields have been there since TFS2010.
3. Create a custom field in your User Story and Bug work items. BuildImplementedIn or similarly named field would do. Creating custom fields is not hard in TFS. You will need a Team Project Admin or possibly a TPC Admin to make the customization if you aren't already an admin.
p.s.: Sorry for the late reply. I posted this answer in case others still have the same or similar question.
You could use the area field.
We use that one for product name (we maintain multiple products) and then version goes into the description of the story, but you could use the area field for versions.
Another possibility is to use tags at the top of the Product Backlog Item.
Btw, I agree that TFS is lacking a few important fields (custom fields)

How can I link the corresponding compilation units (class files ...) to JIRA and Bugzilla issues

I would like to get the issue list from Bugzilla and JIRA for an open-source project. For each issue, I'd like to collect the corresponding compilation units(for java projects, class/or interfaces files), which may relate to the issue.
Any idea on implementing this feature would be appreciated.
Many thanks!
For JIRA, there are some solutions out there you could use out of the box. See the documentation to integrate with source control for JIRA how to do it. This only works for some source control systems, you should which ones are supported. This gives you a list of change sets (e.g. for Subversion) for each issue.
Another approach could be to do it on your own through an interface to the source control system yourself. The following prerequisits have to be in place:
Your developers have the tools to add the information which issue was worked on by which commit on a per commit base.
You have rules that changes to the sources should all the time being done only for one issue at one time.
You are able to parse the additional information you will get from your version control system e.g. by a script or a program.
For Subversion and JIRA, it could work like that:
Ensure that all commits are only done if the Subversion commit message contains at least one JIRA ticket number. You may even ensure that by a pre-commit hook
Learn how to get the following information from the subversion log
The ticket IDs (by parsing the message) for each change set
The files that had changes for each change set
Collect for each file all tickets.
Show them in a format you like.
I think that this is not too useful, because ticket per class is too fine grained. Perhaps you should have a mapping of the files to modules, sub-projects, ... and collect tickets for them.
All solutions will be different depending on your selection of tools. JIRA and Subversion are here just examples :-)
The best way is to first integrate your issue tracking system with your source control. That means that whenever a developer commits a new change, it determines the set of issues related to this change. This linkage is managed by your issue tracking system and it can show you all the source files, resource files, config files that have changed in the context of an issue.
This info, will be available through the api of that issue tracking system as well.

TFS: Can I have a script run when I create a new label?

We're using TFS 2008 for our source control. We're currently doing embedded work so our actual build process is using Analog Devices VisualDSP++ IDE. However, we do still use labels on TFS. What I had hoped was for the ability to have a script run when a label is applied. The idea here is to update version information in some data files. This would help ensure that every label programmatically updated that version string. Currently we have to do this manually.
I'm used to Subversion and Git to some extent and was hunting around for post-commit type hooks or something similar. TFS seems like a different beast.
I'm not a stranger to .NET and (so far as I know) could write a simple app that did the grunt work of updating our files and then applied the label programmatically but it seems like there's got to be an easier way.
Am I right? Is there some mechanism that I can attach a script/batch file when a label is applied in TFS?
No, sorry, there's no server-side event fired when labels are created/updated. I'd recommend using branches instead of labels. Then you can hook the CheckinEvent (filtered by the path of the branch[es] in question).
For more info on subscribing to CheckinEvent (including filters), check out Buck's blog + updates + links: http://blogs.msdn.com/buckh/archive/2006/09/29/checkinevent-path-filter.aspx
For a code sample that illustrates what your event listener might look like, check out Martin Woodward's "bunny": http://www.woodwardweb.com/vsts/behind_brian_th.html
For info on using branches instead of labels for code promotion, try http://tfsbranchingguideiii.codeplex.com/

Resources