This is very strange. I looked at the current version of DefaultLinkService and its log only goes back two revisions with the oldest saying the class was missing. However, I have a version I checked out in June that has a whole slew of history. It shows the revision as 156634. If I do an "svn diff -r 156634 DefaultLinkServices.java" I got an error that that revision is not in the repository. I've included the diff here. Anyone know what happened?

Ralph

2,3c2,3
<  * Copyright 1999-2002,2004-2005 The Apache Software Foundation.
<  *
---
>  * Copyright 1999-2002,2004 The Apache Software Foundation.
>  *
7c7
<  *
---
>  *
9c9
<  *
---
>  *
49c49
< * @version $Id: DefaultLinkService.java 264181 2005-08-29 17:50:59Z cziegeler $
---
> * @version CVS $Id: DefaultLinkService.java 156634 2005-03-09 11:00:37Z cziegeler $
64,75c64,65
<             // TODO - Does null always mean FALSE?
<             // it might be that the current request is also https,
<             // in that case we return https even if secure is FALSE.
<             if ( secure == null || secure.equals(Boolean.FALSE) ) {
<                 return linkBase.toString();
<             }
<             // FIXME - Perhaps there is a better way
<             String link = linkBase.toString();
<             if ( link.startsWith("https") ) {
<                 return link;
<             }
<             return "https" + linkBase.toString().substring(4);
---
>             //Todo actually implement secure
>             return linkBase.toString();
86c76
<     protected Boolean eventsMarshalled;
---
>     protected Boolean eventsMarshalled = null;
88c78
<     /**
---
>     /* (non-Javadoc)
109,114c99,102
<                     info.linkBase.append(request.getScheme());
<                     info.linkBase.append("://");
<                     info.linkBase.append(request.getServerName());
<                     if ( request.getServerPort() != 80 ) {
<                         info.linkBase.append(':');
<                         info.linkBase.append(request.getServerPort());
---
>                     String baseURI = request.getSitemapURI();
>                     final int pos = baseURI.lastIndexOf('/');
>                     if ( pos != -1 ) {
>                         baseURI = baseURI.substring(pos+1);
116,123c104
<                     if ( request.getContextPath().length() > 0 ) {
<                         info.linkBase.append(request.getContextPath());
<                     }
< info.linkBase.append('/'); < if ( request.getSitemapURIPrefix().length() > 0 ) { < info.linkBase.append(request.getSitemapURIPrefix());
<                     }
<                     info.linkBase.append(request.getSitemapURI());
---
>                     info.linkBase.append(baseURI);
130,132c111,113
<     /**
<      * @see org.apache.cocoon.portal.LinkService#isSecure()
<      */
---
>     /* (non-Javadoc)
>     * @see org.apache.cocoon.portal.LinkService#isSecure()
>     */
137c118
<     /**
---
>     /* (non-Javadoc)
144c125
<     /**
---
>     /* (non-Javadoc)
151,153c132,134
<     /**
< * @see org.apache.cocoon.portal.LinkService#getLinkURI(org.apache.cocoon.portal.event.Event, boolean)
<      */
---
>     /* (non-Javadoc)
> * @see org.apache.cocoon.portal.LinkService#getLinkURI(org.apache.cocoon.portal.event.Event, boolean)
>     */
156c137
<             return this.getRefreshLinkURI(secure);
---
>             return this.getRefreshLinkURI();
209c190
<     /**
---
>     /* (non-Javadoc)
216,218c197,199
<     /**
< * @see org.apache.cocoon.portal.LinkService#getLinkURI(java.util.List)
<      */
---
>     /* (non-Javadoc)
> * @see org.apache.cocoon.portal.LinkService#getLinkURI(java.util.List)
>     */
221c202
<             return this.getRefreshLinkURI(secure);
---
>             return this.getRefreshLinkURI();
276c257
<     /**
---
>     /* (non-Javadoc)
304c285
<     /**
---
>     /* (non-Javadoc)
322c303
<     /**
---
>     /* (non-Javadoc)
352c333
<     /**
---
>     /* (non-Javadoc)
356,362d336
<         return this.getRefreshLinkURI(null);
<     }
<
<     /**
< * @see org.apache.cocoon.portal.LinkService#getRefreshLinkURI(java.lang.Boolean)
<      */
<     public String getRefreshLinkURI(Boolean secure) {
365c339
< final StringBuffer buffer = new StringBuffer(info.getBase(secure));
---
> final StringBuffer buffer = new StringBuffer(info.linkBase.toString());
387c361
<     /**
---
>     /* (non-Javadoc)
398c372
<     /**
---
>     /* (non-Javadoc)


Jean-Baptiste Quenot wrote:

Hello,

I spent the whole day trying to figure out why after updating
Cocoon 2.1 the portal is broken.

When using  bookmark links  (BookmarkAction), everything  is fine.
But  when using  links  generated by  CopletTransformer, the  user
appears to be kicked off the portal (ie authentication credentials
are reset).

After many hours of debugging in Eclipse, we observed by chance that the
URL generated by CopletTransformer did not match the requested
server name:

We had:

http://localhost:8080/repons/portal/portal?cocoon-portal-event=116&;...

Instead of:

http://vision/repons/portal/portal?cocoon-portal-event=116&;...

In fact we are using Apache as frontend to our Cocoon application,
so the latest modifications to DefaultLinkService are not welcome!

I can read:

       info.linkBase.append(request.getScheme());
       info.linkBase.append("://");
       info.linkBase.append(request.getServerName());

This is perfectly wrong, because request.getServerName() returns
a piece of information only relevant within the local network
where the server lives, not for a public hypertext link.

So please, with sugar on top, revert your changes.

Reply via email to