This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
(resource == null || resource.length() <= 0)
From Java spec. a String, Collection, Map or CharSequence can't have a negative length, so the pattern above can be reduced to
(resource == null || resource.length() == 0)
which can be replaced using
UtilValidate.isEmpty()
I checked, there are several other occurrences of this pattern (some very old, I guess most were routinely copied from an initial occurrence). I decided to replace all of them, here they are.
I did that already long ago for the
(resource == null || resource.length() == 0)
pattern. It remains 4 of them. Three are justified (because of the dependency on base component or because using isEmpty() on Object is disputable for performance reasons). I took care of the remaining one right aways (in SplashScreen.java)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747976 13f79535-47bb-0310-9956-ffa450edef68
1. The following xsd are duplicated to use namespaces
site-conf.xsd -> site-conf-ns.xsd
widget-form.xsd -> widget-form-ns.xsd
widget-screen.xsd -> widget-screen-ns.xsd
widget-menu.xsd -> widget-menu-ns.xsd
simple-methods.xsd-> simple-methods-ns.xsd
For example, in site-conf-ns.xsd, we have the following document level attribute
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://ofbiz.apache.org/Site-Conf" targetNamespace="http://ofbiz.apache.org/Site-Conf">
instead of
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
2. The above schema are used into compound-widgets.xsd so that compound widgets use only one consolidated schema.
3. Update ExampleCompoundWidgets.xml to use the new compound-widgets.xsd. For example
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sc="http://ofbiz.apache.org/Site-Conf"
xmlns:sm="http://ofbiz.apache.org/Simple-Method"
xmlns:wf="http://ofbiz.apache.org/Widget-Form"
xmlns:wt="http://ofbiz.apache.org/Widget-Tree"
xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">
<sc:site-conf>
<sc:request-map uri="CompoundWidgets1">
<sc:security https="true" auth="true"/>
<sc:event type="simple" invoke="CompoundWidgetsFunc" path="component://example/widget/example/ExampleCompoundWidgets.xml"/>
<sc:response name="success" type="view" value="CompoundWidgets1"/>
</sc:request-map>
<sc:request-map uri="CompoundWidgets2"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="CompoundWidgets2"/></sc:request-map>
<sc:view-map name="CompoundWidgets1" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets1"/>
<sc:view-map name="CompoundWidgets2" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets2"/>
</sc:site-conf>
...... the rest
4. Change java code to support reading xml with namespace (i.e. xml for compound widgets)
jleroux: I simply replaced tabs by spaces in Java files and removed this commented out line
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/compound-widgets.xsd">
in ExampleCompoundWidgets.xml
We decided to duplicate the simple-methods.xsd rather than updating all concerned files. Else we would have to update the attributes at document level for rest of the controllers, menus, forms, simple methods and screens. For example, in controller.xml, we would have to change
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd”
to
xmlns="http://ofbiz.apache.org/sc” xsi:schemaLocation="http://ofbiz.apache.org/dtds/site-conf-ns.xsd”>
But especially we would have to use the same syntax with namespaces prefixes than in ExampleCompoundWidgets.xml (see example above). This can be discussed because with auto-completion it's not a big deal, but could be overwhelming for existing custom projects...
James mentionned that "the schema location at compound-widgets.xsd is relative to the project...". I don't see any problems with that. We can keep as is as long as we maintain the relation (ie if the main XSDs are moved). Moreover with the previous addition of compound-widgets.xsd in widget-catalog.xml it seems all things work correctly (eg w/o the new *-ns.xsd yet committed, the auto-completion works well in ExampleCompoundWidgets.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746302 13f79535-47bb-0310-9956-ffa450edef68
The tests did not pass because of xmlrpc. Simply adding it in http.request-map.list in url.properties and like for SOAPService request setting <security https="false"/> does it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746254 13f79535-47bb-0310-9956-ffa450edef68
I just realised that the main change (the one in ConfigXMLReader.java, exposed in a comment in OFBIZ-6849) was not committed in r1745525. I guess it was because of tests I did for OFBIZ-4090, I certainly removed these changes then and forgot to put them back.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746159 13f79535-47bb-0310-9956-ffa450edef68
Quoting Deepak on dev ML
Hi Jacques,
I think in fop.xconf file we have to keep http url, as FOP does not support
https baseUrl for external graphics due to certificate issue (not remember
exact reason).
{code}
<!-- Base URL for resolving relative URLs -->
- <base>http://localhost:8080</base>
+ <base>https://localhost:8443</base>
{code}
If we set the https as <base> than images will not be rendered. Please
refer
http://demo-trunk-ofbiz.apache.org/ordermgr/control/order.pdf?orderId=DEMO10091
and we get following error on console:
{code}
[java] 2016-05-27 13:51:48,308 |http-nio-8443-exec-3 |FOUserAgent
|E| Image not found. URI: /images/ofbiz_logo.gif. (No context
info available)
{code}
If we set the http url than its working fine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1745732 13f79535-47bb-0310-9956-ffa450edef68
Completes in screens the changes done in forms at r1741873. I then replaced few form lists by grids, where it was possible to do it with regexp.
Also complete StatsForms.xml to use only grids and "searchList" form in ecommerce ContentForms to NOT use grid (not called in screen)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1742196 13f79535-47bb-0310-9956-ffa450edef68
Because using SecureRandom comes with a cost, I have identified the places where it's reasonable to keep the non secured Random (like tests, internal sequences, etc.).
Ant to use UUID.randomUUID to generate the external link id
Also, though there are no real proven vulnerabilities, I decided to backport as much as possible since it's now public.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741684 13f79535-47bb-0310-9956-ffa450edef68
We are using Groovy as event in the controller request, everything works fine for us but as we used delegator.find()
it generates the following error
ERROR: Cannot do a find that returns an EntityListIterator with no transaction in place. Wrap this call in a transaction.
[java] java.lang.Exception: Stack Trace
[java] at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1757) [ofbiz-entity.jar:?]
[java] at org.ofbiz.entity.Delegator$find.call(Unknown Source) [ofbiz-entity.jar:?]
[java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) [groovy-all-2.2.1.jar:2.2.1]
[java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-all-2.2.1.jar:2.2.1]
[java] at ProductInventory$_run_closure1.doCall(ProductInventory.groovy:18) [script:?]
Reason:
Since we are using find method of GenericDelegator.java
As per the code implementation it required the transaction should exist
if (!TransactionUtil.isTransactionInPlace()) {
if not, it generate error
ERROR: Cannot do a find that returns an EntityListIterator with no transaction in place. Wrap this call in a transaction.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Solution: initialize the transaction when the groovy is called as event and commit the transaction after the completion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1740629 13f79535-47bb-0310-9956-ffa450edef68
Adrian: This adds the ability to include screen widgets, form widgets, menu widgets, and simple methods in a single XML file. This approach could be used in situations where the widgets share a logical grouping - so they can be kept in one place.
James: An example to test out Compound Screen Widget
jlerouxc: here are the changes and tests globally
# As James mentionned we no longer need *-v2.xsd files, I removed them from Adrian's patch
# I created a compound-widgets.xsd based on Adrian's and James Yong's previous work. From Paul Foxworthy's comment in OFBIZ-4090, I decided to name the root compound-widgets (hence the file name). I arranged its elements in another way, see below with ExampleCompoundWidgets.xml
# I slightly modified James Yong's ExampleCompoundScreenWidget.xml file and renamed it ExampleCompoundWidgets.xml. I added an "s" because there are several OFBiz widgets gathered in one place. For the modifications: I simply changed the names and arranged the elements in another way which I find better suited. I'm used to 1st create the query, then the menus, the screens and their forms. We rarely use widget-trees but it's there also. Finally the simple-method at end if any. The order is not enforced though, so everybody can use her/his own :)
# I added a French label
# I completed the widget-catalog.xml with this new entry and tested locally in Eclipse by reloading the XML catalog entries.
I hope I did not miss nor mixed things, the local instance I used is a bit overcrowded with pending changes...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738958 13f79535-47bb-0310-9956-ffa450edef68
Replaces the deprecated StAXSOAPModelBuilder(XMLStreamReader) and StAXOMBuilder(reader) in SOAPEventHandler.java. I did not find how to test though...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737789 13f79535-47bb-0310-9956-ffa450edef68
Problem
=======
Go to http://localhost:8080/ecommerce/
Change the language dropdown from English to another language will revert back to English. I am using SVN revision 1735923
jleroux: This was due to OFBIZ-6879 ("Remove forceHttpSession feature"). Now as soon as you start with HTTPS instead of HTTP it works. I mean other links don't get back on HTTP, see OFBIZ-6966 for details... More to come with OFBIZ-6849, hopefully soon...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737046 13f79535-47bb-0310-9956-ffa450edef68
There are few cases where we show the sessionId in logs (using UtilHttp.getSessionId() in or HttpSessionEvent.getSession().getId()) in other places)
Despite we secured the log access at r1489461, I feel better using a properties to opt in, false by default.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1729348 13f79535-47bb-0310-9956-ffa450edef68
r1727987: Removes the forceManualJsessionid feature - OFBIZ-6867
and
r1728121: Gets rid of the session-cookie-accepted feature - OFBIZ-6871
are done we can remove the now useless cookies variables, this does it
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1728660 13f79535-47bb-0310-9956-ffa450edef68
We should always use sessionIds in cookies and newer have sessionsIds in URLs. So I will remove all sessionsIds in URLs. There are 2 cases:
* the part related to spiders in RequestHandler
* HtmlFormRenderer.appendExternalLoginKey() (there is also an appendExternalLoginKey method in MacroFormRenderer class but it's not used OOTB)
I also removed some old commented out code in RequestHandler class
There are also many cases where we show the sessionId in logs (using UtilHttp.getSessionId()) I wonder if we should not keep those commented out or change the debug info level. Also HttpSessionEvent.getSession().getId() is directly used in some places for the same purpose (log)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1728375 13f79535-47bb-0310-9956-ffa450edef68
X-XSS-Protection
This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
It's usually enabled by default anyway, so the role of this header is to re-enable the filter for this particular website if it was disabled by the user.
This header is supported in IE 8+, and in Chrome (not sure which versions). The anti-XSS filter was added in Chrome 4. Its unknown if that version honored this header.
FireFox has still an open bug entry and "offers" only the noscript plugin.
https://wiki.mozilla.org/Security/Features/XSS_Filterhttps://bugzilla.mozilla.org/show_bug.cgi?id=528661
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1720213 13f79535-47bb-0310-9956-ffa450edef68
This for 3 reasons:
1) Tomcat protects the cookies which it cares about (session and SSO cookies) but not all. Notably the OFBiz specific cookies, like visitorCookie. I guess also trackableCookie, billableCookie, siteIdCookie, updatedTimeStampCookie, guestShoppingListCookie, usernameCookieName and autoLoginCookie are not secured with The data in those cookies are less sensible than jsessionId but anyway it's safer to have them all secured.
2) I don't want to debug the ecommerce issue I reported in OFBIZ-6655. And if I don't use the sessionConifg_ecommerce.patch but rather reapply r1719762 then it's OK (if I also locally revert r1686574 done for OFBIz-6111, still waiting on this one...)
3) I see no reasons why someone would not want her cookies secured, as recommended by OWASP and others
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1719939 13f79535-47bb-0310-9956-ffa450edef68
The secure flag on cookies instructs the browser to only submit the cookie as part of requests over secure (HTTPS) connections. This prevents the cookie from being observed as plain text in transit over the network.
The HttpOnly flag instructs the browser that this cookie can only be accessed when sending an HTTP request. This prevents scripts running as part of a page from retrieving the value and is a defense against XSS attacks.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1719762 13f79535-47bb-0310-9956-ffa450edef68
Adds X-Content-Type-Options. According to Wikipedia and Owasp, the only defined value, "nosniff", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1719682 13f79535-47bb-0310-9956-ffa450edef68
jleroux: the issue description is quite lengthy so I will summarise it here, please refer to the Jira issue for details.
"When a customer creates an account on eCommerce site, s/he will also need to answer a security question. This security question then can be used by the user to reclaim her/his account in case s/he forgets her/his password. If the user correctly answers the required security question while reclaiming her/his account, her/his password will be sent through email notification. This part would work in the same way as the existing functionality of email password (forget password)."
The description was actually more ambitious (several questions, possibility for users to create own questions) but AFAIK these parts have not been implemented.
Apart updating the patch which did not merge, I got 2 majors issues (and few others I will not report here) I bypassed with workarounds.
Unlike Harsha, and as I reported earlier in the issue, I never got the username (userLoginId) back when using hidden parameters in the request body (not in requestParameters, ie UtilHttp.getParameterMap(request)), nor actually any parameters. This is maybe due to my OS (Windows7 was XP before) or my email client (Outlook Express then, now Thunderbird) or even my SMTP configuration (I used my ISP SMTP server) but most probably because I did it all on my sole machine (localhost). I tried to understand what was happening to request body parameters with http://www.telerik.com/fiddler, but finally gave up because it's even more complicated when https is in the picture. So I decided to rather use parameters in the URL (Query string). It's a bit less safe, though the password is OFBiz encrypted, and should be replaced. But it's safe enough because only the user should receive this message and even if the message is sniffed during its journey it should be hard to decrypt the password!
Harsha used the SecurityExtUiLabels.xml (created by ashish at r1618415) in securityext component but there is already a SecurityextUiLabels.xml in common component. Since I use Windows OFBiz was unable to retrieve the labels from SecurityExtUiLabels.xml since I guess it looked into a SecurityextUiLabels.xml. So I renamed a SecurityExtUiLabels.xml to EmailPassword.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1716915 13f79535-47bb-0310-9956-ffa450edef68
Removes useless commented out code in UtilCodec.java
Replaces a tab by spaces in ContextFilter.java
Removes useless line and replaces tabs by spaces in OFBizSolrContextFilter.java (annoying in compare)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713991 13f79535-47bb-0310-9956-ffa450edef68
Currently many EntityUtilProperties requests have the .properties extension in the parameters for the resource, but this is not needed as it is stripped later on.
jleroux: I found 5 others, replaced also
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713985 13f79535-47bb-0310-9956-ffa450edef68
SimpleContentViewHandler will return mime type 'text/html' for all DataResource values without a specified mimeTypeId. Changing to DataResourceWorker.getMimeType will allow determining the mimeTypeId by file extension
Fixing the mime type will allow the browsers to display content inline if UtilHttp is updated aswell. All unknown extensions will be set to octet-stream causing the browser to prompt for download
jleroux: after some discussions, this finally uses a content-disposition-type property in requestHandler.properties to allow more flexibility for users (see UtilHttp.setContentDisposition() method). Beware "inline" is less secure. For this reason, Gareth forced the "dangerous" text/html mime type to application/octet-stream in SimpleContentViewHandler class. This to prevent possible static XSS attacks. See the Jira issue for more details.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712835 13f79535-47bb-0310-9956-ffa450edef68
Add a check on whether viewName is empty to view-last branch. If it's empty, try to use the value in the response config if it exists.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1693231 13f79535-47bb-0310-9956-ffa450edef68
With NotoSans by default, no need to specify the NotoSans "font-family" to write special characters in examples PDF (including content called from example).
This already worked in reports because of "fop.font.family=NotoSans" in fop.properties. It's also the way to use for custom reports.
I also added <auto-embed/> like we have <auto-detect/> but I'm unsure of what it does exactly (I suppose it embeds the fonts glyphs in the PDF) because the FOP documentation is unclear about it (to say the least). If someone knows better please chime in!
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1675061 13f79535-47bb-0310-9956-ffa450edef68