Re: [Apache Bloodhound] #561: Display more user-friendly error page when navigating to a non-existing product

2013-06-20 Thread Apache Bloodhound
#561: Display more user-friendly error page when navigating to a non-existing
product
---+---
  Reporter:  rjollos   |  Owner:  rjollos
  Type:  enhancement   | Status:  review
  Priority:  major |  Milestone:  Release 6
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+---

Comment (by rjollos):

 Replying to [comment:8 olemis]:
   However I can't find a way to cause the product view page to be
 displayed.
 
  Two options
 
1. /products/x/products/x
2. set dashboard as default handler for product home page by using
 TracIni options

 Thanks, that clears up a lot. More questions on that later.

 At the moment we have (with some intermediate lines omitted for brevity):
 {{{#!python
 req.perm.require('PRODUCT_VIEW')
 pid = req.args.get('productid', None)
 if pid:
 req.perm('product', pid).require('PRODUCT_VIEW')
 }}}

 Per the testing I've done, this is equivalent to:
 {{{#!python
 pid = req.args.get('productid', None)
 req.perm('product', pid).require('PRODUCT_VIEW')
 }}}

 Does that make sense?

 I've also found a somewhat confusing scenario. Consider two products,
 `prod1` and `prod2`. If a user has permission to access `prod1`, they can
 view `/products/prod1/products/prod2` and what is displayed will be an
 empty dashboard, regardless of whether they permission to access
 `prod2`. Also, a user can see the list of all products by accessing
 `/products/prod1/products/`.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/561#comment:15
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #561: Display more user-friendly error page when navigating to a non-existing product

2013-06-20 Thread Apache Bloodhound
#561: Display more user-friendly error page when navigating to a non-existing
product
---+---
  Reporter:  rjollos   |  Owner:  rjollos
  Type:  enhancement   | Status:  review
  Priority:  major |  Milestone:  Release 6
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+---

Comment (by rjollos):

 Replying to [comment:15 rjollos]:
  At the moment we have (with some intermediate lines omitted for
 brevity):
  {{{#!python
  req.perm.require('PRODUCT_VIEW')
  pid = req.args.get('productid', None)
  if pid:
  req.perm('product', pid).require('PRODUCT_VIEW')
  }}}
 
  Per the testing I've done, this is equivalent to:
  {{{#!python
  pid = req.args.get('productid', None)
  req.perm('product', pid).require('PRODUCT_VIEW')
  }}}
 
  Does that make sense?

 Further investigation reveals that `req.perm.require('PRODUCT_VIEW')` in
 necessary to avoid the nonsensical message: ''PRODUCT_VIEW privileges are
 required to perform this operation on Product None. You don't have the
 required permissions.'' when accessing `/products` or
 `/products/prod1/products`.

  Also, a user can see the list of all products by accessing
 `/products/prod1/products/`.

 Please ignore this part. My previous testing was flawed.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/561#comment:16
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


svn commit: r1495037 - in /bloodhound/trunk/bloodhound_multiproduct/multiproduct: hooks.py web_ui.py

2013-06-20 Thread rjollos
Author: rjollos
Date: Thu Jun 20 14:56:32 2013
New Revision: 1495037

