RTC client: get current work item? - rational-team-concert

I'm looking for a way to extend the RTC client to get the current work item programmatically, or even better add a listener that notifies me whenever the current work item is changed.
I don't know where to start. Any hints?

One can use the following code to get the IWorkItemActivationManager:
IWorkItemActivationManager manager = ClientModel.getWorkItemActivationManager();
Wie this manager, it is possible to use the method getActiveWorkItem to get a IWorkItemHandle:
IWorkItemHandle handle = manager.getActiveWorkItem();
Then the following code can be used to get the IWorkItem:
IAuditableClient auditableClient= (IAuditableClient) Controller.getInstance().getTeamRepository().getClientLibrary(IAuditableClient.class);
IWorkItem item = auditableClient.resolveAuditable(handle, com.ibm.team.workitem.common.model.IWorkItem.FULL_PROFILE, null);
The ClientModel is in the following package: com.ibm.team.workitem.rcp.core

One way I usually explore is the OSLC API through REST call.
With a Chrome and its "Developer Tool" activated, I click on the web client and look at the request done.
That gives an indication of the kind of service involved.
Then you can look at "How to consume the Rational Team Concert change management services", which illustrates how those services are structured.
Combine it with "Extending Rational Team Concert 3.x" and you can start from there.

Related

Is there a way to find the workitems for a release in Azure DevOps Api 5.1?

I can find a release in Azure DevOps Api 5.1 by a request to https://vsrm.dev.azure.com/mycompany/myproject/_apis/release/releases/myreleaseid?api-version=5.1
How can I get the workitems of that release as shown on the devops portal under Deployment - Stages - Workitems?
My naive approach just using https://vsrm.dev.azure.com/mycompany/myproject/_apis/release/releases/myreleaseid/workitems?api-version=5.1
resulted in a 404.
There is a stakeholder in the workitem and I want to send him a notification adter the release.
How can I get the workitems of that release as shown on the devops
portal under Deployment - Stages - Workitems?
Hard to say, but I don't find any document about this topic... So I determine to use F12 to find that. And here's the one I finally find:
Get:https://vsrm.dev.azure.com/mycompany/myproject/_apis/Release/releases/myreleaseId/workitems?baseReleaseId={my baseReleaseId}&%24top=250&artifactAlias={my artifactAlias}
It will returns the IDs of the workItems for the release. Its response format:
After you get the IDs, it's easy to get details if you need using Get Work Items Batch or what.
In addition:
1.myreleaseId is the ReleaseID. (On my side, the ID is 7 if it's Release-7)
2.my artifactAlias is this:
3.For my baseReleaseId, I'm not 100% sure about its meaning. I think it could be something like ReleaseToCompareAgainst. Hint from Daniel. (On my side, if my releaseId=7, then I use basereleaseID=6(7-1), it works to get the correct WIT ids). (Actually I suggest you can use F12 in that web page to check your corresponding URL.)
And according to Mathias F: The baseReleaseId realy is the last previous release that has a deployment (-1 in some cases)
4.About how to use F12 to find rest api which may not be documented:
Hope all above helps :)

Passing back value from Browse-Child VM chain to caller

