Implemented creation of checklist templates
This commit is contained in:
parent
d026cfb9d3
commit
6e36c1b685
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,3 +3,6 @@
|
|||||||
\.classpath
|
\.classpath
|
||||||
\target/**/*
|
\target/**/*
|
||||||
\target/*
|
\target/*
|
||||||
|
/.settings
|
||||||
|
/.classpath
|
||||||
|
/target
|
||||||
|
@ -8,31 +8,31 @@
|
|||||||
|
|
||||||
<wicket:panel>
|
<wicket:panel>
|
||||||
<div wicket:id="feedbackPanel"></div>
|
<div wicket:id="feedbackPanel"></div>
|
||||||
<form wicket:id="form2">
|
|
||||||
<div wicket:id="container">
|
|
||||||
<div wicket:id="questions">
|
|
||||||
<span wicket:id=questionLabel></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input wicket:id="question" type="text" />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<input wicket:id="button2" type="submit" />
|
|
||||||
|
|
||||||
</form>
|
|
||||||
<form wicket:id="form">
|
<form wicket:id="form">
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<input wicket:id="title" type="text" />
|
Template name: <input wicket:id="title" type="text" />
|
||||||
</div>
|
</div>
|
||||||
|
<p></p>
|
||||||
<div wicket:id="radioChoice">
|
<div wicket:id="radioChoice">
|
||||||
<input type="radio" />
|
<input type="radio" />
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<form wicket:id="addQuestionForm">
|
||||||
<div></div>
|
<div wicket:id="container">
|
||||||
<input wicket:id="button" type="submit" />
|
<div>Questions</div>
|
||||||
|
<div wicket:id="questions">
|
||||||
|
<span wicket:id=questionLabel></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input wicket:id="question" type="text" />
|
||||||
|
</div>
|
||||||
|
<input wicket:id="addQuestionButton" type="submit" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<p></p>
|
||||||
|
<input wicket:id="save" type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</wicket:panel>
|
</wicket:panel>
|
||||||
|
@ -43,6 +43,8 @@ public class CreateCheckListTemplatePanel extends Panel {
|
|||||||
private String question = "";
|
private String question = "";
|
||||||
private String title = "";
|
private String title = "";
|
||||||
|
|
||||||
|
private final FeedbackPanel feedbackPanel;
|
||||||
|
|
||||||
private ProjectClass projectClass;
|
private ProjectClass projectClass;
|
||||||
|
|
||||||
private CheckListTemplate checkListTemplate = new CheckListTemplate();
|
private CheckListTemplate checkListTemplate = new CheckListTemplate();
|
||||||
@ -50,16 +52,18 @@ public class CreateCheckListTemplatePanel extends Panel {
|
|||||||
public CreateCheckListTemplatePanel(String id) {
|
public CreateCheckListTemplatePanel(String id) {
|
||||||
super(id);
|
super(id);
|
||||||
projectClass = projectClassDao.getProjectClass(ProjectClass.BACHELOR);
|
projectClass = projectClassDao.getProjectClass(ProjectClass.BACHELOR);
|
||||||
final FeedbackPanel feedbackPanel = new FeedbackPanel("feedbackPanel");
|
feedbackPanel = new FeedbackPanel("feedbackPanel");
|
||||||
feedbackPanel.setOutputMarkupId(true);
|
feedbackPanel.setOutputMarkupId(true);
|
||||||
add(feedbackPanel);
|
add(feedbackPanel);
|
||||||
Form<CheckListTemplate> form = new Form<CheckListTemplate>("form");
|
Form<CheckListTemplate> form = new Form<CheckListTemplate>("form");
|
||||||
Form<CheckListTemplate> form2 = new Form<CheckListTemplate>("form2");
|
final Form<CheckListTemplate> addQuestionForm = new Form<CheckListTemplate>("addQuestionForm");
|
||||||
final TextField<String> titleField = new RequiredTextField<String>("title",
|
final TextField<String> titleField = new RequiredTextField<String>("title",
|
||||||
new PropertyModel<String>(this, "title"));
|
new PropertyModel<String>(this, "title"));
|
||||||
|
titleField.setOutputMarkupId(true);
|
||||||
final TextField<String> questionField = new RequiredTextField<String>("question",
|
final TextField<String> questionField = new RequiredTextField<String>("question",
|
||||||
new PropertyModel<String>(this, "question"));
|
new PropertyModel<String>(this, "question"));
|
||||||
questionField.setOutputMarkupId(true);
|
questionField.setOutputMarkupId(true);
|
||||||
|
questionField.setRequired(false);
|
||||||
RadioChoice<ProjectClass> radioChoice = new RadioChoice<ProjectClass>("radioChoice",
|
RadioChoice<ProjectClass> radioChoice = new RadioChoice<ProjectClass>("radioChoice",
|
||||||
new PropertyModel<ProjectClass>(this, "projectClass"), projectClassDao.findAll());
|
new PropertyModel<ProjectClass>(this, "projectClass"), projectClassDao.findAll());
|
||||||
|
|
||||||
@ -87,9 +91,9 @@ public class CreateCheckListTemplatePanel extends Panel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
container.add(listView);
|
container.add(listView);
|
||||||
|
//add(new FeedbackPanel("feedbackPanel"));
|
||||||
|
|
||||||
AjaxButton button = new AjaxButton("button", new Model<String>("Save")) {
|
AjaxButton save = new AjaxButton("save", new Model<String>("Save template")) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -102,13 +106,17 @@ public class CreateCheckListTemplatePanel extends Panel {
|
|||||||
checkListTemplate.setLevel(projectClass);
|
checkListTemplate.setLevel(projectClass);
|
||||||
checkListTemplate.setCreator(SciProSession.get().getUser());
|
checkListTemplate.setCreator(SciProSession.get().getUser());
|
||||||
checkListTemplate.setName(title);
|
checkListTemplate.setName(title);
|
||||||
checkListTemplate = checkListTemplateDao.save(checkListTemplate);
|
checkListTemplateDao.save(checkListTemplate);
|
||||||
target.addComponent(feedbackPanel);
|
checkListTemplate = new CheckListTemplate();
|
||||||
|
title ="";
|
||||||
|
question="";
|
||||||
|
target.addComponent(container);
|
||||||
|
target.addComponent(titleField);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AjaxButton button2 = new AjaxButton("button2", new Model<String>("Add")) {
|
AjaxButton addQuestionButton = new AjaxButton("addQuestionButton", new Model<String>("Add question")) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -118,22 +126,25 @@ public class CreateCheckListTemplatePanel extends Panel {
|
|||||||
@Override
|
@Override
|
||||||
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
|
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
|
||||||
|
|
||||||
checkListTemplate.getQuestions().add(new String(question));
|
if(question != null || question != ""){
|
||||||
|
checkListTemplate.getQuestions().add(new String(question));
|
||||||
|
}
|
||||||
questionModel.detach();
|
questionModel.detach();
|
||||||
question = "";
|
question = "";
|
||||||
target.addComponent(questionField);
|
target.addComponent(questionField);
|
||||||
target.addComponent(container);
|
target.addComponent(container);
|
||||||
|
System.out.println("mooooo");
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
addQuestionForm.add(questionField);
|
||||||
|
addQuestionForm.add(container);
|
||||||
|
addQuestionForm.add(addQuestionButton);
|
||||||
form.add(titleField);
|
form.add(titleField);
|
||||||
form.add(radioChoice);
|
form.add(radioChoice);
|
||||||
form.add(button);
|
form.add(addQuestionForm);
|
||||||
form2.add(questionField);
|
form.add(save);
|
||||||
form2.add(container);
|
|
||||||
form2.add(button2);
|
|
||||||
add(form);
|
add(form);
|
||||||
add(form2);
|
|
||||||
//add(addQuestionLink);
|
//add(addQuestionLink);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -12,21 +12,6 @@
|
|||||||
<table >
|
<table >
|
||||||
<tr >
|
<tr >
|
||||||
<td><input type="radio" wicket:id="radio" /></td>
|
<td><input type="radio" wicket:id="radio" /></td>
|
||||||
<!--
|
|
||||||
<td><img wicket:id="image" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div wicket:id="checkLists">
|
|
||||||
<div wicket:id="listView">
|
|
||||||
<span wicket:id="question"></span>
|
|
||||||
<div wicket:id="listViewAnswer">
|
|
||||||
<span wicket:id="answer"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
<td><img wicket:id="image"/></td>
|
<td><img wicket:id="image"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -39,24 +24,3 @@
|
|||||||
</wicket:panel>
|
</wicket:panel>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<!--
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html
|
|
||||||
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<wicket:panel>
|
|
||||||
<div wicket:id="trafficLightContainer">
|
|
||||||
<table wicket:id="group">
|
|
||||||
<tr wicket:id="lights">
|
|
||||||
<td><input type="radio" wicket:id="radio" /></td>
|
|
||||||
<td> <img wicket:id="image"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
>>>>>>> checklists
|
|
||||||
</wicket:panel>
|
|
||||||
</body>
|
|
||||||
</html> -->
|
|
@ -1,60 +0,0 @@
|
|||||||
<!DOCTYPE Repository
|
|
||||||
PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.5//EN"
|
|
||||||
"http://jackrabbit.apache.org/dtd/repository-1.5.dtd">
|
|
||||||
<Repository>
|
|
||||||
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
|
|
||||||
<param name="path" value="/jackrabbit" />
|
|
||||||
</FileSystem>
|
|
||||||
<Security appName="Jackrabbit">
|
|
||||||
<AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager" />
|
|
||||||
<LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
|
|
||||||
<param name="anonymousId" value="anonymous" />
|
|
||||||
</LoginModule>
|
|
||||||
</Security>
|
|
||||||
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
|
|
||||||
|
|
||||||
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
|
|
||||||
<param name="path" value="${rep.home}/repository/datastore"/>
|
|
||||||
<param name="minRecordLength" value="100"/>
|
|
||||||
</DataStore>
|
|
||||||
|
|
||||||
<Workspace name="${wsp.name}">
|
|
||||||
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
|
|
||||||
<param name="path" value="${wsp.home}" />
|
|
||||||
</FileSystem>
|
|
||||||
|
|
||||||
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
|
|
||||||
<param name="blobFSBlockSize" value="0"/>
|
|
||||||
<param name="minBlobSize" value="4096"/>
|
|
||||||
<param name="errorHandling" value=""/>
|
|
||||||
</PersistenceManager>
|
|
||||||
|
|
||||||
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
|
|
||||||
<param name="path" value="${wsp.home}/index" />
|
|
||||||
<param name="indexingConfiguration" value="${wsp.home}/index-config.xml"/>
|
|
||||||
<param name="textFilterClasses" value="
|
|
||||||
org.apache.jackrabbit.extractor.MsWordTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.MsExcelTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.PdfTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.RTFTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.XMLTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.PngTextExtractor,
|
|
||||||
org.apache.jackrabbit.extractor.HTMLTextExtractor"/>
|
|
||||||
<param name="extractorPoolSize " value="2"/>
|
|
||||||
<param name="supportHighlighting" value="true"/>
|
|
||||||
</SearchIndex>
|
|
||||||
</Workspace>
|
|
||||||
<Versioning rootPath="${rep.home}/versions">
|
|
||||||
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
|
|
||||||
<param name="path" value="${rep.home}/versions" />
|
|
||||||
</FileSystem>
|
|
||||||
<!-- <PersistenceManager class="org.apache.jackrabbit.core.persistence.xml.XMLPersistenceManager" />-->
|
|
||||||
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
|
|
||||||
<param name="blobFSBlockSize" value="0"/>
|
|
||||||
<param name="minBlobSize" value="4096"/>
|
|
||||||
<param name="errorHandling" value=""/>
|
|
||||||
</PersistenceManager>
|
|
||||||
</Versioning>
|
|
||||||
</Repository>
|
|
Loading…
x
Reference in New Issue
Block a user