Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fabio martelli
syncope
Commits
fdaf7bb5
Commit
fdaf7bb5
authored
Dec 08, 2016
by
Gianluca Filippone
Browse files
Completed EE detail page
parent
cacba4f9
Changes
8
Hide whitespace changes
Inline
Side-by-side
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/panels/ChoreographyServiceDirectoryPanel.java
View file @
fdaf7bb5
...
...
@@ -18,25 +18,26 @@ package org.apache.syncope.client.console.panels;
import
eu.chorevolution.idm.common.to.ChoreographyTO
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.syncope.client.console.commons.Constants
;
import
org.apache.syncope.client.console.pages.ChoreographyPage
;
import
org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn
;
import
org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder
;
import
org.apache.syncope.common.lib.to.AnyObjectTO
;
import
org.apache.syncope.common.lib.types.AnyTypeKind
;
import
org.apache.syncope.common.lib.types.SchemaType
;
import
org.apache.wicket.PageReference
;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
;
import
org.springframework.util.ReflectionUtils
;
public
class
ChoreographyServiceDirectoryPanel
extends
AnyObjectDirectoryPanel
{
private
static
final
long
serialVersionUID
=
7303610381539502741L
;
private
final
ChoreographyTO
choreography
;
public
ChoreographyServiceDirectoryPanel
(
final
String
id
,
final
PageReference
pageRef
,
final
ChoreographyTO
choreography
)
{
super
(
id
,
new
Builder
(
AnyTypeKind
.
ANY_OBJECT
.
name
(),
pageRef
),
false
);
this
.
choreography
=
choreography
;
this
.
fiql
=
new
AnyObjectFiqlSearchConditionBuilder
(
"ENACTMENT ENGINE"
)
this
.
fiql
=
new
AnyObjectFiqlSearchConditionBuilder
(
"SERVICE"
)
.
inGroups
(
choreography
.
getGroupKey
()).
query
();
dataProvider
.
setFIQL
(
fiql
);
}
...
...
@@ -48,7 +49,17 @@ public class ChoreographyServiceDirectoryPanel extends AnyObjectDirectoryPanel {
@Override
protected
List
<
IColumn
<
AnyObjectTO
,
String
>>
getColumns
()
{
return
super
.
getColumns
();
final
List
<
IColumn
<
AnyObjectTO
,
String
>>
columns
=
new
ArrayList
<>();
for
(
String
name
:
prefMan
.
getList
(
getRequest
(),
String
.
format
(
Constants
.
PREF_ANY_OBJECT_DETAILS_VIEW
,
type
)))
{
addPropertyColumn
(
name
,
ReflectionUtils
.
findField
(
AnyObjectTO
.
class
,
name
),
columns
);
}
columns
.
add
(
new
AttrColumn
<>(
"Service Location"
,
SchemaType
.
PLAIN
));
return
columns
;
}
public
static
class
Builder
extends
AnyObjectDirectoryPanel
.
Builder
{
...
...
ext/ee/client-console/pom.xml
View file @
fdaf7bb5
...
...
@@ -45,6 +45,12 @@ limitations under the License.
<groupId>
org.apache.syncope.client
</groupId>
<artifactId>
syncope-client-console
</artifactId>
</dependency>
<dependency>
<groupId>
eu.chorevolution.idm.ext.choreography
</groupId>
<artifactId>
syncope-ext-choreography-client-console
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
<build>
...
...
ext/ee/client-console/src/main/java/org/apache/syncope/client/console/pages/EnactmentEngineDetailPage.java
View file @
fdaf7bb5
...
...
@@ -15,11 +15,18 @@
*/
package
org.apache.syncope.client.console.pages
;
import
eu.chorevolution.idm.common.to.VirtualMachineInfoTO
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.apache.syncope.client.console.BookmarkablePageLinkBuilder
;
import
org.apache.syncope.client.console.panels.VirtualMachinesDirectoryPanel
;
import
org.apache.syncope.client.console.rest.AnyObjectRestClient
;
import
org.apache.syncope.client.console.rest.ChoreographyRestClient
;
import
org.apache.syncope.client.console.widgets.ResourceWidget
;
import
org.apache.wicket.markup.html.WebMarkupContainer
;
import
org.apache.syncope.common.lib.to.AnyObjectTO
;
import
org.apache.wicket.markup.html.basic.Label
;
import
org.apache.wicket.markup.repeater.RepeatingView
;
import
org.apache.wicket.request.mapper.parameter.PageParameters
;
public
class
EnactmentEngineDetailPage
extends
BaseExtPage
{
...
...
@@ -32,6 +39,8 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
private
final
AnyObjectTO
enactmentEngine
;
private
final
EEStatisticBundle
bundle
;
public
EnactmentEngineDetailPage
(
final
PageParameters
parameters
)
{
super
(
parameters
);
...
...
@@ -40,6 +49,10 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
enactmentEngine
=
restClient
.
read
(
enactmentEngineKey
);
ChoreographyRestClient
choreographyRestClient
=
new
ChoreographyRestClient
();
this
.
bundle
=
new
EEStatisticBundle
(
choreographyRestClient
.
getEEVmList
(
enactmentEngine
.
getKey
()));
// Set page title
body
.
add
(
new
Label
(
"header"
,
getString
(
"ee"
)
+
" "
+
enactmentEngine
.
getName
()));
...
...
@@ -51,9 +64,51 @@ public class EnactmentEngineDetailPage extends BaseExtPage {
content
.
add
(
new
Label
(
"enactmentEngineDetailsPageContent"
,
"PAGE CONTENT"
));
content
.
setOutputMarkupId
(
true
);
RepeatingView
resourcesOverview
=
new
RepeatingView
(
"resourceWidget"
);
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-yellow"
,
bundle
.
virtualMachines
,
"Virtual Machines"
,
"fa fa-cube"
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-red"
,
bundle
.
cpus
,
"CPU"
,
"fa fa-cogs"
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-green"
,
bundle
.
ram
,
"RAM"
,
"MB"
,
""
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-aqua"
,
bundle
.
storage
,
"Storage"
,
"GB"
,
"fa fa-database"
));
content
.
add
(
resourcesOverview
);
content
.
add
(
new
VirtualMachinesDirectoryPanel
(
"virtualMachinesList"
,
getPageReference
(),
enactmentEngineKey
));
// Re-enable when entilements for this service will be defined
//MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST);
body
.
add
(
content
);
}
private
class
EEStatisticBundle
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8740173619471549262L
;
private
int
virtualMachines
;
private
int
cpus
;
private
int
ram
;
private
int
storage
;
EEStatisticBundle
(
final
List
<
VirtualMachineInfoTO
>
vms
)
{
this
.
virtualMachines
=
0
;
this
.
cpus
=
0
;
this
.
ram
=
0
;
this
.
storage
=
0
;
for
(
VirtualMachineInfoTO
vm:
vms
)
{
this
.
virtualMachines
++;
this
.
cpus
+=
vm
.
getCpuNumber
();
this
.
ram
+=
vm
.
getRam
();
this
.
storage
+=
vm
.
getStorage
();
}
}
}
}
ext/ee/client-console/src/main/java/org/apache/syncope/client/console/panels/EnactmentEngineDirectoryPanel.java
View file @
fdaf7bb5
...
...
@@ -22,17 +22,16 @@ import org.apache.syncope.client.console.commons.Constants;
import
org.apache.syncope.client.console.commons.EnactmentEngineDataProvider
;
import
org.apache.syncope.client.console.pages.EnactmentEngineDetailPage
;
import
org.apache.syncope.client.console.pages.EnactmentEnginePage
;
import
org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn
;
import
org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder
;
import
org.apache.syncope.common.lib.to.AnyObjectTO
;
import
org.apache.syncope.common.lib.types.AnyTypeKind
;
import
org.apache.syncope.common.lib.types.SchemaType
;
import
org.apache.wicket.PageReference
;
import
org.apache.wicket.ajax.AjaxRequestTarget
;
import
org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink
;
import
org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator
;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
;
import
org.apache.wicket.markup.html.basic.Label
;
import
org.apache.wicket.markup.repeater.Item
;
import
org.apache.wicket.model.IModel
;
import
org.apache.wicket.model.ResourceModel
;
...
...
@@ -68,7 +67,19 @@ public class EnactmentEngineDirectoryPanel extends AnyObjectDirectoryPanel {
addPropertyColumn
(
name
,
ReflectionUtils
.
findField
(
AnyObjectTO
.
class
,
name
),
columns
);
}
columns
.
add
(
new
AttrColumn
<>(
"enactmentEngineBaseURL"
,
SchemaType
.
PLAIN
));
columns
.
add
(
new
AbstractColumn
<
AnyObjectTO
,
String
>(
new
ResourceModel
(
""
,
"Base URL"
))
{
@Override
public
void
populateItem
(
final
Item
<
ICellPopulator
<
AnyObjectTO
>>
item
,
final
String
componentId
,
final
IModel
<
AnyObjectTO
>
model
)
{
Label
label
=
new
Label
(
componentId
,
model
.
getObject
().
getPlainAttrMap
().
get
(
"enactmentEngineBaseURL"
)
.
getValues
().
iterator
().
next
());
item
.
add
(
label
);
}
});
columns
.
add
(
new
AbstractColumn
<
AnyObjectTO
,
String
>(
new
ResourceModel
(
"actions"
,
""
))
{
...
...
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEngineDetailPage.html
View file @
fdaf7bb5
...
...
@@ -28,8 +28,12 @@ limitations under the License.
</section>
<section
class=
"content"
wicket:id=
"content"
>
<div
class=
"box"
>
<div
class=
"box-body"
wicket:id=
"enactmentEngineDetailsPageContent"
/>
<div
class=
"box box-body"
>
<div
class=
"row"
>
<span
wicket:id=
"resourceWidget"
/>
</div>
<h3><wicket:message
key=
"virtualMachines"
/></h3>
<div
wicket:id=
"virtualMachinesList"
/>
</div>
</section>
</wicket:extend>
...
...
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEngineDetailPage.properties
View file @
fdaf7bb5
...
...
@@ -15,3 +15,4 @@
#
ee
=
Enactment Engine
enactmentEngines
=
Enactment Engines
virtualMachines
=
Virtual Machines
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEngineDetailPage_it.properties
View file @
fdaf7bb5
...
...
@@ -15,3 +15,4 @@
#
ee
=
Enactment Engine
enactmentEngines
=
Enactment Engines
virtualMachines
=
Macchine Virtuali
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEngineDetailPage_pt_BR.properties
View file @
fdaf7bb5
...
...
@@ -15,3 +15,4 @@
#
ee
=
Enactment Engine
enactmentEngines
=
Enactment Engines
virtualMachines
=
M
\u
00e1quinas virtuais
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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