-
Notifications
You must be signed in to change notification settings - Fork 470
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
Issue 11609 fixes mssql #13239
Issue 11609 fixes mssql #13239
Changes from 40 commits
9525217
f285dc8
8a6444a
ce25b42
60ef0e7
eeb4172
0929145
1f17c62
4cd30de
fe70d6c
677079c
161c206
ab38919
d30507c
4992dd9
df465db
f558a7b
329da3e
a0fbd9c
82e3837
96c6ceb
6a709f4
c4d12df
92347c1
5ab4a08
694375b
62e4317
6caba12
43483c8
cc1cde1
8f0b9bf
0261f20
ff87ab2
71bac80
dd52111
12c54fa
e2ee88e
ad8f3cd
c834fab
058930d
85dfe15
fa246ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.dotmarketing.db.DbConnectionFactory; | ||
import com.dotmarketing.util.UtilMethods; | ||
|
||
/** | ||
|
@@ -213,4 +214,17 @@ public static boolean toBoolean(final String strBool, final boolean defaultBool) | |
} | ||
} | ||
|
||
/** | ||
* Based on a value get from the database, if it is a boolean will returns a cast. | ||
* Otherwise will use the {@link DbConnectionFactory} to determinate the boolean value cross-db | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Otherwise, it will use .... to determine" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thx |
||
* @param objectBoolean {@link Object} | ||
* @return boolean | ||
*/ | ||
public static boolean toBooleanFromDb(final Object objectBoolean) { | ||
|
||
return (objectBoolean instanceof Boolean)? | ||
Boolean.class.cast(objectBoolean): | ||
DbConnectionFactory.isDBTrue(objectBoolean.toString()); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.dotmarketing.portlets.workflows.business; | ||
|
||
import java.util.EnumSet; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import com.dotcms.contenttype.model.type.ContentType; | ||
import com.dotmarketing.beans.Permission; | ||
|
@@ -14,20 +16,13 @@ | |
import com.dotmarketing.portlets.fileassets.business.IFileAsset; | ||
import com.dotmarketing.portlets.structure.model.Structure; | ||
import com.dotmarketing.portlets.workflows.actionlet.WorkFlowActionlet; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowAction; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowActionClass; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowActionClassParameter; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowComment; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowHistory; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowProcessor; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowScheme; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowSearcher; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowStep; | ||
import com.dotmarketing.portlets.workflows.model.WorkflowTask; | ||
import com.dotmarketing.portlets.workflows.model.*; | ||
import com.liferay.portal.model.User; | ||
|
||
public interface WorkflowAPI { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
public static final Set<WorkflowStatus> DEFAULT_SHOW_ON = EnumSet.of(WorkflowStatus.LOCKED, WorkflowStatus.UNLOCKED); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is share between other object and need the visibility to be use as a part of the biz rule |
||
|
||
public void registerBundleService (); | ||
|
||
public WorkFlowActionlet newActionlet(String className) throws DotDataException; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package com.dotmarketing.portlets.workflows.model; | ||
|
||
import com.dotmarketing.util.Logger; | ||
import com.dotmarketing.util.UtilMethods; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
@@ -31,16 +34,21 @@ public static String toCommaSeparatedString(final Set<WorkflowStatus> workflowSt | |
* @param value Object | ||
* @return Set of {@link WorkflowStatus} | ||
*/ | ||
public static Set<WorkflowStatus> toSet(Object value) { | ||
public static Set<WorkflowStatus> toSet(final Object value) { | ||
|
||
Set<WorkflowStatus> workflowStatusSet = Collections.emptySet(); | ||
|
||
if (null != value) { | ||
|
||
workflowStatusSet = Stream | ||
.<String>of(value.toString().split(DELIMITER)) | ||
.map(WorkflowStatus::valueOf) | ||
.collect(Collectors.toSet()); | ||
if (null != value && UtilMethods.isSet(value.toString())) { | ||
|
||
try { | ||
workflowStatusSet = Stream | ||
.<String>of(value.toString().split(DELIMITER)) | ||
.map(WorkflowStatus::valueOf) | ||
.collect(Collectors.toSet()); | ||
} catch (Exception e) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no specific one, so |
||
Logger.error(WorkflowStatus.class, "No show On data on workflow action record, bad data?"); | ||
workflowStatusSet = Collections.emptySet(); | ||
} | ||
} | ||
|
||
return workflowStatusSet; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Based on a value obtained from database, if it is a boolean will return a cast"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx