[ 
https://issues.apache.org/jira/browse/OFBIZ-5312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13820590#comment-13820590
 ] 

Jacques Le Roux commented on OFBIZ-5312:
----------------------------------------

Here is a summary of the curent state of the branch , and new requirements 
specifications:

*Current state* (issues in bold)
#  Only the OFBiz moutpoint (eg ecommerce) is used to define the "primary url". 
So we have http://localhost:8080/ecommerce/ instead of previously 
http://localhost:8080/ecommerce/control/main.
# The /category/ and /product/ part of the url (prefixes) are mandatories. This 
to discriminate in case of (unlikely but possible) same Ids for both a category 
and a product.
# Only 1 level of category is supported, no complete paths to sub-categories.
# The internal product name or category name _AND_ the product or category Ids 
are used to build the urls.
# The generated urls end with the suffix ".html".
# *You can get to a category or product with different urls*. All mixed 
combinations of upper or lower cases are possible, even for the /category/ and 
/product/ prefixes. *This is a NO-NO in a SEO perspective, because of possible 
duplicated contents*.
# *When you get to a category, from the left category tree, the url does not 
change.* Note that it works from the breadcrumb.

\\
\\
*New requirements/propositions "specifications"* (issues in bold). Each of 
these new requirements, must be handled in a separated sub-task (Jira issues).
# Like we have /category/ and /product/, adding /catalog/ in the generated urls 
should be considered.
# *The /category/ and /product/ prefixes should always be in lower case.*
# *The categoryId and productId part of the generated urls must respect user 
enterered  or generated case* (they are primary keys and only them, with 
/category/ and /product/ prefixes, guarantee urls unicity).
# Though you can create a product with special characters (not ANSI), an url 
like <<http://localhost:8080/ecommerce/çà-test.html>> (rendered as shown) is 
not supported. *Special characters should be UTF-8 encoded and corresponding 
pages correctly rendered*. 
#  About the ."html" suffix, we all agreed having it or not is a moot point. So 
we will provide a property for user choice, say "productWithHmlSuffix". And to 
mimic REST, where ressources are simply URLs without suffixes, we will use 
"productWithHmlSuffix=N" OOTB (ie use a property which default to no ".html" 
suffix).
# Check [Pierre Smits's comment 
above|https://issues.apache.org/jira/browse/OFBIZ-5312?focusedCommentId=13797683]
 about *multi-tenant in ecommerce*.
# Configuration of the content and search urls, Parimal respectively suggested 
Domain_Name/content/content_name and Domain_Name/search/keyword. 
# Documentation of SEO generated urls parameters.
# We could introduce multi levels for categories, ie complete paths to 
sub-categories. For instance, from the breadcrumb, you get to 
http://localhost:8080/ecommerce/category/large-gizmos-102.html but not 
http://localhost:8080/ecommerce/category/gismos-100/large-gizmos-102.html. From 
an SEO POV there is no need for the second. But for OFBiz users (those handling 
content) it could be nice to have the choice. It must be a choice (using a 
property) because if you have 10 levels or more (you never know what people can 
come with ) with the 2nd possibilty only, OFBiz would render far too long URLs. 
Notably if the category names are long. This is optional, by default 1 level of 
category will be used.
# To shorten URLs, OFBiz users could want to remove the "product category name" 
or/and the the "internal product name" from the generated urls. So we should 
allow to not add them. This should be documented options (properties) for both
* categoryUrlWithOnlyNumber
* productUrlWithOnlyNumber.

\\
\\
*Technical notes*
# About Special characters to UTF-8 encoded in generated urls, see 
SeoContextFilter.java comment: <<"// check to make sure the requested url is 
allowed>>
# The new effort for content and search urls could be based on the work done 
for category and product. SeoContentUrlFilter.java must be checked to see if 
not (partially?) already done.
# In a comment above, I noted that "The Perl5Matcher Perl5Compiler are not 
thread safe". This was handled by Jinghai using the 
Perl5Compiler.READ_ONLY_MASK field.  It's a thread safe implementation and I 
also noticed Jinghai used local caches (userExceptionPatterns and seoPatterns 
Maps) for multiple compiled patterns (fixed unique asciiPattern and 
regexpIfMatch are not concerned). As noted in the oro Javadoc, there is a small 
pattern matching overhead when using Perl5Compiler.READ_ONLY_MASK. The OFBiz 
OOTB ComilerMatcher class can be used to workaround this if really necessary. I 
believe we don't need to worry about that OOTB, but it's worth to be noted here.
# Check the use org.ofbiz.product.category.ftl.UrlRegexpTransform instead of 
org.ofbiz.webapp.ftl.OfbizUrlTransform for ofbizUrl macro.

