You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2012/08/26 17:23:38 UTC

[t5.3.4] Plugin blocks

After reading Taha's
article<http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/>,
I'm now trying to dissect my application to be able to distribute it to
different clients. So it will be distributed as one slim web application
with really nothing to offer. And to use one feature, a tapestry module
(.jar) file will just be dropped in the classpath and it should be
auto-loaded (using tapestry).

I find Taha's article highly innovative but I'm trying to find out if
anyone tackled the problem with a different approach that could be
"simpler" or capable of handling what Taha's solution probably didn't.

-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Taha Siddiqi <ta...@gmail.com>.
Hi Muhammad

You should be able to access any page as long as tapestry finds it. (You can check that using the startup logs).

Also are you adding manifest entry for 'Tapestry-Module-Classes' in your module jars

http://tapestry.apache.org/autoloading-modules.html

regards
Taha

On Aug 29, 2012, at 7:32 PM, Muhammad Gelbana wrote:

> I'm going with Taha's approach but I'm having some difficulties and
> questions. In Taha's article he referred to his contributed page this way "
> debitCardModule/instructionblocks" where "debitCardModule" is the page's
> module name in camel case (first letter is lowered) and then the page name,
> all in lower case. I tried contributing the page name as a string as the
> article states and using it's .class type but both didn't work, it's always
> returns this:
> 
> Render queue error in BeginRender[Index:layout.delegate]: Failure reading
> parameter 'to' of component Index:layout.delegate: Unable to resolve
> 'adminModule/adminmodulemenus' to a known page name.
> 
> 
> I have some questions:
> 1. The "ComponentSrouce" service, should It be injected by the plugin
> module to be able to resolve pages contributed by the same module (I can't
> imagine how can I inject a service in a static method to contribute my
> configuration - page name and block id)
> 
> 2. How does the main app know where to find my modules package to locate
> the pages and components packages ? Like in the web.xml, the app's package
> is stated but how is it done with a contributing module ?
> 
> 3. How can a contributed block, have links to pages in the main app ?
> 
> 
> 
> On Sun, Aug 26, 2012 at 11:55 PM, Muhammad Gelbana <m....@gmail.com>wrote:
> 
>> The blog post is fantastic but It lacks the point that Taha tackled which
>> is contributing blocks to the main application. My goal here isn't to
>> contribute blocks (which seems to be the best option so far because it
>> solves the problem of having links displayed as sub links to another top
>> link. Igor tried to solve this using annotations which is really nice. I
>> still have to compare between using annotations and blocks to categories my
>> page links. Although for some reason, I feel contributing blocks will be
>> easier, may be I'm wrong.
>> 
>> May be I can work around contributing blocks by having components act as
>> the contributed tml part and annotate the component with a reasonable
>> annotation to indicate that it's template has to be displayed ? Then Igor's
>> loop would have a "delegate" component instead of the hyperlink one ?
>> 
>> 
>> On Sun, Aug 26, 2012 at 9:21 PM, Richard Frovarp <rf...@apache.org>wrote:
>> 
>>> On 08/26/2012 10:23 AM, Muhammad Gelbana wrote:
>>> 
>>>> After reading Taha's
>>>> article<http://tawus.**wordpress.com/2011/04/20/**
>>>> tapestry-magic-3-plugin-**blocks/<http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/>
>>>>> ,
>>>> 
>>>> I'm now trying to dissect my application to be able to distribute it to
>>>> different clients. So it will be distributed as one slim web application
>>>> with really nothing to offer. And to use one feature, a tapestry module
>>>> (.jar) file will just be dropped in the classpath and it should be
>>>> auto-loaded (using tapestry).
>>>> 
>>>> I find Taha's article highly innovative but I'm trying to find out if
>>>> anyone tackled the problem with a different approach that could be
>>>> "simpler" or capable of handling what Taha's solution probably didn't.
>>>> 
>>>> 
>>> This might prove useful:
>>> http://blog.tapestry5.de/**index.php/2010/01/19/tapestry-**
>>> ioc-modularization-of-web-**applications-without-osgi/<http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/>
>>> 
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>>> 
>> 
>> 
>> --
>> *Regards,*
>> *Muhammad Gelbana
>> Java Developer*
>> 
>> 
> 
> 
> -- 
> *Regards,*
> *Muhammad Gelbana
> Java Developer*


Re: [t5.3.4] Plugin blocks

Posted by Gerold Glaser <ge...@gmail.com>.
We have written another solution to overcome the limitations of the block
contributions.

You can work with the contributed components with the normal tapestry
features like parameter binding, event propagation and so on.

You can find the source and the module here:
https://github.com/porscheinformatik/tapestry-component-extension



2012/8/29 Muhammad Gelbana <m....@gmail.com>

> I cannot disregard your post because It solved my problem :D
>
> But now you are saying that "InstructionBlocks" page is under "
> debitCardModule" folder which is under pages, but I still can't see how
> will the main app locate the page if it doesn't know the contributing
> module package.
>
> When I first got the page resolution exceptions, the tapestry exception
> page identified these pages:
>
> Page names:
>
>    -
>    - About
>    - Contact
>    - ExceptionReport
>    - Index
>    - PageCatalog
>    - PropertyDisplayBlocks
>    - PropertyEditBlocks
>    - ServiceStatus
>
> (I'm using a maven-generated project so pages like About, Contact will be
> removed) So my page "adminmodulemenus" isn't there.
>
> But after I followed your suggestion which make a lot of sense which is to
> map my module's package, I forced the app into an exception and now
> tapestry can find my page:
>
> Page names:
>
>    -
>    - About
>    - Contact
>    - ExceptionReport
>    - Index
>    - PageCatalog
>    - PropertyDisplayBlocks
>    - PropertyEditBlocks
>    - ServiceStatus
>    - *ipkadmin/AdminModuleMenus <<<<<<<*
>
> Thanks a lot for your help :)
>
>
> On Wed, Aug 29, 2012 at 4:38 PM, Lance Java <lance.java@googlemail.com
> >wrote:
>
> > Please disregard my last post as it was wrong (I should take more time
> > reading the actual problem).
> >
> > In Taha's post he refers to a page named
> > "debitCardModule/instructionblocks". This means that he has a page with
> > class "foo.bar.basepackage.pages.debitCardModule.InstructionBlocks" where
> > "foo.bar.basepackage" is the base package for his app.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715883.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>

