Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotConnect Identifiers #13194

Closed
wezell opened this issue Dec 8, 2017 · 3 comments
Closed

DotConnect Identifiers #13194

wezell opened this issue Dec 8, 2017 · 3 comments

Comments

@wezell
Copy link
Contributor

wezell commented Dec 8, 2017

I am seeing this in my logs:

WARN  2017-12-07 20:12:13,622 com.dotmarketing.filters.CMSUrlUtil:warn(181): XSS Found in Query String: b=${dotcmsReleaseVersion}
WARN  2017-12-07 20:12:13,630 com.dotmarketing.filters.CMSUrlUtil:warn(181): XSS Found in Query String: b=${dotcmsReleaseVersion}
ERROR 2017-12-07 20:12:15,144 com.dotmarketing.viewtools.BrowserAPI:velocityError(245): Could not load folders :  @ url:POST//demo.dotcms.com/dwr/call/plaincall/BrowserAjax.openFolderContent.dwr | lang:1 | ip:0:0:0:0:0:0:0:1 | Admin:true | start:12-07-2017 08:11:05 EST  ref:http://localhost:8080/c/portal/layout?p_l_id=b7ab5d3c-5ee0-4195-a17e-8f5579d718dd&p_p_id=site-browser&p_p_action=0&&dm_rlout=1&r=1512695496185&in_frame=true&frame=detailFrame&container=true
java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_112]
	at java.lang.Long.parseLong(Long.java:601) ~[?:1.8.0_112]
	at java.lang.Long.parseLong(Long.java:631) ~[?:1.8.0_112]
	at java.text.DigitList.getLong(DigitList.java:195) ~[?:1.8.0_112]
	at java.text.DecimalFormat.parse(DecimalFormat.java:2051) ~[?:1.8.0_112]
	at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869) ~[?:1.8.0_112]
	at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514) ~[?:1.8.0_112]
	at java.text.DateFormat.parse(DateFormat.java:364) ~[?:1.8.0_112]
	at com.dotmarketing.util.ConvertToPOJOUtil.getFolderFields(ConvertToPOJOUtil.java:297) ~[ConvertToPOJOUtil.class:?]
	at com.dotmarketing.util.ConvertToPOJOUtil.convertDotConnectMapToFolder(ConvertToPOJOUtil.java:261) ~[ConvertToPOJOUtil.class:?]
	at com.dotmarketing.portlets.folders.business.FolderFactoryImpl.getSubFolders(FolderFactoryImpl.java:173) ~[FolderFactoryImpl.class:?]
	at com.dotmarketing.portlets.folders.business.FolderFactoryImpl.getSubFoldersTitleSort(FolderFactoryImpl.java:125) ~[FolderFactoryImpl.class:?]
	at com.dotmarketing.portlets.folders.business.FolderFactoryImpl.getFoldersByParent(FolderFactoryImpl.java:306) ~[FolderFactoryImpl.class:?]
	at com.dotmarketing.portlets.folders.business.FolderAPIImpl.findSubFolders_aroundBody6(FolderAPIImpl.java:165) ~[FolderAPIImpl.class:?]
	at com.dotmarketing.portlets.folders.business.FolderAPIImpl$AjcClosure7.run(FolderAPIImpl.java:1) ~[FolderAPIImpl$AjcClosure7.class:?]
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.8.10.jar:?]
@wezell
Copy link
Contributor Author

wezell commented Dec 8, 2017

Looks like we have a static final DateFormat in the ConvertToPOJOUtil. I don't think it is thread safe.

@wezell
Copy link
Contributor Author

wezell commented Dec 8, 2017

Looks like there are a number of problems with the ConvertToPOJOUtil

  1. We should be using the DotConnect.loadObjectResults() which gives us a map of java objects back, rather than just strings that need to be reparsed, which is error prone.

  2. We don't need all the MultitreeFactory getChildrenClassByOrder methods. These need to go away. I removed them all in my branch here, which probably should have been merged first:
    https://github.com/dotCMS/core/tree/issue-13164-delete-template_container

  3. Why are we using a static class ConvertToPOJOUtil? Why not use a non static class that would be thread safe?
    List<Identifier> list = new IdentifierTransformer(results).asList();

  4. I think we should have small Transformer classes that are each responsible for transforming a single pojo or list of pojos, instead of one big class.

wezell added a commit that referenced this issue Dec 8, 2017
wezell added a commit that referenced this issue Dec 8, 2017
wezell added a commit that referenced this issue Dec 8, 2017
wezell added a commit that referenced this issue Dec 8, 2017
wezell added a commit that referenced this issue Dec 8, 2017
@dsilvam dsilvam added this to the Rex Current milestone Dec 13, 2017
nollymar added a commit that referenced this issue Dec 14, 2017
nollymar added a commit that referenced this issue Dec 14, 2017
dsilvam pushed a commit that referenced this issue Dec 14, 2017
* #13194 some untested fixes

* #13194 use map.getOrDefault methods

* #13194 loadObjectResults

* #13194 jenkins feedback fixes

* #13194 fixes the red

* #13194 Replacing ConvertToPojoUtil by DBTransformers

* #13194 Removing reflection calls

* #13194 Applying sonar suggestions
@dsilvam dsilvam added the Merged label Dec 14, 2017
@dsilvam
Copy link
Contributor

dsilvam commented Dec 15, 2017

jgambarios pushed a commit that referenced this issue Dec 27, 2017
* #13164 untested work

* #13164 removes multitreefactory from hibernate, includes treefactory

* #13164 removes tree from inode and category hibernate

* #13164 removing old code

* core#13192 edit mode parsing

* #13192 edit mode parsing

* #13192 contenttool

* #13194 some untested fixes

* #13194 use map.getOrDefault methods

* #13194 loadObjectResults

* #13194 jenkins feedback fixes

* #13194 fixes the red

* #13192 Container+Content Resource

* #13192 adding widget support

* #13192 adding widget support

* #13192 container pulling

* Add lang variables and update edit contentlet save and cancel functions to report back to ng

* #13192 multitree updates

* #13192 removing templatecontainers import

* #13192 removing templatecontainers from hibernate

* #13192 allow multitree to be imported

* #13192 fixes import

* #13192 copying velocity work to new folder

* Update ContentSelector dojo widget to make it work with ng

* #13192 kinda running

* #13192 look ma, no red

* Fix ContentSelector select event

* Fix edit contentlet requires fields

* #13192 live mode working

* #13192 slow and steady

* #13192 live mode

* #13192 live mode working

* #13192 preview mode working exclaimation point

* #13192 readding the integration tests

* #13192 ContainerResourceWorking

* Merge remote-tracking branch 'remotes/origin/master' into issue-13192-edit-mode-cleanup

# Conflicts:
#	dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java

* #13192 CloseDB aspect fixed

* #13192 unable to save pages

* #13192 white space cleanup
@wezell wezell closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants