Rob - Portlet guys are trying to do this without having to have custom support in eclipse
for portlets...which is part of what makes it tricky.
meaning these projects are not recognized as actual porlet projects with the portlet facet
enabled.
/max
What I really need outlined is,
1) How to tell a project is a portlet project
2) Where you would want to store this setting. (In some custom file in the .settings
folder?)
Assuming portlet projects are all dynamic web projects, we need something else to be able
to differentiate a portlet project from a web project.
Digging through some code, I see we already have JBossLaunchAdapter which has custom
behavior for portlet projects. It indicates that there is already a jboss.portlet facet,
and we already key off that in the launch adapter. If the New Portlet Project wizard did
some setting up at and stored this url in some setting, I would be able to access it here
in this code.
So what we need is someone on the portlet side to modify the new portlet project wizard
to set a launch url, or to provide some actions to modify it, and then my launch adapter
can return that custom url.
I would imagine this url should not be a full url, but rather a server-relative path, so
that the same project could be deployed to different servers.
I'm not sure where to start on this, so if anyone else has any ideas I'd be glad
to help.
- Rob
On 01/17/2013 06:11 PM, Peter Palaga wrote:
> CCing Thomas instead of gatein-core.
>
> On 2013-01-17 08:58, Max Rydahl Andersen wrote:
>>
>>>> Eclipse cannot import just directories and files....they are of some
>>>> eclipse known project type. And yes they are a war - which I assume
>>>> if you out a servlet or index.html in these actually will be served
>>>> out as such, correct?
>>>
>>> The content of Portlet WARs is served by a portlet container and not by
>>> servlet container. There may exist files like index.html, but they usually
>>> do not make much sense standalone. They are fragments that are intended
>>> to be embedded in some context by the portlet container. Moreover, ATM
>>> there is no way how portlets could be accessed standalone via URL.
>>
>> I'm not talking about the portlets in there, but stuff that is not portlets,
like servlets, html/jsf pages etc.
>>
>> But I guess what you are saying is that gatein gets to "mount" the war
somewhere else than the servlet container.
>>
>>>>>> What inside these projects (which eclipse has info about) can be
>>>>>> used to decide its not relevant to open ?
>>>>>
>>>>> Yes, that is what I proposed: JBT should not show any URL for
>>>>> projects which have gatein-3.5-bom dependency in their POMs. Is
>>>>> that doable?
>>>>
>>>> The stuff that figures out what is runnable doesn't have access to
>>>> maven metadata so its not a good choice IMO. It can see files and
>>>> classpath entries if it must.
>>>
>>> I see, so looking if there is a src/main/webapp/WEB-INF/portlet.xml file in
the project would work, right?
>>
>> That is a better approach yes, but what do you expect to happen when such file is
found ?
>>
>> Just doing "nothing" seems wrong. Maybe a dialog showing some
explanation ?
>>
>> Any suggestion on what this would say ?
>>
>> Maybe something like "It looks like this project is a portlet and thus a
proper URL cannot be calculated. Instead go to <something?> to find your page"
?
>
> After discussing this with Thomas, we agree that some text would be OK. We will
propose some wording.
>
> Another question is if it would be possible to have a per-project configurable URL?
Unfortunately there is no universal <something?> that would work for every portlet
project.
>
>> btw. I assume Run and Debug as should still actually start the server and in case
of debug attach the debugger to it.
>
> Yes, no change so far. I should verify if it works at all though.
>
>> in any case, please open a bug in JBIDE with this request.
>
> OK
>
> Thanks again,
>
> Peter
>