Re: [t5.3.4] Plugin blocks

Posted by Taha Siddiqi <ta...@gmail.com>.
If you can share the project I can look into it.


On Aug 29, 2012, at 8:23 PM, Muhammad Gelbana wrote:

> I cannot disregard your post because It solved my problem :D
> 
> But now you are saying that "InstructionBlocks" page is under "
> debitCardModule" folder which is under pages, but I still can't see how
> will the main app locate the page if it doesn't know the contributing
> module package.
> 
> When I first got the page resolution exceptions, the tapestry exception
> page identified these pages:
> 
> Page names:
> 
>   -
>   - About
>   - Contact
>   - ExceptionReport
>   - Index
>   - PageCatalog
>   - PropertyDisplayBlocks
>   - PropertyEditBlocks
>   - ServiceStatus
> 
> (I'm using a maven-generated project so pages like About, Contact will be
> removed) So my page "adminmodulemenus" isn't there.
> 
> But after I followed your suggestion which make a lot of sense which is to
> map my module's package, I forced the app into an exception and now
> tapestry can find my page:
> 
> Page names:
> 
>   -
>   - About
>   - Contact
>   - ExceptionReport
>   - Index
>   - PageCatalog
>   - PropertyDisplayBlocks
>   - PropertyEditBlocks
>   - ServiceStatus
>   - *ipkadmin/AdminModuleMenus <<<<<<<*
> 
> Thanks a lot for your help :)
> 
> 
> On Wed, Aug 29, 2012 at 4:38 PM, Lance Java <la...@googlemail.com>wrote:
> 
>> Please disregard my last post as it was wrong (I should take more time
>> reading the actual problem).
>> 
>> In Taha's post he refers to a page named
>> "debitCardModule/instructionblocks". This means that he has a page with
>> class "foo.bar.basepackage.pages.debitCardModule.InstructionBlocks" where
>> "foo.bar.basepackage" is the base package for his app.
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715883.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> *Regards,*
> *Muhammad Gelbana
> Java Developer*


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
Correct. Taga's 3rd option fulfills what I need but I didn't catch the
difference. Thank you all.

On Fri, Aug 31, 2012 at 12:45 PM, Bob Harner <bo...@gmail.com> wrote:

