I wanted to create a custom webpart with acts as both consumer and provider.
So I want my custom webpart to act as a bridge between two OOB sharepoint webparts.
WP1 -> WP2 -> WP3
I want to get the data from WP1 and wanted it to manupulate it and then send it to WP3 for filtering.
My issues are :
I want the provider to provide data to WP3 only after WP1 send the data to consumer. Is that possible ?
How can I send the data (received from WP1) from consumer class to provider class ?
Can anybody help ? or can suggest some alternative solution ?
You will need to implement both the consumer and the provider interfaces on the web part. This will allow both of the OOB webparts to talk to your web part. Since WP2 won't be sending a value until you set a filter, WP3 will probably display everything; to work around that you will have to set the default value that WP2 sends to WP3 to something that will force not data to appear (what that value is depends on what webparts you are using). Some sort of null value will probably work. That help?
Related
i need to implement a windows service that connects to EMC's Documentum and receives an event every time a document is loaded.
The event should contain the reference to the document itself.
Is there a way to do it via API or do i have to do polling using a web service?
Quickest would be to implement this via polling.
Your Windows service can either
access DFS exposed service (that you need implement on DCTM side)
access docbase directly using DFC/.NET
But the question here is what is that you want to check?
Document loaded - If you are referring to dm_document object created (e.g. by a user/system or some sort of upload functionality) - you will need to register dm_audittrail for that event. Once that is in place your service or API call can check for dm_audittrail entries.
Alternatively you could use Documentum BOF (Business Object Framework) to write custom code that would be triggered every time for instance new document is being crated (or updated) - i.e. on specific predefined event.
This custom code could do whatever you like, like for instance broadcast JMS message to a queue that your Windows Service is listening. You see to implement the thing that you want (event based notification) you need some communication channel between your application and a content server.
Or simply just poll Docbase it every x seconds.
Guess you already know this but a lot of info can be found on:
https://community.emc.com/community/edn
Also BOF Guide (older version): https://developer-content.emc.com/developer/downloads/BusinessObjectsDevelopersGuide.pdf
I think you can use Rest Service. Documentum whole functionality exposed in rest service. https://community.emc.com/community/labs/archivedprojects/dctm_rest
I'd read it somewhere that whenever one needs to do data intensive work then Webapi could be used. Ex: autocomplete textbox where we get data from using ajax on key press.
Now someone told me that Webapi shouldn't be used within applications which are not externally accessed. Rather action should be used to the same work as it is capable of returning the data back in a similar fashion to webapi.
I'd like to know your suggestions over it.
Depends on how you look at it. If all you need is ajax-ification of your controller actions, then you really don't need Web-API. Your actions can return a JsonResult and it is very easy to consume that from your client side through an AJAX call.
Web-API makes it easy for you to expose you actions to external clients. It supports HTTP protocol and Json and XML payloads automatically, out of the box, without you writing the code for it. Now, there is nothing preventing you from consuming the same Web-API actions from your own internal clients in an AJAX manner.
So the answer to your question depends on your design. If you don't have external clients, then there is no string need for you to have Web-API. Your standard controller actions can do the job.
Im connecting to a multi-tenant database through an odata service (my client is an iOS app, using the obj-c OData SDK). My question is, is there a way to apply a global filter to all data calls. Every data call should be filtered by TenantID=?, so instead of going to every single data call and adding TenantID=? to the filter string (My app is already developed for single database and am now refactoring it for multi-tenant), i was just hoping there is a way to catch it in say the OnBeforeSend event and manipulate the URL to add the filter. So therefore all data calls are filtered. Any ideas? Or any suggestions on approaching this?
Thanks in advance
There's nothing wrong with that approach.
Another approach, which may not be applicable in your situation, is to filter it on the Odata side using change and query interceptors.
Greetings!
I am using a WCF library on an application server, which is referenced by an IIS server (which is therefore the client). I would like to put my validation in a place so that I can just call .Validate() which returns a string array of errors (field too short, missing, etc). The problem is, such functions don't cross the WCF boundary and I really don't want to code the same logic in the WCF service and in IIS/WCF client. Is there a way to use extension methods or something similar so both side can use use a .Validat() method which calls the same code?
Many thanks for any ideas!
Steve
If you control both sides of the wire, i.e. the server-side (service) and the client-side, then you could do the following:
put all your service and data contracts into a shared assembly
reference that "Contracts" assembly from both the server and the client
manually create the client proxy (by deriving from ClientBase<T> or by creating it from a ChannelFactory<T>) - do not use "Add Service Reference" or svcutil.exe!
put all validation logic into a shared assembly
reference that shared validation assembly from both projects
If you want to use a shared validation assembly, you must make sure the data types used on your server and client are identical - this can only be accomplished if you also share service and data contracts. Unfortunately, that requires manual creation of the client proxy (which is really not a big deal!).
If you'd use "Add Service Reference", then Visual Studio will inspect the service based on its metadata, and create a new set of client-side objects, which look the same in terms of their fields and all, but they're a separate, distinct type, and thus you wouldn't be able to use your shared validation on both the server-side and the client-side objects.
Do you have a problem with sending the data over to the server to be validated? In other words, your service interface actually offers the "Validate" method and takes a data contract full of data, validates it and returns a List where T is some kind of custom ValidationResult data contract that contains all the info you need about validation warnings/errors.
In a service architecture, you can't trust the client, who could theoretically be some other company altogether, to have done proper data validation for you. You always need to do it at the service layer and design for communication of those validation issues back to your client. So if you're doing that work at the server anyway, why not open that logic up to the clients so they can use it directly? Certainly the clients can (should) still do some kind of basic input validation such as checking for null values, empty strings, values out of range, etc, but core business logic checks should be shipped off to the service.
I have a method with custom attribute in my service. I want to read the attributes of the calling method on the server side and check if it has that attribute. How can I accomplish this?
Thanks.
You cannot - the server side cannot go back to the client and read attribute in its code. After all - these could be on different machine, potentially even using different programming languages and system. How is a Java server going to read your .NET client attribute?
Check out figure showing the WCF archicture: on the left, you have the client, on the right, the server, and all that's holding the two together is the messages being exchanged. They have no other link.
What you could do is send along a custom header from the client to the server - then, your server - no matter what it is - can read that custom header in the message and act accordingly.
Messages are being passed between client and server - that's all the connection the two sides have. Anything in the message (and its headers) can be examined by the server - anything else cannot be checked.
Marc
I resolved this by simply implementing IParameterInspector instead. As the documentation states, parameter inspector works on operation level.