Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHOReVOLUTION
syncope
Commits
5c31dce5
Commit
5c31dce5
authored
Jun 19, 2017
by
Gianluca Filippone
Browse files
Fixed EE selection behavior
parent
7fb4ffd1
Changes
7
Hide whitespace changes
Inline
Side-by-side
core/src/main/resources/domains/MasterContent.xml
View file @
5c31dce5
...
...
@@ -577,7 +577,7 @@ we are happy to inform you that the password request was execute successfully fo
<SyncopeSchema
id=
"status"
/>
<PlainSchema
id=
"status"
mandatoryCondition=
"true"
multivalue=
"0"
readonly=
"0"
type=
"Enum"
uniqueConstraint=
"0"
enumerationValues=
"
PENDING
CREATE;PENDING UPDATE;PENDING ENACTMENT;STARTED;FROZEN;STOPPED;PENDING DELETE"
multivalue=
"0"
readonly=
"0"
type=
"Enum"
uniqueConstraint=
"0"
enumerationValues=
"CREATE
D
;PENDING UPDATE;PENDING ENACTMENT;STARTED;FROZEN;STOPPED;PENDING DELETE"
anyTypeClass_id=
"Choreography"
/>
<SyncopeSchema
id=
"description"
/>
...
...
core/src/test/resources/domains/MasterContent.xml
View file @
5c31dce5
...
...
@@ -578,7 +578,7 @@ we are happy to inform you that the password request was execute successfully fo
<SyncopeSchema id="status"/>
<PlainSchema id="status" mandatoryCondition="true"
multivalue="0" readonly="0" type="Enum" uniqueConstraint="0" enumerationValues="
PENDING
CREATE;PENDING UPDATE;PENDING ENACTMENT;STARTED;FROZEN;STOPPED;PENDING DELETE"
multivalue="0" readonly="0" type="Enum" uniqueConstraint="0" enumerationValues="CREATE
D
;PENDING UPDATE;PENDING ENACTMENT;STARTED;FROZEN;STOPPED;PENDING DELETE"
anyTypeClass_id="Choreography"/>
<SyncopeSchema id="chorSpec"/>
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/panels/ChoreographyDirectoryPanel.java
View file @
5c31dce5
...
...
@@ -35,7 +35,6 @@ import org.apache.syncope.common.lib.to.GroupTO;
import
org.apache.syncope.client.console.wizards.WizardMgtPanel
;
import
org.apache.syncope.client.console.wizards.any.AnyWrapper
;
import
org.apache.syncope.common.lib.types.AnyTypeKind
;
import
org.apache.syncope.common.lib.types.ClientExceptionType
;
import
org.apache.syncope.common.lib.types.SchemaType
;
import
org.apache.wicket.PageReference
;
import
org.apache.wicket.ajax.AjaxRequestTarget
;
...
...
@@ -157,41 +156,32 @@ public class ChoreographyDirectoryPanel extends GroupDirectoryPanel {
String
chorStatus
=
model
.
getObject
().
getPlainAttrMap
().
get
(
"status"
).
getValues
().
iterator
().
next
();
ChoreographyActionsPanel
choreographyActionsPanel
=
new
ChoreographyActionsPanel
(
componentId
);
if
(
chorStatus
.
equals
(
"
PENDING CREATE"
)
||
chorStatus
.
equals
(
"PENDING UPDATE
"
))
{
if
(
chorStatus
.
equals
(
"
CREATED
"
))
{
choreographyActionsPanel
.
addAction
(
new
IndicatingAjaxLink
<
Void
>(
"link"
)
{
private
static
final
long
serialVersionUID
=
-
7978723352517770644L
;
@Override
public
void
onClick
(
final
AjaxRequestTarget
target
)
{
try
{
String
eeKey
=
choreographyRestClient
.
getChoreographyEE
(
model
.
getObject
().
getKey
()).
getKey
();
choreographyRestClient
.
enactChoreography
(
model
.
getObject
().
getKey
(),
eeKey
);
SyncopeConsoleSession
.
get
().
info
(
getString
(
Constants
.
OPERATION_SUCCEEDED
));
target
.
add
(
container
);
utilityModal
.
setContent
(
new
SelectEEModalPanel
(
utilityModal
,
model
.
getObject
(),
pageRef
));
utilityModal
.
header
(
Model
.
of
(
"Select Enactment Engine"
));
utilityModal
.
show
(
true
);
target
.
add
(
utilityModal
);
}
catch
(
SyncopeClientException
e
)
{
if
(
e
.
getType
().
equals
(
ClientExceptionType
.
NotFound
))
{
utilityModal
.
setContent
(
new
SelectEEModalPanel
(
utilityModal
,
model
.
getObject
(),
pageRef
));
utilityModal
.
header
(
Model
.
of
(
"Select Enactment Engine"
));
utilityModal
.
show
(
true
);
target
.
add
(
utilityModal
);
}
else
{
LOG
.
error
(
"While enacting choreography {}"
,
model
.
getObject
().
getName
(),
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
?
e
.
getClass
().
getName
()
:
e
.
getMessage
());
}
LOG
.
error
(
"While enacting choreography {}"
,
model
.
getObject
().
getName
(),
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
?
e
.
getClass
().
getName
()
:
e
.
getMessage
());
}
((
BasePage
)
pageRef
.
getPage
()).
getNotificationPanel
().
refresh
(
target
);
}
},
ChoreographyActionsPanel
.
ChoreographyActionType
.
ENACT
);
}
if
(!
chorStatus
.
equals
(
"
PENDING
CREATE"
)
if
(!
chorStatus
.
equals
(
"CREATE
D
"
)
&&
!
chorStatus
.
equals
(
"PENDING UPDATE"
)
&&
!
chorStatus
.
equals
(
"PENDING ENACTMENT"
))
{
choreographyActionsPanel
.
addAction
(
new
IndicatingAjaxLink
<
Void
>(
"link"
)
{
...
...
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/panels/SelectEEModalPanel.java
View file @
5c31dce5
...
...
@@ -113,12 +113,12 @@ public class SelectEEModalPanel extends AbstractModalPanel<Serializable> {
AnyObjectRestClient
anyObjectRestClient
=
new
AnyObjectRestClient
();
List
<
AnyObjectTO
>
enactmentEngines
=
anyObjectRestClient
.
search
(
SyncopeConstants
.
ROOT_REALM
,
new
AnyObjectFiqlSearchConditionBuilder
(
"ENACTMENT ENGINE"
).
query
(),
1
,
1
,
new
SortParam
<>(
"name"
,
false
),
"ENACTMENT ENGINE"
);
SyncopeConstants
.
ROOT_REALM
,
new
AnyObjectFiqlSearchConditionBuilder
(
"ENACTMENT ENGINE"
).
query
(),
1
,
-
1
,
new
SortParam
<>(
"name"
,
false
),
"ENACTMENT ENGINE"
);
setChoiceRenderer
(
new
EnactmentEngineRenderer
());
setChoices
(
enactmentEngines
);
...
...
ext/choreography/client-console/src/main/resources/org/apache/syncope/client/console/panels/ResizeModalPanel.html
View file @
5c31dce5
...
...
@@ -16,14 +16,12 @@ limitations under the License.
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:wicket=
"http://wicket.apache.org"
>
<wicket:panel>
<span
wicket:id=
"container"
>
<div
class=
"form-group"
>
<form
wicket:id=
"resizeChoreographyForm"
>
<div
class=
"form-group"
>
<span
wicket:id=
"size"
/>
</div>
</form>
</div>
</span>
<div
wicket:id=
"container"
>
<form
wicket:id=
"resizeChoreographyForm"
>
<div
class=
"form-group"
>
<span
wicket:id=
"size"
/>
</div>
</form>
</div>
</wicket:panel>
</html>
\ No newline at end of file
ext/choreography/client-console/src/main/resources/org/apache/syncope/client/console/panels/SelectEEModalPanel.html
View file @
5c31dce5
...
...
@@ -15,15 +15,24 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:wicket=
"http://wicket.apache.org"
>
<wicket:head>
<style>
div
.spacer
{
height
:
100px
;
}
</style>
</wicket:head>
<wicket:panel>
<span
wicket:id=
"container"
>
<div
class=
"form-group"
>
<form
wicket:id=
"selectEEForm"
>
<fieldset
class=
"form-group"
>
<form
wicket:id=
"selectEEForm"
>
<div
class=
"form-group"
>
<span><label>
Enactment Engine
</label></span>
<fieldset
class=
"input-group"
>
<select
wicket:id=
"eeSelect"
/>
</fieldset>
</form>
</div>
<div
class=
"spacer"
></div>
</div>
</form>
</span>
</wicket:panel>
</html>
ext/choreography/logic/src/main/java/org/apache/syncope/core/logic/ChoreographyLogic.java
View file @
5c31dce5
...
...
@@ -344,7 +344,7 @@ public class ChoreographyLogic extends AbstractLogic<AbstractBaseBean> {
choreography
.
setRealm
(
SyncopeConstants
.
ROOT_REALM
);
choreography
.
getAuxClasses
().
add
(
"Choreography"
);
choreography
.
getPlainAttrs
().
add
(
new
AttrTO
.
Builder
().
schema
(
CHOREOGRAPHY_STATUS_SCHEMA
).
value
(
"
PENDING
CREATE"
).
build
());
new
AttrTO
.
Builder
().
schema
(
CHOREOGRAPHY_STATUS_SCHEMA
).
value
(
"CREATE
D
"
).
build
());
choreography
.
getPlainAttrs
().
add
(
new
AttrTO
.
Builder
().
schema
(
"chorSpec"
).
value
(
Base64Utility
.
encode
(
choreographyTO
.
getChorspec
())).
build
());
...
...
@@ -418,7 +418,7 @@ public class ChoreographyLogic extends AbstractLogic<AbstractBaseBean> {
Map
<
String
,
AttrTO
>
choreographyAttrs
=
choreography
.
getPlainAttrMap
();
if
(!
choreographyAttrs
.
containsKey
(
CHOREOGRAPHY_STATUS_SCHEMA
)
||
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
isEmpty
()
||
!
"
PENDING
CREATE"
.
equals
(
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
get
(
0
)))
{
||
!
"CREATE
D
"
.
equals
(
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
get
(
0
)))
{
AnyObjectTO
enactmentEngine
=
enactmentEngineForChoreography
(
choreography
.
getKey
());
try
{
...
...
@@ -471,12 +471,32 @@ public class ChoreographyLogic extends AbstractLogic<AbstractBaseBean> {
// Enactment Engine selection
AnyObjectTO
enactmentEngine
;
try
{
//
If already defined, select
the enactment engine
for the choreography
enactmentEngine
=
enactmentEngineForChoreography
(
choreography
.
get
Key
()
);
//
Prefer always
the enactment engine
specified as argument
enactmentEngine
=
enactmentEngineForChoreography
(
enactmentEngine
Key
);
}
catch
(
NotFoundException
e
)
{
try
{
// If the EE was not already selected, search for the enactment engine and set the relationship
enactmentEngine
=
enactmentEngineExists
(
enactmentEngineKey
);
// Remove all previous memberships of EE with the selected choreography
MembershipCond
membershipCond
=
new
MembershipCond
();
membershipCond
.
setGroup
(
choreography
.
getKey
());
AnyTypeCond
anyTypeCond
=
new
AnyTypeCond
();
anyTypeCond
.
setAnyTypeKey
(
ENACTMENT_ENGINE_TYPE
);
SearchCond
serviceCond
=
SearchCond
.
getAndCond
(
SearchCond
.
getLeafCond
(
anyTypeCond
),
SearchCond
.
getLeafCond
(
membershipCond
));
for
(
AnyObjectTO
service
:
anyObjectLogic
.
search
(
serviceCond
,
1
,
-
1
,
Collections
.
emptyList
(),
SyncopeConstants
.
ROOT_REALM
,
false
))
{
AnyObjectPatch
patch
=
new
AnyObjectPatch
();
patch
.
setKey
(
service
.
getKey
());
patch
.
getMemberships
().
add
(
new
MembershipPatch
.
Builder
().
operation
(
PatchOperation
.
DELETE
).
group
(
choreography
.
getKey
()).
build
());
anyObjectLogic
.
update
(
patch
,
false
);
}
// Add membership with the selected EE
AnyObjectPatch
eePatch
=
new
AnyObjectPatch
();
eePatch
.
setKey
(
enactmentEngine
.
getKey
());
eePatch
.
getMemberships
().
add
(
new
MembershipPatch
.
Builder
().
group
(
choreography
.
getKey
()).
build
());
...
...
@@ -493,7 +513,7 @@ public class ChoreographyLogic extends AbstractLogic<AbstractBaseBean> {
if
(
choreographyAttrs
.
containsKey
(
CHOREOGRAPHY_STATUS_SCHEMA
)
&&
!
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
isEmpty
()
&&
"
PENDING
CREATE"
.
equals
(
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
get
(
0
)))
{
&&
"CREATE
D
"
.
equals
(
choreographyAttrs
.
get
(
CHOREOGRAPHY_STATUS_SCHEMA
).
getValues
().
get
(
0
)))
{
String
generatedChoreographyId
=
null
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment