getWorkItemRelations() not always return active data - tfs

I have a custom control that shows the hyperlinks related to the active Work item. To do this, I call the getWorkItemRelations() and almost always works fine. My problem is when I delete a Link and the refresh in my custom control is called the result array includes the deleted "Links". In the Link tab the deleted Link was removed.
I review the resulting array for a flag that indicates if the Link was deleted but it doesn't exists.
Also, I put a button to refresh the data in my custom control but the result is the same.
Are there a way that I can force to full reload the relationships for the Work Item?

This phenomenon maybe related to the data caches on client computers. You could give a try with refresh the Work Item Cache.
To update the cache for tracking work items, you invoke the
StampWorkitemCache Web method. This method forces client computers to update the cache the next time that they connect to the
application-tier server. This method also synchronizes the workspaces
that are defined on the client computers.
To refresh the cache for tracking work items on client computers:
On the new server, open Internet Explorer.
In the Address bar, enter the following address to connect to the
ClientService web service:
http:// PublicURL/VirtualDirectory :8080/WorkItemTracking/v3.0/ClientService.asmx
Choose StampWorkitemCache, and then choose Invoke.
Note: To invoke the StampWorkitemCache Web method, you must be a member of the Administrators security group on the application-tier server for Team Foundation.
More details info about the method please refer the official documentation: Refresh the Work Item Cache
Update
Every changes on the work item need to be saved. Unlike UI on the web,it's not a real-time display. You need to save the work item , then refresh in your custom control .

Related

getting 'Duplicate resource' error after I created 2 transport requests in CDS