MVVMCross
Windows Store
Android
I have a VM that browses a hierarchy (BrowseVm) and supports forward navigation via
ShowViewModel<LeafDetailVM>
to a leaf detail ViewModel (LeafDetailVM).
When the user is on the LeafDetail View they should be able to say "I want this one" and they will be returned to the View that initiated BrowseVm.
I cannot simply Forward Navigate to the Initiator because that would leave me with an invalid back stack. I cannot have the BrowseVM view as a NoHistory page as I need it be in the back stack to support going back from the LeafDetail view.
My plan is to have the initiator start BrowseVm with a GUID. BrowseVm will pass that GUID onto LeafDetailVM.
In the "I want this one" command I will raise a Message, containing the GUID, that both BrowseVM and the initiator are subscribed to. Then I will close LeafDetailVM.
When BrowseVM receives the notification of the message it will compare the GUID and if it matches it will close itself.
When the initiator receives the notification it will deal with the now chosen data.
Does this make sense? Have I missed a much simpler way of doing this?
This is similar to How to pass a parameter from a viewmodel to its parent viewmodel but that does not deal with the back stack.
Thanks
I suggest you try stop mentally coupling how the views work on a platform to the view-models.
With the custom presenter mechanism in MvvmCross, in the app (platform specific code) you can handle navigation to a certain view-model in different ways, including closing views, modify backstack, etc.
You can interpret navigation to a view-model in whatever way you want \ need.
You can for example pass from view-model some parameters in the ShowViewModel request which the view-presenter (IMvxViewPresenter) can interpret in different ways in the Show() to display a view-model.
In your case, you can actually navigate to initiator VM passing the selected info. In the view presenter, you can modify the backstack in the way you need.
On Android, make sure you read and know about all LaunchMode flags, for example LaunchMode.SingleTask which allows you bring the initiator activity to front without creating a new one.
It's not clear to me, is BrowseVm a parent view-model to the LeafDetailVM?
More info would be needed to understand exactly your scenario.

Scraping data after filling out form?

I'm doing a little project for my class and I'm just a beginner, so please forgive me if I mix up some of my terminology.
Basically, I'm creating an interactive journey planner for my city's public transit system. Unfortunately, they haven't made all the data I need publicly available. So instead of putting all my time into gathering the data for personal use, I've opted to do some screen scraping - letting their servers calculate the journey info from a START and STOP variable and then displaying the selected info on my page.
So is it possible to fill out a form's fields remotely, and then scrape the data on the page that subsequently loads? And if so, what would be the quickest, most convenient way? This happens to be a case where the data can't be manipulated via the URL, so it has to access the data by filling out the form first.
The website in question:
http://jp.translink.com.au/travel-information/journey-planner
Here is what you can do:
1.) Send a POST Request to the journey-planner with some data like that (be aware that CORS might jump in, then you could use cURL via PHP or whatsoever):
Start:Wickham Tce, Spring Hill
End:Upper Edward St, Spring Hill
SearchDate:10/05/2013 12:00:00 AM
TimeSearchMode:LeaveAfter
SearchHour:7
SearchMinute:40
TimeMeridiem:AM
TransportModes:Bus
TransportModes:Train
TransportModes:Ferry
MaximumWalkingDistance:1500
WalkingSpeed:Normal
ServiceTypes:Regular
ServiceTypes:Express
ServiceTypes:NightLink
FareTypes:Standard
FareTypes:Prepaid
FareTypes:Free
2.) You will get a new response location. This seems to be a REST link. Important for you is the id at the end. You will have to call that page and parse the HTML and look for a div with the HTML-id option-summaries, where you will find more information within the divs travel-option-1 to travel-option-n. You have to look at it carefully in order to find out which information is stored whee and how you will be able to use it.
In order to find such things you should learn how to use Firebug or Chrome's development tools.
This is one way to solve your problem. Probably not the best but still better than "screen-scraping" anything. But it will ask you for a lot of skills and effort. Furthermore if the data provider is going to change just a bit your solution will not work anymore. Additionally they might prevent your access by CORS or anything else (blocking your IP etc.)

Databinding issue about updating data issue between MySQL database and my devexpress Gauge value?

