If there is simply replacement of documents going on and the logic can be broken up, then you can create a transformation connector to create a new RepositoryDocument from an existing one. If you are doing something similar to what Matteo is trying to do in CONNECTORS-989, then that's a good indication that CONNECTORS-989 should be completed.
In other words, it sounds like you are trying to do something that should have framework support, but unless the use case is described more fully, I won't be able to understand how best to do that. Thanks, Karl On Mon, Jul 7, 2014 at 8:50 AM, Alessandro Benedetti < [email protected]> wrote: > I don't think that having multiple output connections per pipeline is > satisfying our requirement. > I need to apply some logic and then eventually send to one output connector > a delete or maybe an update. > THe custom logic will generate new RepositoryDocuments on the fly > As I wrote in the previous mail, any idea to elegantly instantiate proper > activities ? > Thank's again for all the effort to follow my custom developments :) > > > > 2014-07-07 12:29 GMT+01:00 Karl Wright <[email protected]>: > > > Hi Alessandro, > > > > Based on your description, it would seem to me that having multiple > output > > connections per pipeline would meet your design goals without any > > additional framework changes. Since that was added in trunk and will be > > available in 1.7, I am wondering what else you can tell us that might > show > > why that is not sufficient? > > > > Karl > > > > > > On Mon, Jul 7, 2014 at 6:43 AM, Alessandro Benedetti < > > [email protected]> wrote: > > > > > As I told you before : > > > I have a custom Ouput Connector. > > > This custom Output Connector ha a collection of OutputConnectors > inside. > > > So simply when I have a deleteDocument, I have to do my logic and send > > some > > > addOrUpdateDocument and deleteDocument to the OutputConnectors from the > > > collection . > > > > > > But the deleteDocument and addOrUpdate have incompatible signatures, so > > due > > > to this I can not elegantly call the addOrUpdate. > > > The main problem is the discordance of IOActivities between what i have > > in > > > my removeDocument and what I have in removeDocument and > > > addOrReplaceDocument for the generic baseOutputConnector. > > > > > > So ideally what I need it to build and IOutputAddActivity from the > > > IOutputRemoveActivity in the proper way. > > > > > > Thank you again for your attention > > > > > > > > > > > > 2014-07-07 11:04 GMT+01:00 Karl Wright <[email protected]>: > > > > > > > Hi Alessandro, > > > > > > > > As stated I don't have a good answer for you. If you tell me more > > > broadly > > > > what you are trying to do I may be able to propose something better. > > > > > > > > Karl > > > > > > > > > > > > > > > > On Mon, Jul 7, 2014 at 5:33 AM, Alessandro Benedetti < > > > > [email protected]> wrote: > > > > > > > > > Hi Karl, > > > > > thank you for the support but your solution is not possible, > because > > > my > > > > > case is the following : > > > > > > > > > > *Custom Output Connector* > > > > > removeDocument is calling the addOrReplaceDocument method in a > > generic > > > > > BaseOutputConnector. > > > > > addOrReplaceDocument is calling the the addOrReplaceDocument method > > in > > > a > > > > > generic BaseOutputConnector. > > > > > > > > > > So in this scenario the only way to follow your strategy should be > to > > > > > create in the BaseOutputConnector and in all the implementations > the > > > new > > > > > method accepting the "in common" ancestor for the activity Class. > > > > > > > > > > But i don't want to do this, because I don't want to hack the other > > > > > Manifold code ... > > > > > > > > > > So I know that the hierarchy of activities is quite coupled with > the > > > > > function they are tracking. > > > > > Which can be the most elegant solution karl in your opinion to > > satisfy > > > > this > > > > > requirement ? > > > > > > > > > > Right now in the removeDocument I use a EmptyOutputAddActivity > > > implements > > > > > IOutputAddActivity ( custom class) > > > > > But would be great to achieve the same using some standard manifold > > > > > structure. > > > > > > > > > > Cheers > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2014-07-02 11:31 GMT+01:00 Karl Wright <[email protected]>: > > > > > > > > > > > Hi Alessandro, > > > > > > > > > > > > You cannot just cast because there are different services in each > > > > > > interface. However, they are derived from common interfaces. > For > > > > > example, > > > > > > > > > > > > public interface IOutputAddActivity extends > > > > > > > IOutputQualifyActivity,IOutputHistoryActivity,IOutputCheckActivity > > > > > > > > > > > > public interface IOutputRemoveActivity extends > > IOutputHistoryActivity > > > > > > > > > > > > > > > > > > The only one in common is IOutputHistoryActivity, so as long as > > your > > > > > > addOrReplace method is calling IOutputHistoryActivity methods > only, > > > you > > > > > can > > > > > > write a second method that accepts just IOutputHistoryActivity > and > > > call > > > > > > that from addOrReplace AND from deleteDocument. > > > > > > > > > > > > Karl > > > > > > > > > > > > > > > > > > On Wed, Jul 2, 2014 at 6:13 AM, Alessandro Benedetti < > > > > > > [email protected]> wrote: > > > > > > > > > > > > > 2014-07-02 11:04 GMT+01:00 Karl Wright <[email protected]>: > > > > > > > > > > > > > > > Hi Alessandro, > > > > > > > > > > > > > > > > The "activities" metaphor is simply to make available > > appropriate > > > > > > > framework > > > > > > > > services to specific connector methods. The metaphor is good > > for > > > > > > > > ManifoldCF because it allows services to be added in new > > releases > > > > > > without > > > > > > > > upsetting backwards compatibility etc. > > > > > > > > > > > > > > > > If you have a "deleteDocument" implementation that is trying > to > > > > call > > > > > an > > > > > > > > "addOrReplaceDocument" method, this can *only* work if the > > > services > > > > > you > > > > > > > are > > > > > > > > using in the addOrReplaceDocument method do not include any > of > > > > those > > > > > > that > > > > > > > > are not in IOutputDeleteActivity. If that is the case, you > > > should > > > > be > > > > > > > able > > > > > > > > to write a common method which accepts the appropriate common > > > > parent > > > > > > > > interface of IOutputAddActivity and IOutputDeleteActivity. > If > > > not, > > > > > you > > > > > > > > will have to rethink how you are doing this. > > > > > > > > > > > > > > > > > > > > > > Ok, assuming I don't want to include any further services. > > > > > > > I have in the deleteDocument, the IOutputDeleteActivity but the > > > > > > > addOrReplaceDocument is taking the IOutputAddActivity. > > > > > > > Which is the proper way to instantiate IOutputAddActivity from > > > > > > > the IOutputDeleteActivity ? > > > > > > > Because they are different interfaces and i don't know exactly > > > which > > > > > > > implementation arrives there, should I do a hardcoded casting ? > > > > > > > Or what else? > > > > > > > Thank you very much for your time, > > > > > > > > > > > > > > Cheers > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > Karl > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wed, Jul 2, 2014 at 5:17 AM, Alessandro Benedetti < > > > > > > > > [email protected]> wrote: > > > > > > > > > > > > > > > > > Hi guys, > > > > > > > > > I'm trying to implement a specific logic in a custom output > > > > > connector > > > > > > > > > where, under specific conditions, in the deleteDocument > > method > > > is > > > > > > then > > > > > > > > > called an AddOrUpdate method. > > > > > > > > > > > > > > > > > > This can happen when the deletion of a document causes the > > > > update > > > > > of > > > > > > > > other > > > > > > > > > documents already indexed. > > > > > > > > > I know is a very specific use case, but let's see if there > > is a > > > > > > > solution > > > > > > > > > ... > > > > > > > > > So far no problem until I reach the Activities management > ... > > > > > > > > > I found the hierarchy of this objects really confusing, > with > > a > > > > lot > > > > > of > > > > > > > > > interfaces and different inner classes sparse in the code. > > > > > > > > > > > > > > > > > > Furthermore it appears to be really hard to create an > > > > > > > > *IOutputAddActivity* > > > > > > > > > object where you have a IOutputDeleteActivity. > > > > > > > > > > > > > > > > > > What can be the best way to instantiate correctly an > > > > > > > > > *IOutputAddActivity *inside > > > > > > > > > the DeleteDocument method *?* > > > > > > > > > Why this activities objects that seems a sort of > > > logging/tracking > > > > > > > feature > > > > > > > > > is such coupled with the logic ? > > > > > > > > > > > > > > > > > > Thank's for the help > > > > > > > > > -- > > > > > > > > > -------------------------- > > > > > > > > > > > > > > > > > > Benedetti Alessandro > > > > > > > > > Visiting card : http://about.me/alessandro_benedetti > > > > > > > > > > > > > > > > > > "Tyger, tyger burning bright > > > > > > > > > In the forests of the night, > > > > > > > > > What immortal hand or eye > > > > > > > > > Could frame thy fearful symmetry?" > > > > > > > > > > > > > > > > > > William Blake - Songs of Experience -1794 England > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > -------------------------- > > > > > > > > > > > > > > Benedetti Alessandro > > > > > > > Visiting card : http://about.me/alessandro_benedetti > > > > > > > > > > > > > > "Tyger, tyger burning bright > > > > > > > In the forests of the night, > > > > > > > What immortal hand or eye > > > > > > > Could frame thy fearful symmetry?" > > > > > > > > > > > > > > William Blake - Songs of Experience -1794 England > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > -------------------------- > > > > > > > > > > Benedetti Alessandro > > > > > Visiting card : http://about.me/alessandro_benedetti > > > > > > > > > > "Tyger, tyger burning bright > > > > > In the forests of the night, > > > > > What immortal hand or eye > > > > > Could frame thy fearful symmetry?" > > > > > > > > > > William Blake - Songs of Experience -1794 England > > > > > > > > > > > > > > > > > > > > > -- > > > -------------------------- > > > > > > Benedetti Alessandro > > > Visiting card : http://about.me/alessandro_benedetti > > > > > > "Tyger, tyger burning bright > > > In the forests of the night, > > > What immortal hand or eye > > > Could frame thy fearful symmetry?" > > > > > > William Blake - Songs of Experience -1794 England > > > > > > > > > -- > -------------------------- > > Benedetti Alessandro > Visiting card : http://about.me/alessandro_benedetti > > "Tyger, tyger burning bright > In the forests of the night, > What immortal hand or eye > Could frame thy fearful symmetry?" > > William Blake - Songs of Experience -1794 England >
