You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2011/05/19 15:02:13 UTC

Re: svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/

On Thu, May 19, 2011 at 1:41 PM, <sl...@apache.org> wrote:

> Author: slaws
> Date: Thu May 19 12:41:09 2011
> New Revision: 1124713
>
> URL: http://svn.apache.org/viewvc?rev=1124713&view=rev
> Log:
> Bit of renaming to be clear this is about looking at the domain rather then
> being the domain.
>
>

> +    // copied from domain node
> +    public Composite getDomainComposite(String domainName) {
> +        FactoryExtensionPoint factories =
> DomainViewRunner.extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class);
> +        AssemblyFactory assemblyFactory =
> factories.getFactory(AssemblyFactory.class);
> +        Composite domainComposite = assemblyFactory.createComposite();
> +        domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS,
> domainName));
> +        domainComposite.setAutowire(false);
> +        domainComposite.setLocal(false);
> +        List<Composite> domainIncludes = domainComposite.getIncludes();
> +        Map<String, List<String>> runningCompositeURIs =
> DomainViewRunner.domainRegistry.getRunningCompositeURIs();
> +        for (String curi : runningCompositeURIs.keySet()) {
> +            for (String compositeURI : runningCompositeURIs.get(curi)) {
> +
>  domainIncludes.add(DomainViewRunner.domainRegistry.getRunningComposite(curi,
> compositeURI));
> +            }
> +        }
> +        return domainComposite;
> +    }
>
>
So you don't have to copy it I've just moved this code from NodeImpl to be
in the DomainRegistry.

   ...ant

Re: svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/

Posted by Simon Laws <si...@googlemail.com>.
>
> Mmm. There is the getQNameDefinition method on the Node interface which is
> supposed to help with that. The spec section says:
>
>      * 4695 10.7.4 get QName Definition
>      * 4696 In order to make sense of the domain-level composite (as
> returned by get Domain-Level Composite), it
>      * 4697 needs to be possible to get the definitions for named artifacts
> in the included composites. This
>      * 4698 functionality takes the supplied URI of an installed
> contribution (which provides the context), a supplied
>      * 4699 qualified name of a definition to look up, and a supplied symbol
> space (as a QName, e.g.
>      * 4700 wsdl:PortTypeportType). The result is a single definition, in
> whatever form is appropriate for that
>      * 4701 definition type.
>
> I've not yet implemented getQNameDefinition but did intend to, using the
> above domain Composite i guess it would be something like the following to
> get at the helloworld Composite:
>
>    getQNameDefinition("helloworld", new QName("http://sample",
> "helloworld"), "composite")
>
> Or are you thinking of doing something else?
>
>    ...ant
>
>

I think that's part of it, and that will help also when just browsing
to the leaf nodes of the contribution hierarchy. The other thing that
I had in mind was that it would be useful to be able to flatten the
domain composite so the user can see it all. But maybe that only works
in the browser view where it would be useful for the user to be able
to navigate the structural hierarchy of the domain composite. If we
tried to print this out as xml though you'd end out with things
like...

<component>
   <implementation.composite>
       <component>
       etc.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/

Posted by ant elder <an...@apache.org>.
On Thu, May 19, 2011 at 2:29 PM, Simon Laws <si...@googlemail.com>wrote:

> >
> > Note also that the current code doesn't seem to work perfectly yet as its
> > not including the xmlns="
> http://docs.oasis-open.org/ns/opencsa/sca/200912"
> > attribute, I've not debugged it so not sure it thats a problem in the
> > getDomainComposite method or Utils.modelToXML.
> >
> > An example is:
> >
> > <composite autowire="false" name="DomainCompositeTestCase"
> > targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
> >    <include name="ns1:helloworld" xmlns:ns1="http://sample"/>
> > </composite>
> >
> >    ...ant
> >
>
> Ok, not actually sure how useful this version with includes in it is
> but I know it's what the spec suggests.
>
>
>
Mmm. There is the getQNameDefinition method on the Node interface which is
supposed to help with that. The spec section says:

     * 4695 10.7.4 get QName Definition
     * 4696 In order to make sense of the domain-level composite (as
returned by get Domain-Level Composite), it
     * 4697 needs to be possible to get the definitions for named artifacts
in the included composites. This
     * 4698 functionality takes the supplied URI of an installed
contribution (which provides the context), a supplied
     * 4699 qualified name of a definition to look up, and a supplied symbol
space (as a QName, e.g.
     * 4700 wsdl:PortTypeportType). The result is a single definition, in
whatever form is appropriate for that
     * 4701 definition type.

I've not yet implemented getQNameDefinition but did intend to, using the
above domain Composite i guess it would be something like the following to
get at the helloworld Composite:

   getQNameDefinition("helloworld", new QName("http://sample",
"helloworld"), "composite")

Or are you thinking of doing something else?

   ...ant

Re: svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/

Posted by Simon Laws <si...@googlemail.com>.
>
> Note also that the current code doesn't seem to work perfectly yet as its
> not including the xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
> attribute, I've not debugged it so not sure it thats a problem in the
> getDomainComposite method or Utils.modelToXML.
>
> An example is:
>
> <composite autowire="false" name="DomainCompositeTestCase"
> targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
>    <include name="ns1:helloworld" xmlns:ns1="http://sample"/>
> </composite>
>
>    ...ant
>

Ok, not actually sure how useful this version with includes in it is
but I know it's what the spec suggests.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/

Posted by ant elder <an...@gmail.com>.
On Thu, May 19, 2011 at 2:02 PM, ant elder <an...@gmail.com> wrote:

>
>
> On Thu, May 19, 2011 at 1:41 PM, <sl...@apache.org> wrote:
>
>> Author: slaws
>> Date: Thu May 19 12:41:09 2011
>> New Revision: 1124713
>>
>> URL: http://svn.apache.org/viewvc?rev=1124713&view=rev
>> Log:
>> Bit of renaming to be clear this is about looking at the domain rather
>> then being the domain.
>>
>>
>
>> +    // copied from domain node
>>
>> +    public Composite getDomainComposite(String domainName) {
>> +        FactoryExtensionPoint factories =
>> DomainViewRunner.extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class);
>> +        AssemblyFactory assemblyFactory =
>> factories.getFactory(AssemblyFactory.class);
>> +        Composite domainComposite = assemblyFactory.createComposite();
>> +        domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS,
>> domainName));
>> +        domainComposite.setAutowire(false);
>> +        domainComposite.setLocal(false);
>> +        List<Composite> domainIncludes = domainComposite.getIncludes();
>> +        Map<String, List<String>> runningCompositeURIs =
>> DomainViewRunner.domainRegistry.getRunningCompositeURIs();
>> +        for (String curi : runningCompositeURIs.keySet()) {
>> +            for (String compositeURI : runningCompositeURIs.get(curi)) {
>> +
>>  domainIncludes.add(DomainViewRunner.domainRegistry.getRunningComposite(curi,
>> compositeURI));
>> +            }
>> +        }
>> +        return domainComposite;
>> +    }
>>
>>
> So you don't have to copy it I've just moved this code from NodeImpl to be
> in the DomainRegistry.
>
>
Note also that the current code doesn't seem to work perfectly yet as its
not including the xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
attribute, I've not debugged it so not sure it thats a problem in the
getDomainComposite method or Utils.modelToXML.

An example is:

<composite autowire="false" name="DomainCompositeTestCase" targetNamespace="
http://tuscany.apache.org/xmlns/sca/1.1">
   <include name="ns1:helloworld" xmlns:ns1="http://sample"/>
</composite>

   ...ant