> Taha's 3rd option is refactor-safe, too. On the other hand, since Tapestry
> will complain loudly about links to non-existent pages, using strings for
> page names is less risky in this case.
> On Aug 31, 2012 5:26 AM, "Lance Java" <la...@googlemail.com> wrote:
>
> > @Inject
> > private ComponentClassResolver componentClassResolver;
> >
> > public String getProbesHealthPageName() {
> >    return
> >
> >
> componentClassResolver.resolvePageClassNameToPageName(ProbesHealth.class.getName());
> > }
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715936.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>



-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Bob Harner <bo...@gmail.com>.
Taha's 3rd option is refactor-safe, too. On the other hand, since Tapestry
will complain loudly about links to non-existent pages, using strings for
page names is less risky in this case.
On Aug 31, 2012 5:26 AM, "Lance Java" <la...@googlemail.com> wrote:

> @Inject
> private ComponentClassResolver componentClassResolver;
>
> public String getProbesHealthPageName() {
>    return
>
> componentClassResolver.resolvePageClassNameToPageName(ProbesHealth.class.getName());
> }
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715936.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
@Inject
private ComponentClassResolver componentClassResolver;

public String getProbesHealthPageName() {
   return
componentClassResolver.resolvePageClassNameToPageName(ProbesHealth.class.getName());
}



--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715936.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
But I wanted this to be refactor-safe. If that's not possible then I'll
just write in the template file as it was when I first constructed the
template.

Thank you all for the replies.

On Fri, Aug 31, 2012 at 11:03 AM, Lance Java <la...@googlemail.com>wrote:

> Short answer: Can't you just do the following?
> <t:pagelink page="/admin/probesHealth">Probes Health</t:pagelink>
>
> Long Answer: Pagelink expects a String pageName and you are (incorrectly)
> passing a Link. Tapestry sees the mismatch and coerces Link to String. The
> resulting URL is then used as a page name which fails.
>
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715934.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
Short answer: Can't you just do the following?
<t:pagelink page="/admin/probesHealth">Probes Health</t:pagelink> 

Long Answer: Pagelink expects a String pageName and you are (incorrectly)
passing a Link. Tapestry sees the mismatch and coerces Link to String. The
resulting URL is then used as a page name which fails.





--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715934.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Taha Siddiqi <ta...@gmail.com>.
Hi

you can either do a 

<a t:type='PageLink' page='admin/probeshealth'>Probes Health</a>

or 

<a t:type='PageLink' page='prop:myDynamicPageProperty'></a>

// Return page name.
public String getMyDynamicPageProperty(){
   return "admin/probehealth";
}


or 

<a href='${pageUrl'></a>

public String getPageUrl(){
   return pageLinkSource.createPageRenderLink(ProbesHealth.class);
}

You are confusing the three.

PS: Have not looked at your code, will do that tomorrow

regards
Taha



On Aug 31, 2012, at 2:09 PM, Muhammad Gelbana wrote:

