Return-Path: X-Original-To: apmail-manifoldcf-dev-archive@www.apache.org Delivered-To: apmail-manifoldcf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0054114E2 for ; Mon, 7 Jul 2014 10:44:24 +0000 (UTC) Received: (qmail 89930 invoked by uid 500); 7 Jul 2014 10:44:24 -0000 Delivered-To: apmail-manifoldcf-dev-archive@manifoldcf.apache.org Received: (qmail 89880 invoked by uid 500); 7 Jul 2014 10:44:24 -0000 Mailing-List: contact dev-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list dev@manifoldcf.apache.org Received: (qmail 89867 invoked by uid 99); 7 Jul 2014 10:44:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2014 10:44:24 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of benedetti.alex85@gmail.com designates 209.85.128.172 as permitted sender) Received: from [209.85.128.172] (HELO mail-ve0-f172.google.com) (209.85.128.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2014 10:44:19 +0000 Received: by mail-ve0-f172.google.com with SMTP id jz11so3901987veb.3 for ; Mon, 07 Jul 2014 03:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zrwRjWvvzFFaa0MjDALlSc+WCatKlpJs8NawafsA/tA=; b=PnqUg2ApdYPQdFhsE7COEyhSQERhwq9zQxwzRq9Sw9vnqPMrt/30XE/d73je6y/5t0 nw37y20/xSDvl/W5TpSgCDXGFAOU7dmU4/qSpTepcRgdjMyJTfOWFWqaKDOhulqgeyzi UhGfMkaPBiTRFyL1SY+h/D8hdacuNhBsjwp5tngzoWQiJ/6TJqOIMkWBl0mM7S2hXMB+ feUgJVFlbNM0iRzQbVeDvKIOy7aeh2Zd3UtYY2KGem928s7DfvZBPhsVti8FsefQxDJK IP6ozahHp3uZxV3ubAYqmHQzQfwxR6dC8G+IC8oRIDH8n+S1Cgf/12peGbWMUwD4XBFs sQ6Q== MIME-Version: 1.0 X-Received: by 10.52.135.7 with SMTP id po7mr7661387vdb.50.1404729839017; Mon, 07 Jul 2014 03:43:59 -0700 (PDT) Received: by 10.58.111.74 with HTTP; Mon, 7 Jul 2014 03:43:58 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Jul 2014 11:43:58 +0100 Message-ID: Subject: Re: [Io Activity] Doing an update inside a delete document From: Alessandro Benedetti To: dev Content-Type: multipart/alternative; boundary=bcaec52c637d0f67dc04fd98275f X-Virus-Checked: Checked by ClamAV on apache.org --bcaec52c637d0f67dc04fd98275f Content-Type: text/plain; charset=ISO-8859-1 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 : > 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 < > benedetti.alex85@gmail.com> 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 : > > > > > 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 < > > > benedetti.alex85@gmail.com> wrote: > > > > > > > 2014-07-02 11:04 GMT+01:00 Karl Wright : > > > > > > > > > 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 < > > > > > benedetti.alex85@gmail.com> 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 --bcaec52c637d0f67dc04fd98275f--