I created two transport requests (TR) for same project while making changes in CDS views after that a duplicate resource error with error code 400 is showing and I'm unable to get any data in my UI5 table.
I transferred the changes which was locked in new TR to old TR but it is still giving the same error.
HTTP request failed400,Bad Request,{"error":{"code":"/IWBEP/CM_MGW_RT/030","message":{"lang":"en","value":"Duplicate resource"},"innererror":{"application":...
First of all: Double check if there's actually no duplicate key by reading the underlying SQL view (annoted in the CDS definition #AbapCatalog.sqlViewName) using the transaction se16 (n/h).
If there are really no duplicates in the SQL view, the error can be caused by various bugs in the ABAP CDS framework. These bugs mostly do occur after you changed a CDS source/definition. Here a few of them:
Open transaction segw and refresh the entity structure by right clicking "refresh all".
.
Afterwards click on the red white beachball to regenerate the MPC/DPC classes.
What the red white beachball actually does is kind of merging a the changed structure with the existing classes. Right click on the project and choose "Generate runtime" to really re-generate all of the runtime objects.
Sometimes there's a clean up button in the entities overview. Click it.
In transaction /iwfnd/gw_client choose Metadata→Cleanup Cache→On both systems
Cleaning the cache works quite well for OData views that have been manually created from ABAP types in segw but Core Data Services might still be cached. In case none of the above helped:
logout and login again
restart the transaction
wait for an hour or two
Try to manually test the failing OData request directly in /iwfnd/gw_client. You can activate logging in /iwfnd/traces to double check what the requests from your client actually look like.
Check your OData client. Does it maybe internally cache the $metadata?
Check that the transport request was successfully processed, using e.g. transaction se10. Transports/Imports to another system might be blocked by long running SADL queries. Kill them using sm50 if necessary.

Umbraco automatic update

I need some help with umbraco.
Let's say that I have an umbraco grid with a custom editor, just like the one in this tutorial: https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/build-your-own-editor
Ok, so I wrote this editor to build a gallery of items with image/title, I get the item list from an api call made by an angular service and this works fine when I publish the page by hand. What I want is to automatically update this gallery with new items where available, so my idea was to make a timed ajax call, let's say every hour, to update the items. But sadly this doesn't work, I suppose that the call is made but the list isn't updated.
Any suggestion? Thanks
You need to handle this differently. Right now it sounds like what you have is an implementation that works when you are browsing to this node in the backoffice using your browser and the browser makes the API calls through Angular. This all happens in your UI and when you manually hit save/publish - the data in the UI gets saved. Keep in mind that this is basically your browser doing the "work" - and this (and all other Angular code) will of course only ever run while your browser is open, in the backoffice, viewing this node.
What you want to do is to have this run automatically (and preferably in some sort of background task) to ensure that you do not really have to open up the backoffice for this to actually be automatically updated over time.
You need to create some sort of background job running on the server-side instead. This would have to be done in C# and I would recommend looking into Hangfire or Quartz frameworks to handle all the scheduling/making sure the job runs.
This job/task should do the external API calls in C# and transform the result into the same format as the format you are saving when you save data from the manual update. Then fetch the content nodes you need to update using the ContentService API and update the specific property values on those nodes. When this is done you need to make sure the changes are saved and the node is then republished with its updated data. All of this is done through the ContentService.

Storing array of data in cache iOS Swift

In my app, i get the menu of the app through a web service. It around 423 number of records which changes rarely. What I need is to cache this record in the app after first time login and use the cached data. If there is any changes in the menu database then only it should refresh the menu content from web service again.
I am not very sure how i can achieve this. Currently I store all the records in an array of menu class and use directly, which is very time consuming as we are hitting the service call again and again for similar record. I am new to iOS development so any suggestions are most welcome.
Thanks!
Store the data in one of NSUserDefaults (if this is infrequent, but permanent config data), or NSCache (for ephemeral data), or CoreData (for permanent, performance-dependent data).
Load this cached data on app launch; if the cached data doesn't exist, retrieve it from your web service/API.
If you're not concerned with the data being up to date immediately after you change the menu content, use something like the Cache-Control header to set an invalidation time period (details). If you do want to ensure that the menu updates as soon as a new remote version is available, then you'll need to set up a versioning system where your app makes an API call to check the version of the menu and update if required.
Example scenario:
App launch
Load menu content from NSUserDefaults/CoreData/NSCache
Asynchronously check API for menu version
If new version of menu exists, asynchronously download and refresh the menu view
Save updated version of menu back to NSUserDefaults/CoreData/NSCache.

MOSS 2007: How to programmatically store web part properties for a user?

I have a web part which shows data in one of 3 different formats. The format is selected by clicking one of 3 buttons in the web part. This works fine.
A request has come through to store the last selected state so that the user does not always have to click their favourite view.
It seemed logical to define a Property and define Personalizable(PersonalizationScope.User) but this does not seem to work for most users as they only have Read rights for the page.
What is the best way forward here? Is Sharepoint the right place to store such info or should I be using my own storage?
Thanks
Using your own storage is an option but this means its some more development work for you. How about this option.
Modify your WebPart and add the option to the Web Part property.
Create a new permission level and add the following permission
Update Personal Web Parts - Update
Web Parts to display personalized
information.
This will make sure that users with read only access can only update webparts.
Step 2 will allow them to odify all webparts. You can modify each webpart and remove the following option for webparts which you dont want you users to edit.
Allow Editing in Personal View [Advanced]
This way you can lock all webparts except the one you want.

iPhone Data Best Practices - caching vs remote

I'm developing an iPhone app that uses a user account and a web API to get results (json) from a website. The results are a list of user's events.
Just looking for some advice or strategies - when to cache and when to make an api call... and if the iPhone SDK has anything built in to handle these scenarios.
When I get the results from the server, they populate an array in a controller. In the UI, you can go from a table listing view, to a view of an individual event result - so two controllers share a reference to the same event object.
What gets tricky is that a user can change the details of an event. In this case I make a copy of the local Event object for the user's changes, in case they make an error. If the api call successfully goes through and updates that event on the server, I take these local changes from the Event copy and set the original Event object to match with setters.
I have the original controller observing if any change is made to the local Event object so that it can reflect it in the UI.
Is this the right way of doing things? I don't want to make too many API calls to reload data from the server, But after a user makes an update should I be pulling down the list again with the API call?
...I want to be careful that my local objects don't become out of sync with the remote.
Any advice is appreciated.
I took a similar approach with an app I built. I simply made a duplicate version of the remote data model with Core Data, and I use etags on the backend to prevent sync issues (in my case, it's okay to create duplicate records).
It sounds like you're taking a good approach to this.
Some time back, I developed an iOS app where in, I had almost same requirement to store data on server as well as locally to avoid several network call and also user can see their information without any delay.
In that app, user can store photos, nodes, checkIns and social media post and with all this data, app can form a beautiful timeline. So what we did was, we had everything locally and whenever user phone come in some WIFI zone, we start uploading that data to server and sync both (local and remote) databases.
Note this method works well when only one user can access this data.

Resources