> So I'm trying to create page links using the *PageLinkResource* service
> through the *createPageRenderLink* method.
> 
> public Link getProbesHealthUrl() {
>> return pageLinkSource.createPageRenderLink(ProbesHealth.class);
>> }
> 
> 
> The page link component in the template is
> 
> <t:pagelink page="*prop:probesHealthUrl*">Probes Health</t:pagelink>
>> 
> 
> But an error occurs and shows the following message:
> 
> Render queue error in BeginRender[admin/MenuBlocks:pagelink]: Unable to
> resolve '/admin/probeshealth' to a known page name.
> 
> Although the known tapestry pages are
> 
> Page names:
>> 
>>   -
>> 
>> 
>>   - About
>> 
>> 
>>   - Contact
>> 
>> 
>>   - ExceptionReport
>> 
>> 
>>   - Index
>> 
>> 
>>   - PageCatalog
>> 
>> 
>>   - PropertyDisplayBlocks
>> 
>> 
>>   - PropertyEditBlocks
>> 
>> 
>>   - ServiceStatus
>> 
>> 
>>   - admin/MenuBlocks
>> 
>> 
>>   - *admin/ProbesHealth*
>> 
>> 
> So the only difference between the identified page and the one I generate
> using the *PageLinkResource* service is the preceeding slash */*. So I
> tried this instead:
> 
> return
>> pageLinkSource.createPageRenderLink(ProbesHealth.class).toURI().substring(1);
> 
> 
> And returned a string instead and it worked ! I don't think that's the best
> way to do this so what am I doing wrong here ?
> 
> 
> On Thu, Aug 30, 2012 at 12:57 AM, Bob Harner <bo...@gmail.com> wrote:
> 
>> Unfortunately, there is a bit of ambiguity in the term "component" as
>> used by Tapestry. It can actually mean 2 different things, depending
>> on whether you're talking in a specific or general way:
>> 
>> 1) Specific: objects defined by the classes in in your
>> {package-name}/components folders
>> 
>> 2) General: objects defined by all those classes under your
>> {package-name}/pages, {package-name}/components and
>> {package-name}/mixins folders
>> 
>> The documentation intermixes both of these meanings -- probably
>> because no one has come up two words that work better than this one
>> word.
>> 
>> In the *general* sense (#2), a page *is* a component. In the
>> *specific* sense, they are distinct things that are 95% similar, as
>> Thiago says.
>> 
>> In my way of thinking (not sure if this is universally agreed upon), a
>> component library is just a Tapestry IOC module that contains
>> components (that is, components in the "general" sense above).
>> 
>> On Wed, Aug 29, 2012 at 5:00 PM, Thiago H de Paula Figueiredo
>> <th...@gmail.com> wrote:
>>> On Wed, 29 Aug 2012 17:28:06 -0300, Muhammad Gelbana <
>> m.gelbana@gmail.com>
>>> wrote:
>>> 
>>>> Yes that's true.
>>>> Is including pages in a component library not common ?
>>> 
>>> 
>>> Including pages in a component library is common. And don't forget that
>> in
>>> Tapestry pages and components are 95% the same. A page is a component
>> with
>>> URL and activation context, but without parameters and that can't be
>>> declared inside other components or pages.
>>> 
>>> 
>>>> Calling it a "component library" makes it sound like it's only for
>>>> components.
>>> 
>>> 
>>> It's just the shorter name possible. A component library can have pages,
>>> components, mixins, resources, etc.
>>> 
>>> 
>>>> Was modules supported mainly as component libraries ?
>>> 
>>> 
>>> Absolutely no. Modules are a Tapestry-IoC feature, and Tapestry-IoC
>> doesn't
>>> know about web apps, not even Tapestry(-core) itself.
>>> 
>>> Pages *are* components. And pages in component libraries is common.
>>> 
>>> --
>>> Thiago H. de Paula Figueiredo
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> *Regards,*
> *Muhammad Gelbana
> Java Developer*


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
So I'm trying to create page links using the *PageLinkResource* service
through the *createPageRenderLink* method.

public Link getProbesHealthUrl() {
> return pageLinkSource.createPageRenderLink(ProbesHealth.class);
> }


The page link component in the template is

<t:pagelink page="*prop:probesHealthUrl*">Probes Health</t:pagelink>
>

But an error occurs and shows the following message:

Render queue error in BeginRender[admin/MenuBlocks:pagelink]: Unable to
resolve '/admin/probeshealth' to a known page name.

Although the known tapestry pages are

Page names:
>
>    -
>
>
>    - About
>
>
>    - Contact
>
>
>    - ExceptionReport
>
>
>    - Index
>
>
>    - PageCatalog
>
>
>    - PropertyDisplayBlocks
>
>
>    - PropertyEditBlocks
>
>
>    - ServiceStatus
>
>
>    - admin/MenuBlocks
>
>
>    - *admin/ProbesHealth*
>
>
So the only difference between the identified page and the one I generate
using the *PageLinkResource* service is the preceeding slash */*. So I
tried this instead:

return
> pageLinkSource.createPageRenderLink(ProbesHealth.class).toURI().substring(1);


And returned a string instead and it worked ! I don't think that's the best
way to do this so what am I doing wrong here ?


On Thu, Aug 30, 2012 at 12:57 AM, Bob Harner <bo...@gmail.com> wrote:

