Is there a way to listen to the upload events in the EMC's Documentum via .NET API? - documentum

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

Related

How to reference the WCF service by code-behind in UWP?

Now I need to reference a WCF service in a UWP program. However, the address of the WCF service may change frequently in the future.
I don't want to rebuild/republish the project every time when the address change.
So I want to use a LocalSettings to Save/Load the address of WCF service. Every the program begins, it will reload the address from the LocalSettings. And if the address changes, I just only let the customer change the LocalSettings from UI but not need to rebuild/republish the project.
How can I do it? Or there is any other better to do it?
If it's a RESTful service, you could use HttpClient relevant APIs to consume a REST service in UWP.
Please note that REST is a resource that implements a uniform interface using standard HTTP GET, POST, PUT methods that can be located by URI. So, you could use HttpClient to call it in code-behind. You will get response after you send http request, then you could analysis the response result.
The similar thread for your reference: Calling web service asynchronously in page constructor.
Using LocalSettings for such thing is a good solution.
LocalSettings are just a dictionary where you can assign values you want to store and later take out.
ApplicationData.Current.LocalSettings["ServiceAddress"] = "something";
Debug.WriteLine(ApplicationData.Current.LocalSettings["ServiceAddress"]);
Such setting will survive app restart and is stored in applicaton's private storage.
You will probably want to seed this setting with a default value at first startup.

Where to put calls to 3rd party APIs in Apigility/ZF2?

I have just completed my first API in Apigility. Right now it is basically a gateway to a database, storing and retrieving multi-page documents uploaded through an app.
Now I want to run some processing on the documents, e.g. process them through a 3rd party API or modify the image quality etc., and return them to the app users.
Where (in which class) do I generally put such logic? My first reflex would be to implement such logic in the Resource-Classes. However I feel that they will become quite messy, obstructing a clear view on the API's interface in the code and creating a dependency on a foreign API. Also, I feel limited because each method corresponds to an API call.
What if there is a certain processing/computing time? Meaning I cannot direct respond the result through a GET request. I thought about running an asynchronous process and send a push notification to the app, once the processing is complete. But again, where in the could would I ideally implement such processing logic?
I would be very happy to receive some architectural advice from someone who is more seasoned in developing APIs. Thank you.
You are able to use the zf-rest resource events to connect listeners with your additional custom logic without polluting your resources.
These events are fired in the RestController class (for example a post.create event here on line 382).
When you use Apigility-Doctrine module you can also use the events triggered in the DoctrineResource class (for example the DoctrineResourceEvent::EVENT_CREATE_POST event here on line 361) to connect your listeners.
You can use a queueing service like ZendQueue or something (a third party module) built on top of ZendQueue for managing that. You can find different ZF2 queueing systems/modules using Google.
By injecting the queueing service into your listener you can simply push your jobs directly into your queue.

Invoke WCF Workflow Service using different endpoint addresses

I created a Workflow Foundation workflow which will eventually invoke another Workflow Service. I added the call to this service by dragging the appropriate shape from the toolbox onto the designer. The shape was available because I added the Workflow Service as a service reference as recommended.
How can I specify a specific endpoint address for this web service? I can't find a way to programmatically specify the address.
The workflow always uses the address specified in the web.config. But based on certain conditions I want to use different addresses.
Edit
Here is a picture I created to illustrate the problem:
Look for the place where you make a call to the Workflow Service. Somewhere there you define a client. It should look something like this:
client.InvokeService(); // or whatever method you call;
If you want to change address you should change endpoint address before this call, ideally when you define the client:
client.ChannelFactory.Endpoint.Address = new EndpointAddress("http://something.com/service.wsdl");
But keep in mind that this is not recommended practice. If you intend to change it programmatically it's better to get rid of services section in your web.config completely and set properties programmatically when creating client.

store data inside WCF service and extract it later by the client

i have an Autocomplete ajax control that calls a WCF service method automatically.
this method gets a string as an input parameter and return a list of strings.
i don't make that call from the client , the control does it, but i write the content of this method.
Can i store some data somewhere in the WCF service when that method is called and extract it later when i use the WCF from the client ?
i mean , i want the control to call the method, in the method i'll store some data and later when i use the WCF client object i'll extract it.
is there such "WCF cache" mechanism?
No, there's no such thing as a 'WCF cache' mechanism. But WCF is .NET, and in a .NET application you can use the Caching Application Block.
Caching has very little if anything to do with WCF. You cache inside your application, but the caching mechanism for a WCF service is fundamentally the same as a Windows Forms application or a managed Windows Service (or an ASMX webservice, or a ASP.NET application, or any .NET application). The only difference is how you use and rely on the cache & how the applicaton's lifecycle is managed.
If your WCF service is hosted in IIS (as is very popular), then when the application pool is recycled (or the website is restarted) you will lose everything in the cache. Will this be a problem?
The typical use case for a cache is when you have a set of data stored (in, say, a database) that will need to retrieved over and over again. Rather than get from the database everytime, you get from the cache. If it's not in the cache, you get from the database and put it in the cache so it's there for next time. It sounds like you want to store some data from the client application in the cache. You can do this, but what will happen if it's not there when you go to retrieve it.

WCF customizing metadata publishing

I have a universal service hosted on IIS7 that accepts a Message and returns Message ( with Action="*"). This service still publishes meta for the clients.
This metadata is explicitly specified using LocationUrl property in ServiceMetadataBehavior.
We have a requirement that the metadata can change during lifetime of the service, so in essence metadata has a lifetime.
I tried adding IWsdlExportExtension to the service endpoint behavior, but the ExportEndpoint method only gets called once (when the service is loaded first time). Is there a way for me to invalidate the loaded metadata so that anytime there is a call for wsdl using HttpGet, the behavior gets called ?
What you are asking for (changing the published service definition at runtime) is not possible - you need to remove the requirement which specifies that the metadata can change over time.
Once you've published a service, the only reason the service specification should change is because the service has been upgraded.
You should look closer at the business requirement which is making this technical requirement necessary, and try to find another way to satisfy it (perhaps post in programmers.stackexchange). Perhaps you can have multiple services available, and switch between the services over time - but this is a bit of a stab in the dark without knowing the business requirement.
No there is no way. Moreover if you needed you are up to your fully custom solution because this is out of scope of web services. Changing metadata means changing the service itself = its internal logic which always result in restarting the hosting process and publishing new metadata.