URL: http://svn.apache.org/r1495037
Log:
Fixes #561: Display a warning and the products list when accessing a 
non-existent product. Patch from Olemis, with minor modifications.

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py?rev=1495037r1=1495036r2=1495037view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py Thu Jun 20 
14:56:32 2013
@@ -50,11 +50,16 @@ class MultiProductEnvironmentFactory(Env
 # happen from within trac.web.main.dispatch_request
 req = RequestWithSession(environ, None)
 global_env._abs_href = req.abs_href
-env = multiproduct.env.ProductEnvironment(global_env,
-  product_prefix)
-# shift WSGI environment to the left
-environ['SCRIPT_NAME'] = script_name
-environ['PATH_INFO'] = path_info
+try:
+env = multiproduct.env.ProductEnvironment(global_env,
+  product_prefix)
+except LookupError:
+# bh:ticket:561 - Display product list and warning message
+env = global_env
+else:
+# shift WSGI environment to the left
+environ['SCRIPT_NAME'] = script_name
+environ['PATH_INFO'] = path_info
 return env
 
 if pid:

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py?rev=1495037r1=1495036r2=1495037view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py Thu Jun 20 
14:56:32 2013
@@ -49,33 +49,32 @@ class ProductModule(Component):
 
 def process_request(self, req):
 process request handler
-
-req.perm.require('PRODUCT_VIEW')
-
-path_info = req.args.get('pathinfo')
-if path_info and path_info != '/':
-raise HTTPNotFound(_('Unable to render product page. Wrong 
setup?'))
 
+req.perm.require('PRODUCT_VIEW')
 pid = req.args.get('productid', None)
 if pid:
 req.perm('product', pid).require('PRODUCT_VIEW')
-action = req.args.get('action', 'view')
-
-products = [p for p in Product.select(self.env)
-if 'PRODUCT_VIEW' in req.perm(Neighborhood('product',
-   p.prefix))]
-
-if pid:
-add_link(req, 'up', req.href.products(), _('Products'))
-
+
 try:
 product = Product(self.env, {'prefix': pid})
 except ResourceNotFound:
 product = Product(self.env)
-
-data = {'product': product,
-'context': web_context(req, product.resource)}
-
+
+path_info = req.args.get('pathinfo')
+if path_info and path_info != '/':
+if not product._exists:
+# bh:ticket:561 - Display product list and warning message
+if pid:
+add_warning(req, _(Product %(pid)s not found, pid=pid))
+return self._render_list(req)
+else:
+raise HTTPNotFound(
+_('Unable to render product page. Wrong setup?'))
+
+if pid:
+add_link(req, 'up', req.href.products(), _('Products'))
+
+action = req.args.get('action', 'view')
 if req.method == 'POST':
 if 'cancel' in req.args:
 req.redirect(req.href.products(product.prefix))
@@ -87,14 +86,27 @@ class ProductModule(Component):
 return self._render_editor(req, product)
 elif action == 'delete':
 raise TracError(_('Product removal is not allowed!'))
-
-if not pid:
-data = {'products': products,
-'context': web_context(req, Resource('product', None))}
-return 'product_list.html', data, None
-
+
+if not product._exists:
+if pid:
+# bh:ticket:561 - Display product list and warning message
+add_warning(req, _(Product %(pid)s not found, pid=pid))
+return self._render_list(req)
+
+data = {'product': 

Re: [Apache Bloodhound] #561: Display more user-friendly error page when navigating to a non-existing product

2013-06-20 Thread Apache Bloodhound
#561: Display more user-friendly error page when navigating to a non-existing
product
---+---
  Reporter:  rjollos   |  Owner:  rjollos
  Type:  enhancement   | Status:  closed
  Priority:  major |  Milestone:  Release 6
 Component:  multiproduct  |Version:
Resolution:  fixed |   Keywords:  hooks
---+---
Changes (by rjollos):

 * status:  review = closed
 * resolution:   = fixed


Comment:

 (In [1495037])

 Fixes #561: Display a warning and the products list when accessing a non-
 existent product. Patch from Olemis, with minor modifications.

 

 This ticket significantly improves behavior when navigating to a non-
 existing product, thanks Olemis! I did a bit of refactoring in
 `process_request`, so please let me know if you spot any issues.

 I'll just conclude by saying, more testing is needed, but from what I can
 see:

   * The permissions check:
   {{{#!python
   if pid:
   req.perm('product', pid).require('PRODUCT_VIEW')
   }}}
   doesn't seem to have any effect after
 `req.perm.require('PRODUCT_VIEW')`, as far as I could see (but I left it
 in place for now).
  * My previous statement seems to hold about
 `/products/prod1/products/prod2` displaying an empty dashboard when the
 user has permission to access `prod1` and regardless of whether they have
 permission to access `prod2`, and may be something we want to avoid.
  * Really what we need are some functional tests here, so the code can be
 properly refactored!

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/561#comment:17
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


[Apache Bloodhound] #567: Write functional test cases to track regressions on known issues

2013-06-20 Thread Apache Bloodhound
#567: Write functional test cases to track regressions on known issues
-+---
  Reporter:  olemis  |Owner:
  Type:  task|   Status:  new
  Priority:  major   |  Version:
Resolution:  |
-+---
 Initial targets :

   - Request handling in product web module #541 and #561

 ... more will be added later

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/567
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #554: Last Login does not update

2013-06-20 Thread Apache Bloodhound
#554: Last Login does not update
---+
  Reporter:  rjollos   |  Owner:  rjollos
  Type:  defect| Status:  accepted
  Priority:  critical  |  Milestone:  Release 6
 Component:  plugins   |Version:  0.5.3
Resolution:|   Keywords:  AccountManager
---+

Comment (by rjollos):

 What do you conclude so far? My feeling is that `last_visit` should
 update, at least within the specified 24 hour resolution. In Bloodhound,
 it does not seem to update even on first login when a new user is created.
 My observation was that `last_visit` is never updated on repeated login,
 and that seems to provide supporting evidence for what a user issue
 reported on the [http://markmail.org/message/mlywn6f3zned5duo mailing
 list]. So is the problem with !AccountManagerPlugin? Does Trac properly
 update `last_visit` if there hasn't been a login for  24 hours?

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/554#comment:16
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #567: Write functional test cases to track regressions on known issues

2013-06-20 Thread Apache Bloodhound
#567: Write functional test cases to track regressions on known issues
---+-
  Reporter:  olemis|  Owner:  nobody
  Type:  task  | Status:  new
  Priority:  minor |  Milestone:  Release 7
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  qa, functional test
---+-
Changes (by olemis):

 * priority:  major = minor
 * keywords:   = qa, functional test
 * component:   = multiproduct
 * owner:   = nobody
 * milestone:   = Release 7


-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/567#comment:1
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #541: TracStandalone crashing on default product misconfiguration

2013-06-20 Thread Apache Bloodhound
#541: TracStandalone crashing on default product misconfiguration
---+-
  Reporter:  olemis|  Owner:  rjollos
  Type:  defect| Status:  review
  Priority:  critical  |  Milestone:
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+-

Comment (by rjollos):

 What are good steps to reproduce the issue? Delete the default product
 directly in the database? The reason I ask, is that the default product
 can't be deleted right?

 I'm not questioning whether we should apply the patch, it is certainly
 worth protecting even against even odd corner cases, just wondering
 scenarios would lead to this issue, and how I can repeat the steps you
 took to reproduce the issue.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/541#comment:5
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


[Apache Bloodhound] #568: New tickets cannot be viewed

2013-06-20 Thread Apache Bloodhound
#568: New tickets cannot be viewed
---+
 Reporter:  avp|  Owner:  nobody
 Type:  defect | Status:  new
 Priority:  major  |  Milestone:
Component:  dashboard  |Version:
 Keywords: |
---+
 I'm running the trunk code.

 All new tickets I've created cannot be viewed.  Tickets can be created via
 the quick method or full method.  If I try and view, i get:

 Error: Invalid ticket number
 Ticket nnn does not exist.

 Apparently, just before this issue arose, I had changed the default
 Product name.

 All the tickets that cannot be viewed seem to have the new Product (I've
 looked in the db with sqlite3).  This seems like it might be related.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/568
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #541: TracStandalone crashing on default product misconfiguration

2013-06-20 Thread Apache Bloodhound
#541: TracStandalone crashing on default product misconfiguration
---+-
  Reporter:  olemis|  Owner:  rjollos
  Type:  defect| Status:  review
  Priority:  critical  |  Milestone:
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+-

Comment (by rjollos):

 Okay, I think you mean that the issue occurs when `[ticket]
 default_product` is set to a non-existent product. However, so far I can't
 reproduce the issue you describe.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/541#comment:6
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #513: HTTP protocol violation on factories misconfiguration

2013-06-20 Thread Apache Bloodhound
#513: HTTP protocol violation on factories misconfiguration
---+-
  Reporter:  olemis|  Owner:  rjollos
  Type:  defect| Status:  review
  Priority:  blocker   |  Milestone:  Release 6
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks configuration
---+-

Comment (by rjollos):

 When `[trac] environment_factory` points to a non-existent path, I see:
 {{{
 Error

 TracError: IOError: [Errno 2] No such file or directory
 }}}

 I don't find anything in the logs that points to the problem. It would be
 nice to get a more specific error, but I have no idea if that is possible.
 This is definitely an improvement over the previous behavior.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/513#comment:4
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #509: Test compatibility with XMLRPC Plug-in

2013-06-20 Thread Apache Bloodhound
#509: Test compatibility with XMLRPC Plug-in
---+--
  Reporter:  mbooth|  Owner:  rjollos
  Type:  task  | Status:  review
  Priority:  critical  |  Milestone:  Release 6
 Component:  plugins   |Version:
Resolution:|   Keywords:  rpc XmlRpcPlugin
---+--

Comment (by rjollos):

 (In [1495233])

 Refs #509: Expose global commands in `ProductAdminModule`. Patch by
 Olemis.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/509#comment:16
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


svn commit: r1495233 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py

2013-06-20 Thread rjollos
Author: rjollos
Date: Thu Jun 20 23:18:08 2013
New Revision: 1495233

URL: http://svn.apache.org/r1495233
Log:
Refs #509: Expose global commands in `ProductAdminModule`. Patch by Olemis.

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py?rev=1495233r1=1495232r2=1495233view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py 
(original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/product_admin.py Thu 
Jun 20 23:18:08 2013
@@ -295,9 +295,11 @@ class ProductAdminModule(Component):
 mgr = self.product_admincmd_mgr(args[0])
 return mgr.complete_command(args[1:])
 
+GLOBAL_COMMANDS = ('deploy', 'help', 'hotcopy', 'initenv', 'upgrade')
+
 def _do_product_admin(self, prefix, *args):
 mgr = self.product_admincmd_mgr(prefix)
-if args and args[0] in ('deploy', 'hotcopy', 'initenv', 'upgrade'):
+if args and args[0] in self.GLOBAL_COMMANDS:
 raise AdminCommandError('%s command not supported for products' %
 (args[0],))
 if args and args[0] == 'help':




svn commit: r1495235 - in /bloodhound/trunk/trac/trac: hooks.py web/main.py

2013-06-20 Thread rjollos
Author: rjollos
Date: Thu Jun 20 23:28:09 2013
New Revision: 1495235

URL: http://svn.apache.org/r1495235
Log:
Refs #514: Extract code from `trac.web.main` to function 
`load_boostrap_handler` in `trac.hooks`.

Modified:
bloodhound/trunk/trac/trac/hooks.py
bloodhound/trunk/trac/trac/web/main.py

Modified: bloodhound/trunk/trac/trac/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/trac/trac/hooks.py?rev=1495235r1=1495234r2=1495235view=diff
==
--- bloodhound/trunk/trac/trac/hooks.py (original)
+++ bloodhound/trunk/trac/trac/hooks.py Thu Jun 20 23:28:09 2013
@@ -19,6 +19,8 @@ import os
 import imp
 import inspect
 
+import pkg_resources
+
 from trac.config import Configuration
 from trac.env import open_environment
 from trac.util.concurrency import threading
@@ -222,5 +224,25 @@ class DefaultBootstrapHandler(BootstrapH
 
 default_bootstrap_handler = DefaultBootstrapHandler()
 
+def load_bootstrap_handler(bootstrap_ep, log=None):
+Load handler for environment lookup and instantiation of request objects
+
+:param bootstrap_ep: entry point specification
+:param log: file-like object used to report errors
+
+bootstrap = None
+if bootstrap_ep:
+try:
+ep = pkg_resources.EntryPoint.parse('x = ' + bootstrap_ep)
+bootstrap = ep.load(require=False)
+except Exception, e:
+if log:
+log.write([FAIL] [Trac] entry point '%s'. Reason %s %
+  (bootstrap_ep, repr(exception_to_unicode(e
+if bootstrap is None:
+bootstrap = default_bootstrap_handler
+return bootstrap
+
+
 # Recursive imports
 from trac.web.main import send_project_index, get_environments

Modified: bloodhound/trunk/trac/trac/web/main.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/trac/trac/web/main.py?rev=1495235r1=1495234r2=1495235view=diff
==
--- bloodhound/trunk/trac/trac/web/main.py (original)
+++ bloodhound/trunk/trac/trac/web/main.py Thu Jun 20 23:28:09 2013
@@ -342,13 +342,12 @@ class RequestDispatcher(Component):
 
 _slashes_re = re.compile(r'/+')
 
-def dispatch_request(environ, start_response, bootstrap=None):
+
+def dispatch_request(environ, start_response):
 Main entry point for the Trac web interface.
 
 :param environ: the WSGI environment dict
 :param start_response: the WSGI callback for starting the response
-:param bootstrap: handler responsible for environment lookup and
-  instantiating request objects
 
 
 # SCRIPT_URL is an Apache var containing the URL before URL rewriting
@@ -382,21 +381,10 @@ def dispatch_request(environ, start_resp
 
 locale.setlocale(locale.LC_ALL, environ['trac.locale'])
 
-if bootstrap is None:
-bootstrap_ep = environ['trac.bootstrap_handler']
-if bootstrap_ep:
-from pkg_resources import EntryPoint
-try:
-ep = EntryPoint.parse('x = ' + bootstrap_ep)
-bootstrap = ep.load(require=False)
-except Exception, e:
-log = environ.get('wsgi.errors')
-if log:
-log.write([FAIL] [Trac] Entry point '%s'. Reason %s %
-  (bootstrap_ep, repr(exception_to_unicode(e
-if bootstrap is None:
-from trac.hooks import default_bootstrap_handler
-bootstrap = default_bootstrap_handler
+# Load handler for environment lookup and instantiation of request objects
+from trac.hooks import load_bootstrap_handler
+bootstrap = load_bootstrap_handler(environ['trac.bootstrap_handler'],
+   environ.get('wsgi.errors'))
 
 # Determine the environment
 




Re: [Apache Bloodhound] #514: TracStandalone middlewares compatible with hooks

2013-06-20 Thread Apache Bloodhound
#514: TracStandalone middlewares compatible with hooks
+---
  Reporter:  olemis |  Owner:  rjollos
  Type:  task   | Status:  review
  Priority:  major  |  Milestone:  Release 6
 Component:  trac core  |Version:
Resolution: |   Keywords:  tracd authentication bep-0003
+---

Comment (by rjollos):

 (In [1495235])

 Refs #514: Extract code from `trac.web.main` to function
 `load_boostrap_handler` in `trac.hooks`.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/514#comment:8
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


svn commit: r1495238 - in /bloodhound/trunk: bloodhound_multiproduct/multiproduct/hooks.py trac/trac/hooks.py trac/trac/web/standalone.py

2013-06-20 Thread rjollos
Author: rjollos
Date: Thu Jun 20 23:36:12 2013
New Revision: 1495238

URL: http://svn.apache.org/r1495238
Log:
Refs #514: Implemented authentication middleware for custom web bootstrap 
handlers. Patch by Olemis.

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
bloodhound/trunk/trac/trac/hooks.py
bloodhound/trunk/trac/trac/web/standalone.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py?rev=1495238r1=1495237r2=1495238view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py Thu Jun 20 
23:36:12 2013
@@ -120,4 +120,5 @@ class ProductRequestWithSession(RequestW
 
 class ProductRequestFactory(RequestFactoryBase):
 def create_request(self, env, environ, start_response):
-return ProductRequestWithSession(env, environ, start_response)
+return ProductRequestWithSession(env, environ, start_response) \
+if env else RequestWithSession(environ, start_response)

Modified: bloodhound/trunk/trac/trac/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/trac/trac/hooks.py?rev=1495238r1=1495237r2=1495238view=diff
==
--- bloodhound/trunk/trac/trac/hooks.py (original)
+++ bloodhound/trunk/trac/trac/hooks.py Thu Jun 20 23:36:12 2013
@@ -107,6 +107,12 @@ class BootstrapHandlerBase(object):
 || trac.locale ||  || Target locale ||
 || trac.base_url || TRAC_BASE_URL || Trac base URL hint ||
 
+A new entry named 'trac.env_name' identifying environment SHOULD be
+added (e.g. used by tracd to choose authentication realms). 
+As a side-effect the WSGI environment dict (i.e. `environ`) may be
+modified in many different ways to prepare it for subsequent
+dispatching.
+
 This method may handle the request (e.g. render environment index page)
 in case environment lookup yields void results. In that case it MUST 
 invoke WSGI `write` callable returned by `start_response` and raise 
@@ -114,6 +120,7 @@ class BootstrapHandlerBase(object):
 
 :param environ: WSGI environment dict
 :param start_response: WSGI callback for starting the response
+:return: environment object
 :throws RequestDone: if the request is fully processed while loading
  target environment e.g. environment index page
 :throws EnvironmentError: if it is impossible to find a way to locate
@@ -125,6 +132,45 @@ class BootstrapHandlerBase(object):
 
 raise NotImplementedError(Must override method 'open_environment')
 
+def default_probe_environment(self, environ):
+By default it will invoke `open_environment` and discard the
+resulting environment object. This approach is generic but not
+efficient. Should be overridden whenever possible. 
+
+# If the expected configuration keys aren't found in the WSGI 
environment,
+# try looking them up in the process environment variables
+environ.setdefault('trac.env_path', os.getenv('TRAC_ENV'))
+environ.setdefault('trac.env_parent_dir',
+   os.getenv('TRAC_ENV_PARENT_DIR'))
+environ.setdefault('trac.env_index_template',
+   os.getenv('TRAC_ENV_INDEX_TEMPLATE'))
+environ.setdefault('trac.template_vars',
+   os.getenv('TRAC_TEMPLATE_VARS'))
+environ.setdefault('trac.locale', '')
+environ.setdefault('trac.base_url',
+   os.getenv('TRAC_BASE_URL'))
+
+try:
+self.open_environment(environ, 
+  lambda status, headers: (lambda data: None))
+except Exception:
+# Handle all exceptions; else potential HTTP protocol violation
+pass
+
+def probe_environment(self, environ):
+This method is aimed at providing a lightweight version of
+`open_environment` by solely applying upon `environ` the side effects 
+needed to dispatch the request in environment context.
+
+By default it will invoke `open_environment` and discard the
+resulting environment object. Specialized versions will have the chance
+to implement more efficient strategies in case environment
+instantiation may be avoided. 
+
+:return: None
+
+self.default_probe_environment(environ)
+
 def create_request(self, env, environ, start_response):
 Instantiate request object used in subsequent request dispatching
 
@@ -148,7 +194,9 @@ class DefaultBootstrapHandler(BootstrapH
 
 def 

[Apache Bloodhound] #570: Bootstrap template for product_edit.html

2013-06-20 Thread Apache Bloodhound
#570: Bootstrap template for product_edit.html
--+---
  Reporter:  rjollos  |Owner:
  Type:  enhancement  |   Status:  new
  Priority:  major|  Version:
Resolution:   |
--+---
 A bootstrap template is needed to replace `product_edit.html`.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/570
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #569: QCT view/edit link can direct to Error: Invalid ticket number

2013-06-20 Thread Apache Bloodhound
#569: QCT view/edit link can direct to Error: Invalid ticket number
---+
  Reporter:  rjollos   |  Owner:  nobody
  Type:  defect| Status:  new
  Priority:  major |  Milestone:
 Component:  multiproduct  |Version:
Resolution:|   Keywords:
---+

Comment (by olemis):

 Replying to [comment:2 jdreimann]:
  Quick Ticket should never be scoped. I still firmly believe that scoping
 of any of the main-nav, search and qct elements provides a predictably
 confusing experience, not a predictably useful experience.
 

 I do not agree . Just consider a multi-domain deployment and scoping does
 make sense .

  We should simply default to the current product in the relevant drop
 down within the quick ticket dialogue.

 I do want quick ticket form to be scoped considering active product
 context, or at least default values set consistently.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/569#comment:4
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #541: TracStandalone crashing on default product misconfiguration

2013-06-20 Thread Apache Bloodhound
#541: TracStandalone crashing on default product misconfiguration
---+-
  Reporter:  olemis|  Owner:  rjollos
  Type:  defect| Status:  review
  Priority:  critical  |  Milestone:
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+-

Comment (by olemis):

 Replying to [comment:7 rjollos]:
  I've also tried with `[multiproduct] `default_product_prefix` set to a
 non-existent product, but can't reproduce still.

 You won't because the system you are testing against is different to the
 one I used once I reported the issue . Like [comment:11:ticket:561 I
 mentioned before] the patches for #561 (already committed?) are related to
 this issue as well . Just go back to a changeset prior to those
 modifications and you'll notice .

 Anyway these changes deal with some inconsistencies dealing not solved by
 the solution proposed for #561 .

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/541#comment:8
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


Re: [Apache Bloodhound] #541: TracStandalone crashing on default product misconfiguration

2013-06-20 Thread Apache Bloodhound
#541: TracStandalone crashing on default product misconfiguration
---+-
  Reporter:  olemis|  Owner:  rjollos
  Type:  defect| Status:  review
  Priority:  critical  |  Milestone:
 Component:  multiproduct  |Version:
Resolution:|   Keywords:  hooks
---+-

Comment (by rjollos):

 Replying to [comment:8 olemis]:
  Replying to [comment:7 rjollos]:
   I've also tried with `[multiproduct] `default_product_prefix` set to a
 non-existent product, but can't reproduce still.
 
  You won't because the system you are testing against is different to the
 one I used once I reported the issue . Like [comment:11:ticket:561 I
 mentioned before] the patches for #561 (already committed?) are related to
 this issue as well . Just go back to a changeset prior to those
 modifications and you'll notice .

 Let me ask just to be sure. You are saying if I go back to the revision
 prior to that which the patches for #561 were committed, then I can
 reproduce the issue by setting `[multiproduct] default_product_prefix` to
 a non-existent product?

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/541#comment:9
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker


[Apache Bloodhound] #571: nokia 6

2013-06-20 Thread Apache Bloodhound
#571: nokia 6
-+-
  Reporter:  nokia6  |Owner:
  Type:  task|   Status:  new
  Priority:  major   |  Version:  0.3.0
Resolution:  |
-+-
 a href=http://sieumuachung.vn/;mua chung/a

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/571
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound issue tracker