More on this. I've managed to get this working using the appropriate 202
config setting for relative_path.
 
As a reminder I'm trying to achieve a kind of mod_jk behaviour where
apache is able to point different URLs to different external ruby
instances running on different ports. 
 
These ruby instances need to know what apache is naming them (their
relative paths if you will) so they can generate the appropriate
external links (e.g. for emails) and also for correct relative (to the
server root) link creation. All standard stuff (if ive missed a trick
here please let me know!) 
 
I;ve had to apply a few hacks so far:
 
I have had to create "development", "test" and "production" symlinks
within the public directory that point to "." 
 
This lets most of the core portal behaviour work with with two epf
wikis, one called test and one called development:
 
ProxyPass http://dse/test/ to http://localhost:3001/test/ 
 
and 
 
ProxyPass http://dse/development/ to http://localhost:3001/development/ 
 
However it seems the URL creation code where EPFWIKI_HOST is used to
generate the wiki URLs (the activate your wiki sites) is assuming that
the site lives at the root.
 
The code that is parsing this is:
 
>From models/wiki.rb +195
 
  def url(absolute = false, request_host = ENV['EPFWIKI_HOST'])
    #--
    # TODO anomaly, the following line shouldn't be necessary but is, in
some cases.
    # When this method is called from page.url request_host will be nil
    #++
    request_host = ENV['EPFWIKI_HOST'] if request_host.nil?
 
    logger.debug("url for site #{self.title}, absolute
#{absolute.inspect}, request_host #{request_host.inspect}")
    s = "/#{ENV['EPFWIKI_WIKIS_FOLDER']}/#{self.folder}/index.htm"
    s = "http://#{request_host}#{s}"; if absolute
    logger.debug("returning: #{s}")
    s
  end

The debug log for my site says the following:
 
url for site DSUP, absolute false, request_host "dse/test/"
returning: /test_wikis/dsup/index.htm

What is of note is the "absolute" value being false which prevents the
main http://#{request_host}#{s <http:///#{request_host}#{s> }" being
appended.
 
For now I am changing this to default to "true" in the signature in the
hope that it wont break anything.
 
Another issue I have is that the actual wiki.js and css inserted by EPF
hasnt got the correct path and therefore doesnt load:
 
<!-- epfwiki head start -->     
        <script src="/javascripts/prototype.js
<http://dse/javascripts/prototype.js> " type="text/javascript"
language="JavaScript"></script>         
        <link href="/stylesheets/wiki.css
<http://dse/stylesheets/wiki.css> " media="screen" rel="Stylesheet"
type="text/css" />      
        <script src="/javascripts/wiki.js
<http://dse/javascripts/wiki.js> " type="text/javascript"
language="JavaScript"></script>         
 
When this is inserted i dont know, i.e. is it at runtime or during
importing a new baseline.
 
I'm currently inspecting "models/page.rb" to see if i can find out.
 
 
I will keep you informed at to progress, I'm about 1 hour from giving up
I think but I hate to be beaten, especially when im hacking a language I
dont know!
 
John

________________________________

From: [email protected] [mailto:[email protected]]
On Behalf Of John Allen
Sent: 02 March 2011 14:12
To: Eclipse Process Framework Project Developers List
Subject: Re: [epf-dev] NoMethodError in # when using EPF Wiki -
baselineprocess, comments tab -
Importance: High


Onno,
 
I've finally got round to trying this but am getting an error that
indicates relative_url_root doesnt live on ActionController::Base:Class.
 
A quick google hunt (http://www.ruby-forum.com/topic/185961
<http://www.ruby-forum.com/topic/185961> ) suggests that in version
2.0.2 rails it lived on a different class.
 
So to the question in hand, what rails version do you think i can run
the wiki under? My colleague that installed it originally said he had
problems using a more modern version of rails. 
 
What version do you guys use?
 
Thanks,
John

________________________________

From: [email protected] [mailto:[email protected]]
On Behalf Of Onno van der Straaten
Sent: 08 February 2011 14:36
To: Eclipse Process Framework Project Developers List
Subject: Re: [epf-dev] NoMethodError in # when using EPF Wiki - baseline
process, comments tab -


Hi John,
If you want to run from a sub folder you will need to change that but
that won't be enough.

That variable is used for creating hyperlinks in emails that are send
using a scheduled job. The job is of course unaware of the domain name
and so forth. To make sure that links are correct you change that to
ENV['EPFWIKI_HOST'] = "localhost:3000/yourpath"

In addition to that you also need to add something like 
config.action_controller.relative_url_root = '/yourpath' 
to environment.rb to ensure that the Rails rooting will be working fine.
I have not tested this before so I'm not sure it will work. But if you
want to try that I'm willing to help you fix any issues you might
stumble upon along the way.
Cheers,
Onno



On Tue, Feb 8, 2011 at 3:19 PM, John Allen <[email protected]>
wrote:


        Thanks Onno,
         
        Will try that right now.
         
        While I'm digging into that can I ask you another questions? 
         
        EPFWiki seems to assume its mapped to the root of the web server
URL as when we use a ProxyPass setting that locates the wiki's under
some other arbitrary prefix the wiki's pages don't load properly (my
developer says that the web clients make requests for pages that don't
exist). 
         
        It's very normal for a web app to ask what it's URL "root" is to
prevent this issue. Is this what :
         
        ENV['EPFWIKI_HOST'] = "localhost:3000" # used for jobs, when
there is no host variable in the environment
        
        Is for?
         
        Thanks in advance,
        John
        
         
________________________________

        From: [email protected]
[mailto:[email protected]] On Behalf Of Onno van der Straaten
        Sent: 08 February 2011 14:11
        To: Eclipse Process Framework Project Developers List
        Subject: Re: [epf-dev] NoMethodError in # when using EPF Wiki -
baseline process, comments tab -
        
        
        Hi John,
        Hard to say from this alone. But can you try the following. 
        
        Open the file app/helpers/application_helper.rb and find the
method link_to_comment. The method contains the following code
        link_to(truncate(strip_tags(comment.text)), :controller =>
'pages', :action => 'discussion', :site_folder => comment.site.folder,
:id => comment.page.id) 
        
        Can you remove truncate, so change this line to
        link_to(strip_tags(comment.text), :controller => 'pages',
:action => 'discussion', :site_folder => comment.site.folder, :id =>
comment.page.id) 
        
        Restart the web server and try again. This problem could be
related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=333900 so
removing truncate can be a workaround.
        
        If problems persist and this is a new installationI suggest you
recreate the database and try again. Are you doing this on Windows or
Linux?
        
        HTH,
        Onno
        
        
        
        
        
        
        On Tue, Feb 8, 2011 at 2:14 PM, John Allen
<[email protected]> wrote:
        

                Can anyone suggest why we are getting this: 

                Showing comments/_comments_list.rhtml where line #26
raised: 

                undefined method `length' for
#<Enumerable::Enumerator:0x2aae0e6db8e8> 

                Extracted source (around line #26): 

                23:                <% comment.review_note = 'Click to
add...' if comment.review_note.blank? %>
                24:              <tr>
                25:                 <td><%= comment.id %></td>
                26:                  <td><%= link_to_comment comment
%></td>
                27:                  <td><%=
comment.created_on.strftime("%I:%M %p %d-%b-%y") %></td>        
                28:                  <td><%= link_to_user comment.user
%></td>        
                29:                  <td><%= link_to_page comment.page
%></td>
                

                Trace of template inclusion: /sites/description.rhtml 

                RAILS_ROOT: /apps/epfwiki/epfwiki 

                Application Trace <http://dse/sites/comments/3#>  |
Framework Trace <http://dse/sites/comments/3#>  | Full Trace
<http://dse/sites/comments/3#>  
        
/apps/epfwiki/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/he
lpers/text_helper.rb:50:in `truncate'
                app/helpers/application_helper.rb:248:in
`link_to_comment'
                app/views/comments/_comments_list.rhtml:26:in
`_run_erb_47app47views47comments47_comments_list46rhtml'
                app/views/comments/_comments_list.rhtml:22:in `each'
                app/views/comments/_comments_list.rhtml:22:in
`_run_erb_47app47views47comments47_comments_list46rhtml'
                app/views/sites/description.rhtml:52:in
`_run_erb_47app47views47sites47description46rhtml'
                app/controllers/sites_controller.rb:144:in `comments' 

                Request 


                Parameters: 

                {"id"=>"3"} 

                Show session dump <http://dse/sites/comments/3#>  


                Response 


                Headers: 

                {"cookie"=>[],
                 "Cache-Control"=>"no-cache"} 


                Thanks, 
                John 

                ______________________________________________ 
                John Allen - Solution Architect, Senior Manager 
                t +44 (0)207 812 4626 | m +44 (0)778 753 3602 
                f +44 (0)207 812 4100 | c +44 (0)207 897 9424 # 93410
59633
                a Detica | 2 Arundel Street | London | WC2R 3AZ | UK 
                Please do not send emails to this account protectively
marked as restricted or above 
                ______________________________________________ 
                www.detica.com - a BAE Systems company 

                Please consider the environment before printing this
email.
                
                This message should be regarded as confidential. If you
have received this email in error please notify the sender and destroy
it immediately.
                Statements of intent shall only become binding when
confirmed in hard copy by an authorised signatory.  The contents of this
email may relate to dealings with other companies within the Detica
Limited group of companies.
                
                Detica Limited is registered in England under No:
1337451.
                
                Registered offices: Surrey Research Park, Guildford,
Surrey, GU2 7YP, England.
                

                _______________________________________________
                epf-dev mailing list
                [email protected]
                https://dev.eclipse.org/mailman/listinfo/epf-dev
                
                


        Please consider the environment before printing this email.
        
        This message should be regarded as confidential. If you have
received this email in error please notify the sender and destroy it
immediately.
        Statements of intent shall only become binding when confirmed in
hard copy by an authorised signatory.  The contents of this email may
relate to dealings with other companies within the Detica Limited group
of companies.
        
        Detica Limited is registered in England under No: 1337451.
        
        Registered offices: Surrey Research Park, Guildford, Surrey, GU2
7YP, England.
        

        _______________________________________________
        epf-dev mailing list
        [email protected]
        https://dev.eclipse.org/mailman/listinfo/epf-dev
        
        


Please consider the environment before printing this email.

This message should be regarded as confidential. If you have received
this email in error please notify the sender and destroy it immediately.
Statements of intent shall only become binding when confirmed in hard
copy by an authorised signatory.  The contents of this email may relate
to dealings with other companies within the Detica Limited group of
companies.

Detica Limited is registered in England under No: 1337451.

Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP,
England.


Please consider the environment before printing this email.

This message should be regarded as confidential. If you have received this 
email in error please notify the sender and destroy it immediately.
Statements of intent shall only become binding when confirmed in hard copy by 
an authorised signatory.  The contents of this email may relate to dealings 
with other companies within the Detica Limited group of companies.

Detica Limited is registered in England under No: 1337451.

Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.

_______________________________________________
epf-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/epf-dev

Reply via email to