\\
\\
Please add a comment, if you see something is wrong, missing or complete, 
thanks!

> Proposal: URL-Generation Changes
> --------------------------------
>
>                 Key: OFBIZ-5312
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5312
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: specialpurpose/ecommerce
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>            Priority: Minor
>              Labels: changes, ecommerce, friendly, seo, url
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-5312 - ofbiz-ecommerce-seo.patch, OFBIZ-5312 - 
> ofbiz-ecommerce-seo.patch, OFBIZ-5312 - ofbiz-ecommerce-seo.patch, OFBIZ-5312 
> - ofbiz-ecommerce-seo.patch, OFBIZ-5312 - ofbiz-ecommerce-seo.patch, 
> OFBIZ-5312 - ofbiz-ecommerce-seo.patch, OFBIZ-5312 - 
> ofbiz-ecommerce-seo.patch, OFBIZ-5312 - ofbiz-ecommerce-seo.patch, OFBIZ-5312 
> - ofbiz-ecommerce-seo.patch, OFBIZ-5312 - ofbiz-ecommerce-seo.patch, 
> OFBIZ-5312 - ofbiz-ecommerce-seo.patch, OFBIZ-5312 - 
> ofbiz-ecommerce-seo.patch, OFBiz-5312-product-ecommerce-seo-20131031.patch, 
> OFBiz-5312-product-ecommerce-seo-for-seo-branch.patch, 
> OFBiz-5312-product-ecommerce-seo.patch, SeoContextFilter.java.patch
>
>
> [This was proposed by Paul Piper in Nabble 7 months 
> ago|http://ofbiz.135035.n4.nabble.com/Proposal-URL-Generation-Changes-td4639289.html].
>  Here is quoted Paul's proposal
> {quote}
> Hey Everyone,
> over at ilscipio (www.ilscipio.com) we developed a set of functional OFBiz 
> changes that we believe the entire community could benefit from. The changes 
> have been implemented in parts in Syracus (www.syracus.net) for a while now, 
> but we figured that some of which are too crucial for ofbiz' success in the 
> long run, so we are considering the contribution (as we did with the SOLR 
> component).
> As you are probably aware, OFBiz has a pretty uncommon way of generating 
> URLs. Most of this has to do with the fact that OFBiz uses a servlet 
> (ControlServlet)  to handle all requests. The servlet is mounted at /control, 
> so that it won't interfere with other servlets. Though functionally valid, 
> this has the sideeffect that all urls are actually created on /control, which 
> is neither pretty, nor good by any measures of SEO. It also means that a few 
> 302 redirects are necessary to forward the user from / to /control/main. It 
> also makes requests more complicated, since many forwards are necessary 
> whenever somebody wants to move away from this implementation.
> Since this is hurtful to many of the implementers, I wanted to discuss 
> whether or not you guys would be interested in the changes we have made. The 
> functional changes contain:
> * Removal of /control out of all the urls
> * SEO-friendly URLS
> * Configurable product/category and other URLs
> * Frontpage mapping from /main to /
> It was tested on our end and contains all necessary improvements (Transforms, 
> Sample Configuration, Servlets & Filters) for it to be applicable.
> If interested, I would create a new JIRA ticket for this and after a few 
> minor internal discussions, we will gladly provide the rest of you with it.
> Regards,
> Paul 
> {quote}
> There is even a patch, mostly done by Jinghai Shi, that I attach here. Even 
> if it has been already used in [Syracus|http://syracus.net/] since early this 
> year, some help would be needed to test it thoroughly in OFBiz.
> Then we should discuss if it's the way to go. I believe it is. Who needs a 
> /control/ or /main by default in ecommerce urls? Would you not prefer 
> http://localhost:8080/ecommerce/ over 
> http://localhost:8080/ecommerce/control/main ?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to