Background:
Developing a trading system which subscribe to many events which are sent by API of Interactive Brokers. One interesting event is about my trading account value which fluctuates during trading hour so I would prefer to see the information with accountvalueupdate event immediately. I develop this one based on ActiveX api and c# in Visual Studio 2010.
the presentation I wanna check this information is to use a gauge developed by(http://www.devexpress.com/Products/NET/Controls/WinForms/Gauges/). This gauge looks fancy but the principle should be similar to the normal gauge we use in Visual Studio. It seems like I could only update the value of the gauge by databinding since I tried to assign updated account value to this.myGauge.value and failed.
I build up MySql connection between MySql and VS2010. I create only one table in MySQL which is called account. For the sake of simplicity, i only have two column(accountID and accountValue) and one row|(which means when event comes with new accountValue, I just overwrite the value of accountValue last session then the number of row is always one. really simple idea.....).In that Gauge proporties I found databinng option and I setted up by using advanced option to navigate throw available table and bind it to the only useful column accountValue.
Issue:
I set up the default value of the accountValue as 500 as default for test. I build my software. The gauge shows 500 correctly.
Of course, my real account value is not 500, so Now I click one button to connect to API and start listening the event. After few seconds, event arrives since I opened on Console for managing the mysql table and use select * from account to continuously watch the update. I noticed the value of accountValue column(TABLE WORKS RIGHT AND WE ONLY HAVE ONE ROW, OEVERWRITTING MODE) becomes the right one, for example, 35000.
HOWEVER, THE GAUGE DOES NOT CHANGE AT ALL...!! Now If i closed my software and build again, the gauge shows the right value 35000. Now I shut down the api and no coming event and only use commandline of mysql to change the value of accountValue again to 500. NO UPDATING in gauge as well.
It looks like the gauge only read the value of table during the build session or when it starts and never listen to the update of binding databases.
By the way, I tried to set up the biding data mode to either "onValidation" or "onPropertieschanged" but it does not solve although the "onPropertieschanged" looks the right one....
I tried to assign updated account value to this.myGauge.value...
Unfortunately, the information you provided doesn't allow to clearly diagnose this problem. There is no the Value property neither in WinForms GaugeControl nor in CircularGauge (as soon as in Linear/Digital/StateIndicator gauge), but only in ASPxGaugeControl (ASPxGaugeControl.Value). So, please provide a full sample code that doesnot work on your side.
All these properties can be changed manually in code or data-bound to data sources using the standard .NET data-binding mechanism:
The ArcScaleComponent.DataBindings property allows you to data-bind
to the current value of a circular gauge's scale (ArcScale.Value).
The LinearScaleComponent.DataBindings property allows you to
data-bind to the current value of a linear gauge's scale
(LinearScale.Value).
The DigitalGauge.DataBindings property allows you to data-bind to the
text displayed by a digital gauge.
The StateIndicatorComponent.DataBindings property allows you to
data-bind to a state of a state indicator gauge.
Please, review the following articles for more details: Data Binding.
The databinding feature is demonstrated in the Gauge's Main Demo project (the DataBinding module):
this.arcScaleComponent2.DataBindings.Add(
new System.Windows.Forms.Binding("Value", this.productsBindingSource,
"UnitsOnOrder", true, System.Windows.Forms.DataSourceUpdateMode.Never));
P.S. Please use the DevExpress Support Center to ask a questions or report issues, because there is no guarantee of DX involvement when you use the communities, newsgroups or other communication channels.

What is the difference between the BU and ZK OK codes in SAP macro

I am trying the post an invoice to SAP using the F-47 transaction and using SHDB to record the transaction and learn how it works. I see there that sometimes BU and ZK BDC OK codes are used. I would like to understand the difference between them, but could not find any official documentation. Please, explain the difference between the two?
I found the meaning of some of the status codes. I post it here, so I can remember:
/00. Enter
/AB Go to overview
=ZK Go to additional information
=ENTE Enter (don't know exactly what is difference between /00)
=PI select cursor location
=STER Go to taxes
=DELZ delete cursor
=GO continue
=BU post (save)
/EEND end processing
=Yes select "yes" from message box
=BP park (save)
=ENTR Enter (don't know exactly what is difference between =ENTE or /00)
=AE save when changing document
=BK change document header (parking or posting parked document)
=P+ next page
=BL delete parked document
A BDC_OKCODE indicates which action is (will) be executed on a screen (things like save, back, exit etc). The BU code is used for a SAVE function (like in MM01 transaction). Sorry but I cannot recall to which function ZK maps to. Obviously their difference lies in the fact that they map to different functions. You can still find out which function each button utilizes by using System->Status->GUI status.
By the way, BTCI transactions are not fully robust- minor changes in GUI flow let your program break. Error handling / analysis is tedious.... DId you have a look to posting methods more preferably? E.g. like BAPI_* function modules? With the help of LSMW you can browse for different input methods and use them later standalone. Or you can use transaction BAPI directly.