I am writing a script which will act on modified files in my TFVC (Microsoft Team Foundation Version Control) workspace. I'm invoking tf.exe vc status /format:xml to get the list of changes, but I need to exclude deletes. Is the XML format it returns documented? I know I want to filter on the chg attribute of the PendingChange elements, and I could discover the value by deleting a file and seeing what it returns, but I suspect there may be other values that I should check for as well. It would be much nicer to work off a documented canonical list rather than fixing the script each time it fails on a new value or combination I hadn't seen before. Does the documentation or a schema definition exist? (Neither of the two search engines I use led me to any.)
It seems there is no such documentation available yet. The pending change types using mostly are as below:
I've tested the chg attribute of the PendingChange element in the XML file for the pending change type above, you may reference it:
PendingChange chg="Encoding Branch"
PendingChange chg="Undelete"
PendingChange chg="Rename"
PendingChange chg="Edit"
PendingChange chg="Add Edit Encoding"
PendingChange chg="Edit Rollback"
PendingChange chg="Delete"
PendingChange chg="Edit Encoding"
I found the pending change types come from the enumeration Microsoft.TeamFoundation.VersionControl.Client.ChangeType which is documented in the TFVC client API documentation here: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/bb170193%28v%3dvs.120%29. Although it's not documentation of the XML format, it is the canonical list of the possible values.
As a side note, I ended up not being able to use the XML output for my script since it does not include new files (unless they have been specifically added, which in my scenario they are not) which I needed for my script. (Since I didn't have time to code to the TFVC client library, I parsed the output from tf vc status /format:brief.)
I have been given the task of creating a DXL script. First problem is that I have never used DXL before, even though I have many years experience with DOORS itself. I have been surfing the Net to seek guidance on my particular problem. I also have a few specimen DXL scripts for reference.
My new client requires that for each View of a given Module, of which there are many Views, new "reduced" Modules are to be produced reflecting each View.
By "reduced", I mean that these new Modules are to contain nothing that isn't actually needed for that View., i.e. Columns, Attributes etc. These new Modules will only have the single View.
So, the way forward as I see it, is to take copies of the single master Module, one for each View, rename those copies to reflect a given Master Module/Required View, select that required View in the given copy Module and then delete everything that is not needed by that View, i.e. available Columns, Attributes etc.
This would be simple if I had the required DXL knowledge, which I am endeavouring to pick up as fast as I can.
If at all possible, this script has to be generic and be able to work upon any of the master Module copies to produce the associated "reduced" Module reflecting a particular View.
The client aims to use the script periodically for View archiving (I know, that's the way they want it).
Clarification
Some clarification of what I believe is required, given the following text from my original question:
If at all possible, this script has to be generic and be able to work upon any of the master Module copies to produce the associated "reduced" Module reflecting a particular View.
So, say there are ten views of the master Module, outside of the DXL script, I would copy the master Module ten times, renaming each copy to reflect each of the ten views. Unless you know different, each of those ten copies will reflect the same “Absolute Number”s as are in the master Module, so no problem there?
So, starting with the first of the copied Modules, each named to reflect the View it will eventually represent, its View would be set from the ten Views available to it, that which matches its title.
The single generic DXL script would then be run against that first copy Module, the aim being to delete everything not actually needed for that view, i.e. Attributes, Columns etc. Would some kind of purging command be required in the script for any aforementioned deleted items?
The single generic DXL script would then delete ALL views from that copy Module. The log that is produced when running the script also needs capturing, but I’m not sure whether this should be done from within the script, if possible or as a separate manual task outside of the script.
The aforementioned (indented) process would then be repeated, using the same generic script, against the remaining nine copied Modules. The intension is to leave us with ten copy Modules, each one reflecting one of the ten possible Views, with each one containing only the Attributes, Columns etc. required for that View.
Creating a mirror of a module with this approach is not so easy IMO. Think e.g. about "Absolute Number". If the original module contains the numbers 15 (level 1), 2000 (level 2), 1 (level 1), you will have to create 2000 objects, purge 1997 of them and move them to the correct place.
There is a "duplicate" tool at https://www.ibm.com/developerworks/community/forums/html/topic?id=43862118-113d-4eac-b3f1-21d3b73959d1 which tries to do this, but as stated there, this script is said not to work correctly in all situations.
So, I would rather use the approach "string clipCopy (Item i); string clipPaste(Folder folderRef)". Should be faster and less error prone. But: all Out-Links will also be copied with this method, you will probably have to delete these after the copy or else the link target module(s) will have lots of In-Links.
The problem is still not so easy to solve, as every view might have DXL columns that rely on some or other attribute, and it might contain DXL attributes which again might rely on sth else. I doubt that there is a way to analyze DXL code "on the fly" and find out which columns may be deleted.
Perhaps a totally different approach would be feasible: open each view and create an export to Excel, this way you will get rid of any dynamic dependencies. Then re-import the excel sheet to a new DOORS module. You will still have the "Absolute Number" problem, but perhaps you can make a deal that you will have a pseudo attribute "Original Absolute Number" and disregard the "new" "Absolute Number"'
Quite a big task for a DXL beginner....
Update: On second thought, perhaps you might want to combine these approaches
agree with your employer that you will use an alternative attribute for Absolute Number
use a loop like Russel suggested, when creating objects remember that objects might have to be created "below" or "after" its predecessor or sibling
for DXL attributes do not copy the DXL code but the actual current value of the object
for DXL columns create pseudo attributes _ and create a new view that uses these pseudo attributes instead of the original value
Copying the entire module, then deleting everything not in that view, seems worse than just copying the things you need from each particular view.
I would take the following as the outline of your program:
for view in main module do {
for column in view do {
Find attribute for each column and store (possibly in a skip list?)
Store name of column
}
create new module
create needed types / attributes in new module
create new view in new module
for object in main module {
create object in new module
for attribute in main module {
check if attribute is in new module {
copy info from old object to new
}
}
}
}
Each of these for X in y loops should be in the DXL reference manual in some for or another.
If you need more help, let me know!
I am looking for a complete list of properties supported by log4j2. The log4j2 documentation at following link gives only a subset of properties.
https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties
For ex:
Delete files older than 30 days
appender.rolling.strategy.delete.ifLastModified.age = 30d
This is not listed in the manual. Any suggestions where I can find the list?
A full list of all log4j2 properties does not exist because configuration with properties is only one option among many (XML, JSON, YAML etc.).
Each log4j2 part is described with a list of configurable parameters it supports (e.g. https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender). The URI you are linking describes the rules which property names you have to choose to configure the parameters.
So the way you have to go is:
Select which function you have to use (e.g. RollingFileAppender)
Read the chapter of this function and select the parameters you want to configure
Use your linked URI to create you property based configuration with the property names for the parameters you want to configure
I read the following post which does what I want for all jobs (and I made it works)
List all keep-forever builds in Jenkins?
here is what I have now :
http://jenkinsmediaprocessor:7880/api/xml?depth=2&xpath=/hudson/job/build[keepLog=%22true%22]/url&wrapper=forever
But I only want to display a specific task. However I don't know where to set the job name,
I tried the followings
1-) job/MYJOBNAME
2-) JOBPATH/job/MYJOBNAME
3-) replace job with MYJOBNAME
I can't make it works.
Also would it be possible to only display a list of number? Instead of having to use a grep on the *.xml.
This works for me:
JENKINS_URL/job/JOB_NAME/api/xml?depth=2&xpath=//build[keepLog=%22true%22]/number&wrapper=forever
Sample output:
<forever>
<number>688</number>
<number>687</number>
</forever>
forever is a wrapper parameter. You will find more details if refer to JENKINS_URL/api:
For XPath that matches multiple nodes, you need to also specify the "wrapper" query parameter to specify the name of the root XML element to be created so that the resulting XML becomes well-formed.
I have a directory with a list of property files for different environment(DEV/STG/QA etc.,)
I want to call an Ant target in a loop with each of this file. How do I do this. I downloaded ant-contrib and tried using the foreach but I couldn't find any example where I can read property files one at a time and call the target. Any suggestions?
I have been looking at a lot of samples on this site and online, nothing seem to match my requirement.
As per apacche documentation : https://ant.apache.org/manual/Tasks/property.html
<property file="foo.properties"/>
reads a set of properties from a file called "foo.properties".
so, if you have my.var=25 , then ${my.var} will get you its value 25. For your requirement you can iterate through the files based on 'env' name & do required tasks.