> Unfortunately, there is a bit of ambiguity in the term "component" as
> used by Tapestry. It can actually mean 2 different things, depending
> on whether you're talking in a specific or general way:
>
> 1) Specific: objects defined by the classes in in your
> {package-name}/components folders
>
> 2) General: objects defined by all those classes under your
> {package-name}/pages, {package-name}/components and
> {package-name}/mixins folders
>
> The documentation intermixes both of these meanings -- probably
> because no one has come up two words that work better than this one
> word.
>
> In the *general* sense (#2), a page *is* a component. In the
> *specific* sense, they are distinct things that are 95% similar, as
> Thiago says.
>
> In my way of thinking (not sure if this is universally agreed upon), a
> component library is just a Tapestry IOC module that contains
> components (that is, components in the "general" sense above).
>
> On Wed, Aug 29, 2012 at 5:00 PM, Thiago H de Paula Figueiredo
> <th...@gmail.com> wrote:
> > On Wed, 29 Aug 2012 17:28:06 -0300, Muhammad Gelbana <
> m.gelbana@gmail.com>
> > wrote:
> >
> >> Yes that's true.
> >> Is including pages in a component library not common ?
> >
> >
> > Including pages in a component library is common. And don't forget that
> in
> > Tapestry pages and components are 95% the same. A page is a component
> with
> > URL and activation context, but without parameters and that can't be
> > declared inside other components or pages.
> >
> >
> >> Calling it a "component library" makes it sound like it's only for
> >> components.
> >
> >
> > It's just the shorter name possible. A component library can have pages,
> > components, mixins, resources, etc.
> >
> >
> >> Was modules supported mainly as component libraries ?
> >
> >
> > Absolutely no. Modules are a Tapestry-IoC feature, and Tapestry-IoC
> doesn't
> > know about web apps, not even Tapestry(-core) itself.
> >
> > Pages *are* components. And pages in component libraries is common.
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Bob Harner <bo...@gmail.com>.
Unfortunately, there is a bit of ambiguity in the term "component" as
used by Tapestry. It can actually mean 2 different things, depending
on whether you're talking in a specific or general way:

1) Specific: objects defined by the classes in in your
{package-name}/components folders

2) General: objects defined by all those classes under your
{package-name}/pages, {package-name}/components and
{package-name}/mixins folders

The documentation intermixes both of these meanings -- probably
because no one has come up two words that work better than this one
word.

In the *general* sense (#2), a page *is* a component. In the
*specific* sense, they are distinct things that are 95% similar, as
Thiago says.

In my way of thinking (not sure if this is universally agreed upon), a
component library is just a Tapestry IOC module that contains
components (that is, components in the "general" sense above).

On Wed, Aug 29, 2012 at 5:00 PM, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Wed, 29 Aug 2012 17:28:06 -0300, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
>> Yes that's true.
>> Is including pages in a component library not common ?
>
>
> Including pages in a component library is common. And don't forget that in
> Tapestry pages and components are 95% the same. A page is a component with
> URL and activation context, but without parameters and that can't be
> declared inside other components or pages.
>
>
>> Calling it a "component library" makes it sound like it's only for
>> components.
>
>
> It's just the shorter name possible. A component library can have pages,
> components, mixins, resources, etc.
>
>
>> Was modules supported mainly as component libraries ?
>
>
> Absolutely no. Modules are a Tapestry-IoC feature, and Tapestry-IoC doesn't
> know about web apps, not even Tapestry(-core) itself.
>
> Pages *are* components. And pages in component libraries is common.
>
> --
> Thiago H. de Paula Figueiredo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 29 Aug 2012 17:28:06 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> Yes that's true.
> Is including pages in a component library not common ?

Including pages in a component library is common. And don't forget that in  
Tapestry pages and components are 95% the same. A page is a component with  
URL and activation context, but without parameters and that can't be  
declared inside other components or pages.

> Calling it a "component library" makes it sound like it's only for  
> components.

It's just the shorter name possible. A component library can have pages,  
components, mixins, resources, etc.

> Was modules supported mainly as component libraries ?

Absolutely no. Modules are a Tapestry-IoC feature, and Tapestry-IoC  
doesn't know about web apps, not even Tapestry(-core) itself.

Pages *are* components. And pages in component libraries is common.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
Yes that's true.
Is including pages in a component library not common ? Calling it a
"component library" makes it sound like it's only for components. Was
modules supported mainly as component libraries ?


On Wed, Aug 29, 2012 at 9:57 PM, Lance Java <la...@googlemail.com>wrote:

> If you are writing a component library then yes, you will need a
> LibraryMapping.
> I've never included pages in a component library (only components) but I'm
> assuming that your page names will have require a prefix (as specified in
> your library mapping).
>
> For instance, if your app package "foo.bar", your class was
> "foo.bar.pages.baz.MyPage" and your library prefix was "mylibrary", I would
> expect your page name to be "mylibrary.baz/MyPage"
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715893.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
If you are writing a component library then yes, you will need a
LibraryMapping.
I've never included pages in a component library (only components) but I'm
assuming that your page names will have require a prefix (as specified in
your library mapping).

For instance, if your app package "foo.bar", your class was
"foo.bar.pages.baz.MyPage" and your library prefix was "mylibrary", I would
expect your page name to be "mylibrary.baz/MyPage" 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715893.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
Isn't that for web apps only ? I'm writing a module (jar) to be auto-loaded
by a tapestry web app.
Would tapestry process a web.xml file in a tapestry module ?

On Wed, Aug 29, 2012 at 8:25 PM, Lance Java <la...@googlemail.com>wrote:

> Are you familiar with the tapestry.app-package init-param in web.xml? If
> you place pages/mixins/components under this package you won't need to
> contribute a LibraryMapping
>



-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
Are you familiar with the tapestry.app-package init-param in web.xml? If
you place pages/mixins/components under this package you won't need to
contribute a LibraryMapping

Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
I cannot disregard your post because It solved my problem :D

But now you are saying that "InstructionBlocks" page is under "
debitCardModule" folder which is under pages, but I still can't see how
will the main app locate the page if it doesn't know the contributing
module package.

When I first got the page resolution exceptions, the tapestry exception
page identified these pages:

Page names:

   -
   - About
   - Contact
   - ExceptionReport
   - Index
   - PageCatalog
   - PropertyDisplayBlocks
   - PropertyEditBlocks
   - ServiceStatus

(I'm using a maven-generated project so pages like About, Contact will be
removed) So my page "adminmodulemenus" isn't there.

But after I followed your suggestion which make a lot of sense which is to
map my module's package, I forced the app into an exception and now
tapestry can find my page:

Page names:

   -
   - About
   - Contact
   - ExceptionReport
   - Index
   - PageCatalog
   - PropertyDisplayBlocks
   - PropertyEditBlocks
   - ServiceStatus
   - *ipkadmin/AdminModuleMenus <<<<<<<*

Thanks a lot for your help :)


