How to Get TFS Field values dynamically? - c#-4.0

there is a scenario like "I have a field value in TFS which has just been changed by my team member.Can I get the value of that changed field into an application immediately it is changed?".. Pls tell me how to acheive this using C#.net.. thanks in advance

You either want to look into SOAP subscriptions, or writing a tfs server plugin that forwards updates to your app. I'd probably recommend doing the latter of the two options.
Team Foundation Server 2010 Event Handling with Subscribers
If it is imperative that your application not miss any updates (eg you're writing a sync) the you'll probably want to put a servicebus in as the transport between the plugin and your application.
Alternatively you could go with the polling up update approach, looking at each work items history to see if it has changed. Seems like a lot more work, with no real benefit.

Related

Is there a way to restrict CRUD operations on Notes/Domino data using an alternative application?

We have a (super)user who has been using VBA in an Excel spreadsheet to create and manipulate documents in a Domino database application.
The user has 'Editor' access to the application, and should normally be able to create/edit the document contents.
They have been, however, creating documents using VBA. That logic doesn't consider such important document fields as Readers, Authors, etc. .
We would like to restrict access to all Domino data so that it can only be created/modified using an IBM Notes client.
I have tried looking through the ECL, but that only restricts what 'others' do.
Since he has his Notes client available, the external logic is using his normal Notes credentials.
I have tried setting a hidden field with the Notes client and looking for that in the QuerySave event of the form design.
Unfortunately, the external code pays no attention to the form events and the save is executed despite the missing field.
Similarly, the Database Script has no bearing on the execution of external logic.
I was going to inspect the client version upon database open and restrict activity based on a variance in the version (I was hoping!).
I have de-selected the 'Don't prompt for a password...' option in the user security preferences, but that has no effect at all (suspected as much!).
The ONLY thing I have been able to suggest is to hide the database design... That's really only designed to thwart a user's efforts to understand the underlying design.
It won't prevent them from creating hundreds of thousands of documents with a fictitious form and throwing the app into disarray.
I'm hoping that there is a solution out there that I'm missing.
The user has been instructed not to undertake such activity in the future.
We were lucky that there really wasn't any malicious intent - "Just trying to be more efficient" we're told.
The effects of the activity have been remedied, and the user has been warned.
What I want to know is... how can I prevent this from ever happening again?
The circumstances are rare I know, but I would've thought there'd be a means of restricting the platforms used to manage Notes/Domino data.
Is there a way to ensure no external applications are able to access, create or modify Notes database documents?
I am currently focussing on access to Notes via COM.
I thought that, if I unregistered 'nlsxbe.dll' from the registry, that would prevent such activity - It has not.
I also tried removing the .TLB files from the Notes executable folder - removal of 'notes32.tlb' and 'domobj.tlb' have no effect at all. Removal of 'ltsci3.tlb' screws everything up (as expected!).
I'm really having no luck at all - Any/all suggestions would be most appreciated!
I'm not aware of any way to detect that a connection has been made by standalone code instead of by the Notes client, but you do have two paths available to you:
A Domino server add-in that prevents documents from being saved in that particular database if certain criteria aren't met.
An agent that is triggered to run shortly after documents are saved or modified in that particular database. The agent code can delete (or modify, if you prefer) the documents that don't conform to the required criteria.
The server add-in route would normally require coding in C, but thanks to the Open NTF Trigger Happy project, the hard part is done for you, and the rest can be filled in with either LotusScript or Java agent code that is "triggered" by the pre-written C code. You will need to have some basic knowledge of how the Notes Extension Manager interface works, but once you get past that and write your agent code to enforce your data consistency/integrity requirements, the only real hurdle is your willingness to host open source code on your server.
There may be two other possibilities, but I can't say if either will solve or deal with the issue...
In the ECL you can disable 'COM' access for the user (also known as OLE or ActiveX) automation since VBA access is usually via COM. This has stopped Notes using external COM access for me, but I don't know if also prevents VBA using Notes. Additional steps may be needed to enforce the ECL and apply to the specific users.
There is an (old) notes.ini 'DisableExternalApps' (or something similar) that disables some external access. This can affect many things (DDE/Prompts/#dblookups) but again I don't know if this will disable VBA/COM and its not user specific, but server wide.
I would have thought that removing the nlsxbe.dll or restricting access to execute it might work, but the ECL may be the best bet.
Alternatively, rather than add hidden flags to your design (and the documents), and then delete the offending documents, your agent could apply the correct author/reader fields to the documents instead.
Very tricky. Did you find a better solution?

add SSRS pool to SharePoint - few issues

i know this is gonna be a Little akward because the Image i am gonna post is in German,
but essentialy what i am trying to do, is create a Service Pool for Reporting Services,
now it is Very important that i am able to check the last Checkbox so my PowerPivot is gonna work, but i don't know what it is that's making it impossible for me to do so, anybody have any Ideas ?
NOTE: the message sais: There are no Webaplications associated with this SQL Server Reporting Services-Service Application available
Your Help is as always well Appreciated!
Fixed it, by removing the existing Association beetween the SSRS Service with the Web App,
apparently you can only associate one SSRS Service per Time

using mail server to communicate with jira using api

im new to jira and its mail handlers.i want to use the jira's mail handlers to scan two folders in my mail box.and update two projects related to those folders. and i did that.
but now i want to extend that functionality.i want to keep the mails in those folders (stop mail handlers from deleting it after processing) and make it able to move issues/tasks across projects simply by moving the associated mail from the folder to the other folder. resulting in deletion of the original issue/task from that project and creating it in the other folder. please help in making this a possibility.
for those who didnt understand my problem: imagine im sending a cv for the post of php developer to a mail. when the reciepent checks it, he puts it in the php folder in his mailbox.so then a task is created in the project php developers. but next the reciepents thinks im more suitable in web developement rather than in php. so he just moves the mail from php folder to the web folder.so the existing task in php project gets deleted and a new task is created under web developement project. can i do this? if so how? please guide me..
Update
sigh..
i dont know how to work with corporate people. now the situation has changed. i hope you could help me with this one.sorry about the sudden change in the question..again...
now my boss wants sth like this.
i created a mail client using imap function to access mail services and retrieve those mails to a web function. theres no problem in that. but now my boss wants to handle jira through that same app aswell. means as like the my question when moving, putting a mail to a folder the app it self should comunicate with jira and make the necesary issue creation and deletion.. is this possible #Kuf?? if so please help. because my deadline is due Wednesday. and im almost there to panic..lol..please forgive me for changing questions like this. as it is not my will..
edit
I have seen that rest api does this. but how to use it? any answers?
The simplest way I found was to receive the emails in your main account and forward them to a second account, while saving a copy on the mail server. Than, tell Jira to pull the emails from the second email.
UPDATE
In the past, I've looked for a way to change Jira's email handler functionality, as you can see in this question here. It is impossible to achieve what you're asking using Jira's email handler because the way it works, it does not keep records of which emails were already read, Jira's service checks for new emails, ignores emails according the pre-defined filters (spam or user defined), handles the rest of the emails, and deletes them so it won't process them again.
The way I can think of to get the functionality you want is to re-write the email handler, you can get the source code, re-write it, and build it into your Jira app.
Another way, which i find easier, is to get all the emails into Jira, and from within Jira move the issues from one project to another. You can even create pre-defined buttons using Jira Scripting Suite to easily move issues between projects (create a post function and attach it to workflow transition).
If you need any help let me know. Good luck!
EDIT 2
Which Jira version do you use? which actions are you planning to do using the remote API? Jira REST API is the newest, but some of the old APIs have capabilities that are lacking in REST. To try and decide which API suits you, have a a look at JIRA Remote API Reference.
If you decide to use the REST API, I suggest that you read Jira's Getting Started with REST manual, which shows how to use the REST API. For the full documentation check out JIRA REST API documentation (make sure to use the right version according to your Jira version).

SharePoint - Connection String dialog box during FeatureActivated event

Does anyone know if it is possible to display a prompt to a user/administrator when activating or installing a sharepoint feature?
I am writing a custom webpart and it is connecting to a separate database, I would like to allow the administrator to select or type in a connection string when installing the .wsp file or activating the feature.
I am looking inside the FeatureActivated event and thinking of using the SPWebConfigModification class to actually write the connection string to the web.config files in the farm.
I do not want to hand edit the web.configs or hard code the string into the DLL.
If you have other methods for handling connection strings inside sharepoint I would be interested in them as well.
Unfortunately there is no way to swap to a screen where you can get user via the feature activation process. Couple of comments for you:
I'm assuming the connection string is going to be different for every installation, so there is no way you can include it directly in the Solution.
I'm assuming that you couldn't programmatically construct this during installation.
Therefore, you need some way to get user input. Here are a couple of options:
It could be a web part property, though this would mean setting it each and every time the web part was added, and you would need to then maitain those settings individually.
You could build out your own _layouts settings screen (good post: http://community.zevenseas.com/Blogs/Robin/archive/2008/03/17/lcm-creating-custom-application-page-and-using-the-propertybag-more-detailed.aspx), and from there users can maintain the property, storing it in either the Web Property bag, or inside the Web.Config. I try to avoid using the Web.Config where I can, but if you do wish to go this route then MAKE SURE you use the SPWebConfigModification class (Read this great blog: http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32)
Finally, a technique I often use is storing configuration information in a SharePoint List. Chris O'Brien has a great framework for that here: http://www.codeplex.com/SPConfigStore
Hope that helps,
Daniel
Sounds good. I will look at these possible solutions.
I do not think #1 will work since I am deploying multiple webparts inside a single solution which all use the same connectionString.
#3 sounds like a very clean solution. I see the config items are cached so it looks like if I need to store a connection string, I will not be hit with a SP lookup each time I need that string.
While searching for a solution I did stumble across another method.
If you dig around their code, I looks like they have created an installer that accepts application specific values, adds the values into a FeatureTemplate.xml file and passes them to the SPFeatureReceiverProperties object in the Reciever.
I was about to start tackling this method, but I think #3 would be better.
Thank you,
Keith

What's the best way to report errors from a SharePoint workflow?

I have a custom action in a workflow and would like to report an error to the user when something goes wrong. What's the best way of doing that?
UPD: Ideally I would like to put the workflow in the error state and log a message to the workflow log. That doesn't seem possible. What's the closest I can get to it? I want to a reusable solution,something that's easy for users to set up when using my custom action in SharePoint Designer.
Added more details to the question.
#mauro that takes care of storing the error, but how do I display the error to the user in a way which makes sense?
#AdamSane That's seems like a rather fragile solution. It's not a matter of setting this up once on a single site. I need something others can add using SPD.
when you throw the error your error handler can then email the user, or better if the list is massive, add the error state to the workflow item - i think this is default functionality though as the error would be mentioned there.
http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/
Personally I would log it to either a log file or the event log depending on the issue. I think storing it using a users permissions would be a bad idea, what happens if that user does not have the correct rights? or worse still they get elevated permissions by browsing the list in explorer view?
The log file would be the best way, that way you rely only on the file system being available - you dont have to worry about trapping errors happening whilst connecting to the database etc.
Mauro
Add the error to a hidden list with that users name. Set the visibility on the list (for users) to only read/write their own values. Then use a custom web part or FlexListViewer to view the contents of that list and display it to the user. Once they acknowledge that error, remove it from the list.
If necessary, you can add a different workflow action on that message list, that says pause for 2 days and then email. Whatever, depending on your requirements.
Otherwise you can have a custom db table that you use for pretty much the same thing, this way sharepoint does most of the work for you.
Update This can be packaged up as a feature and deployed to each site as needed. The strengths of this approach (adding a list item to a list, querying, alerting a user, and emailing a user) are all built into the sharepoint itself. In this case you can focus on your custom logic only, while letting sharepoint focus on the implementation details.
If you need the user to take some action as a result of the error (e.g. retrying the workflow) is it possible to create a task for that user with information on the error and the location of the workflow?

Resources