Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 9, 2015
2 parents c1f9b51 + 68ea9c0 commit 42a98c6
Show file tree
Hide file tree
Showing 98 changed files with 519,761 additions and 60 deletions.
Expand Up @@ -78,41 +78,48 @@
<!-- BOOTSTRAP RESOURCES END -->
</head>
<body>

<div id="blackWindow"></div>
<div id="xmlExport">
<span id="xmlExportContent"></span>
</div>

<div wicket:id="topMenu" />

<div wicket:id="version" class="pull-right version-info">
<wicket:message key="pageBase.midPointVersion"/>
</div>
<img id="ajax_busy" class="pull-right version-info" src="img/ajax-loader.gif"/>

<div class="row mainContainer">
<div class="page-header" wicket:id="pageTitleContainer">
<h1 wicket:id="pageTitle">
<span wicket:id="pageTitleReal"></span>
<small wicket:id="pageSubtitle"></small>
</h1>
<div id="blackWindow"></div>
<div id="xmlExport">
<span id="xmlExportContent"></span>
</div>

<!--<div wicket:id="feedbackList"/>-->
<!--<div wicket:id="feedbackDetails"/>-->
<div wicket:id="topMenu" />

<div wicket:id="feedbackContainer" class="feedbackContainer">
<div wicket:id="feedback" class="messagePanel"/>
<div wicket:id="tempFeedback" class="tempMessage"/>
<div wicket:id="version" class="pull-right version-info">
<wicket:message key="pageBase.midPointVersion"/>
</div>
<img id="ajax_busy" class="pull-right version-info" src="img/ajax-loader.gif"/>

<div class="mp-main-container">
<div class="row mainContainer">
<div class="page-header" wicket:id="pageTitleContainer">
<h1 wicket:id="pageTitle">
<span wicket:id="pageTitleReal"></span>
<small wicket:id="pageSubtitle"></small>
</h1>
</div>

<!--<div wicket:id="feedbackList"/>-->
<!--<div wicket:id="feedbackDetails"/>-->

<div wicket:id="feedbackContainer" class="feedbackContainer">
<div wicket:id="feedback" class="messagePanel"/>
<div wicket:id="tempFeedback" class="tempMessage"/>
</div>
<wicket:child/>

</div>

<div class="wicket-debug-buttons" wicket:id="debugBar">
<a wicket:id="clearCssCache">Clear css cache</a>
</div>
<div wicket:id="debugPanel" style="z-index: 10000;"/>
</div>
<wicket:child/>

</div>
<!-- Footer -->
<div class="mp-footer">
<br>&copy;&nbsp;2015&nbsp;<a href="https://www.evolveum.com/">Evolveum</a>&nbsp;,&nbsp;Open Source Identity Management<br>
</div>

<div class="wicket-debug-buttons" wicket:id="debugBar">
<a wicket:id="clearCssCache">Clear css cache</a>
</div>
<div wicket:id="debugPanel" style="z-index: 10000;"/>
</body>
</html>
23 changes: 23 additions & 0 deletions gui/admin-gui/src/main/webapp/less/midpoint/midpoint.less
Expand Up @@ -16,6 +16,29 @@
@import "tree-theme-basic.less";
@import "operation-result.less";

/**
* Overall styles for correct footer behaviour
*/
html {
height: 100%;
}

body{
min-height:100%;
position:relative;
}

div.mp-main-container{
height:100%;
}

div.mp-footer{
position: absolute;
bottom: 0;
text-align: center;
width: 100%;
}

/**
* Auto-complete drop-down choice styles
*/
Expand Down
Expand Up @@ -86,13 +86,15 @@
*/
public class OpenDJController extends AbstractResourceController {

private String DATA_TEMPLATE = "test-data/opendj.template";
private String DATA_TEMPLATE_DIR = "test-data";
private String SERVER_ROOT = "target/test-data/opendj";
private String LDAP_SUFFIX = "dc=example,dc=com";

public static final String DEFAULT_TEMPLATE_NAME = "opendj.template";

protected File serverRoot = new File(SERVER_ROOT);
protected File configFile = null;
protected File templateRoot = new File(DATA_TEMPLATE);
protected File templateRoot;

private static final Trace LOGGER = TraceManager.getTrace(OpenDJController.class);

Expand All @@ -108,14 +110,6 @@ public OpenDJController(String serverRoot) {
init();
}

public OpenDJController(String serverRoot, String templateServerRoot) {
SERVER_ROOT = serverRoot;
DATA_TEMPLATE = templateServerRoot;
this.serverRoot = new File(serverRoot);
this.templateRoot = new File(templateServerRoot);
init();
}

/**
* Initialize
*
Expand Down Expand Up @@ -225,21 +219,23 @@ public InternalClientConnection getInternalConnection() {
* @throws IOException
* @throws URISyntaxException
*/
public void refreshFromTemplate() throws IOException, URISyntaxException {
public void refreshFromTemplate(String templateName) throws IOException, URISyntaxException {
deleteDirectory(serverRoot);
extractTemplate(serverRoot);
extractTemplate(serverRoot, templateName);
}

/**
* Extract template from class
*/
private void extractTemplate(File dst) throws IOException, URISyntaxException {
private void extractTemplate(File dst, String templateName) throws IOException, URISyntaxException {

LOGGER.info("Extracting OpenDJ template....");
if (!dst.exists()) {
LOGGER.debug("Creating target dir {}", dst.getPath());
dst.mkdirs();
}

templateRoot = new File(DATA_TEMPLATE_DIR, templateName);

// Determing if we need to extract from JAR or directory
if (templateRoot.isDirectory()) {
Expand All @@ -248,9 +244,10 @@ private void extractTemplate(File dst) throws IOException, URISyntaxException {
return;
}

LOGGER.debug("Try to localize OpenDJ Template in JARs as " + DATA_TEMPLATE);
String templateRootPath = templateRoot.getPath();
LOGGER.debug("Try to localize OpenDJ Template in JARs as " + templateRootPath);

URL srcUrl = ClassLoader.getSystemResource(DATA_TEMPLATE);
URL srcUrl = ClassLoader.getSystemResource(templateRootPath);
// sample:
// file:/C:/.m2/repository/test-util/1.9-SNAPSHOT/test-util-1.9-SNAPSHOT.jar!/test-data/opendj.template
// output:
Expand All @@ -273,12 +270,12 @@ private void extractTemplate(File dst) throws IOException, URISyntaxException {
e = entries.nextElement();

// skip other files
if (!e.getName().contains(DATA_TEMPLATE)) {
if (!e.getName().contains(templateRootPath)) {
continue;
}

// prepare destination file
String filepath = e.getName().substring(DATA_TEMPLATE.length());
String filepath = e.getName().substring(templateRootPath.length());
File dstFile = new File(dst, filepath);

// test if directory
Expand Down Expand Up @@ -322,15 +319,19 @@ private void extractTemplate(File dst) throws IOException, URISyntaxException {
}

/**
* Start the embedded OpenDJ directory server using files coppied from the
* Start the embedded OpenDJ directory server using files copied from the default
* template.
*
* @return
* @throws IOException
* @throws URISyntaxException
*/
public InternalClientConnection startCleanServer() throws IOException, URISyntaxException {
refreshFromTemplate();
return startCleanServer(DEFAULT_TEMPLATE_NAME);
}

/**
* Start the embedded OpenDJ directory server using files copied from the specified
* template.
*/
public InternalClientConnection startCleanServer(String templateName) throws IOException, URISyntaxException {
refreshFromTemplate(templateName);
return start();
}

Expand Down

0 comments on commit 42a98c6

Please sign in to comment.