On Wed, Aug 29, 2012 at 4:38 PM, Lance Java <la...@googlemail.com>wrote:

> Please disregard my last post as it was wrong (I should take more time
> reading the actual problem).
>
> In Taha's post he refers to a page named
> "debitCardModule/instructionblocks". This means that he has a page with
> class "foo.bar.basepackage.pages.debitCardModule.InstructionBlocks" where
> "foo.bar.basepackage" is the base package for his app.
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715883.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

[t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
Please disregard my last post as it was wrong (I should take more time
reading the actual problem).

In Taha's post he refers to a page named
"debitCardModule/instructionblocks". This means that he has a page with
class "foo.bar.basepackage.pages.debitCardModule.InstructionBlocks" where
"foo.bar.basepackage" is the base package for his app.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715883.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[t5.3.4] Plugin blocks

Posted by Lance Java <la...@googlemail.com>.
I'm assuming that in Taha's example, each department was a separate component
library. Component libraries contribute a LibraryMapping to the
ComponentClassResolver specifying the prefix to use. See here for the docs
on component libraries http://tapestry.apache.org/component-libraries.html





--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-tp5715810p5715880.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
I'm going with Taha's approach but I'm having some difficulties and
questions. In Taha's article he referred to his contributed page this way "
debitCardModule/instructionblocks" where "debitCardModule" is the page's
module name in camel case (first letter is lowered) and then the page name,
all in lower case. I tried contributing the page name as a string as the
article states and using it's .class type but both didn't work, it's always
returns this:

Render queue error in BeginRender[Index:layout.delegate]: Failure reading
parameter 'to' of component Index:layout.delegate: Unable to resolve
'adminModule/adminmodulemenus' to a known page name.


I have some questions:
1. The "ComponentSrouce" service, should It be injected by the plugin
module to be able to resolve pages contributed by the same module (I can't
imagine how can I inject a service in a static method to contribute my
configuration - page name and block id)

2. How does the main app know where to find my modules package to locate
the pages and components packages ? Like in the web.xml, the app's package
is stated but how is it done with a contributing module ?

3. How can a contributed block, have links to pages in the main app ?



On Sun, Aug 26, 2012 at 11:55 PM, Muhammad Gelbana <m....@gmail.com>wrote:

> The blog post is fantastic but It lacks the point that Taha tackled which
> is contributing blocks to the main application. My goal here isn't to
> contribute blocks (which seems to be the best option so far because it
> solves the problem of having links displayed as sub links to another top
> link. Igor tried to solve this using annotations which is really nice. I
> still have to compare between using annotations and blocks to categories my
> page links. Although for some reason, I feel contributing blocks will be
> easier, may be I'm wrong.
>
> May be I can work around contributing blocks by having components act as
> the contributed tml part and annotate the component with a reasonable
> annotation to indicate that it's template has to be displayed ? Then Igor's
> loop would have a "delegate" component instead of the hyperlink one ?
>
>
> On Sun, Aug 26, 2012 at 9:21 PM, Richard Frovarp <rf...@apache.org>wrote:
>
>> On 08/26/2012 10:23 AM, Muhammad Gelbana wrote:
>>
>>> After reading Taha's
>>> article<http://tawus.**wordpress.com/2011/04/20/**
>>> tapestry-magic-3-plugin-**blocks/<http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/>
>>> >,
>>>
>>> I'm now trying to dissect my application to be able to distribute it to
>>> different clients. So it will be distributed as one slim web application
>>> with really nothing to offer. And to use one feature, a tapestry module
>>> (.jar) file will just be dropped in the classpath and it should be
>>> auto-loaded (using tapestry).
>>>
>>> I find Taha's article highly innovative but I'm trying to find out if
>>> anyone tackled the problem with a different approach that could be
>>> "simpler" or capable of handling what Taha's solution probably didn't.
>>>
>>>
>> This might prove useful:
>> http://blog.tapestry5.de/**index.php/2010/01/19/tapestry-**
>> ioc-modularization-of-web-**applications-without-osgi/<http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Muhammad Gelbana <m....@gmail.com>.
The blog post is fantastic but It lacks the point that Taha tackled which
is contributing blocks to the main application. My goal here isn't to
contribute blocks (which seems to be the best option so far because it
solves the problem of having links displayed as sub links to another top
link. Igor tried to solve this using annotations which is really nice. I
still have to compare between using annotations and blocks to categories my
page links. Although for some reason, I feel contributing blocks will be
easier, may be I'm wrong.

May be I can work around contributing blocks by having components act as
the contributed tml part and annotate the component with a reasonable
annotation to indicate that it's template has to be displayed ? Then Igor's
loop would have a "delegate" component instead of the hyperlink one ?

On Sun, Aug 26, 2012 at 9:21 PM, Richard Frovarp <rf...@apache.org>wrote:

> On 08/26/2012 10:23 AM, Muhammad Gelbana wrote:
>
>> After reading Taha's
>> article<http://tawus.**wordpress.com/2011/04/20/**
>> tapestry-magic-3-plugin-**blocks/<http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/>
>> >,
>>
>> I'm now trying to dissect my application to be able to distribute it to
>> different clients. So it will be distributed as one slim web application
>> with really nothing to offer. And to use one feature, a tapestry module
>> (.jar) file will just be dropped in the classpath and it should be
>> auto-loaded (using tapestry).
>>
>> I find Taha's article highly innovative but I'm trying to find out if
>> anyone tackled the problem with a different approach that could be
>> "simpler" or capable of handling what Taha's solution probably didn't.
>>
>>
> This might prove useful:
> http://blog.tapestry5.de/**index.php/2010/01/19/tapestry-**
> ioc-modularization-of-web-**applications-without-osgi/<http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: [t5.3.4] Plugin blocks

Posted by Richard Frovarp <rf...@apache.org>.
On 08/26/2012 10:23 AM, Muhammad Gelbana wrote:
> After reading Taha's
> article<http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/>,
> I'm now trying to dissect my application to be able to distribute it to
> different clients. So it will be distributed as one slim web application
> with really nothing to offer. And to use one feature, a tapestry module
> (.jar) file will just be dropped in the classpath and it should be
> auto-loaded (using tapestry).
>
> I find Taha's article highly innovative but I'm trying to find out if
> anyone tackled the problem with a different approach that could be
> "simpler" or capable of handling what Taha's solution probably didn't.
>

This might prove useful:
http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org