Permalink
Browse files

Added: wflow-consoleweb - Quick navigation list in form builder, data…

…list builder & userview builder

git-svn-id: http://dev.joget.org/svn/jw-community/trunk@24 1bff935d-2fe2-40b7-b00f-c2aca69a7612
  • Loading branch information...
owen
owen committed Jul 6, 2011
1 parent 7b42b3b commit 16b72e88b95acc72e3eedd89ffbf1073715bb0db
@@ -3701,6 +3701,30 @@ public String consoleI18n(ModelMap map, @RequestParam("name") String name) throw
return "console/i18n/lang";
}
@RequestMapping("/console/app/(*:appId)/(*:version)/builder/navigator/(*:builder)/(*:id)")
public String consoleBuilderNavigator(ModelMap map, @RequestParam(value = "appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "builder") String builder, @RequestParam(value = "id", required = false) String id){
AppDefinition appDef = appService.getAppDefinition(appId, version);
Collection<FormDefinition> formDefinitionList = null;
Collection<DatalistDefinition> datalistDefinitionList = null;
Collection<UserviewDefinition> userviewDefinitionList = null;
if (appDef != null) {
formDefinitionList = formDefinitionDao.getFormDefinitionList(null, appDef, "name", false, null, null);
datalistDefinitionList = datalistDefinitionDao.getDatalistDefinitionList(null, appDef, "name", false, null, null);
userviewDefinitionList = userviewDefinitionDao.getUserviewDefinitionList(null, appDef, "name", false, null, null);
}
map.addAttribute("builder", builder);
map.addAttribute("id", id);
map.addAttribute("appDef", appDef);
map.addAttribute("formDefinitionList", formDefinitionList);
map.addAttribute("datalistDefinitionList", datalistDefinitionList);
map.addAttribute("userviewDefinitionList", userviewDefinitionList);
return "console/apps/builderItems";
}
protected Map<String, String> getPluginType() {
Map<String, String> pluginTypeMap = new ListOrderedMap();
@@ -21,6 +21,9 @@ general.method.label.embedCode=Embed Code
general.method.label.configPlugin=Configure Plugin
general.method.label.showAdditionalInfo=Show Additional Info
general.method.label.hideAdditionalInfo=Hide Additional Info
general.method.label.quickNavigator=Quick Navigation :
general.method.label.openNewWindow=Open New Window
general.method.label.noItemAvailable=No item Available.
general.header.unauthorized=No Permission
general.content.unauthorized=Sorry, you do not have permission to access this page
@@ -0,0 +1,79 @@
<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
<link href="${pageContext.request.contextPath}/css/builder_navigator.css" rel="stylesheet" type="text/css" />
<div id="builder_quick_navigator">
<div class="builder_qn_label">
<span>Quick Navigation : </span>
</div>
<div class="builder_qn_container">
<div id="builder_qv_fb" class="builder_qn_type">
<a class="builder_qn_type_name"><span class="col-1"></span><span class="col-2"><fmt:message key="fbuilder.title"/></span><span class="col-3"></span></a>
<div class="builder_qn_items">
<ul>
<c:choose>
<c:when test="${(fn:length(formDefinitionList) gt 0 && builder ne 'f') || (fn:length(formDefinitionList) gt 1 && builder eq 'f')}">
<c:forEach items="${formDefinitionList}" var="formDef">
<c:if test="${!(builder eq 'f' && id eq formDef.id)}">
<li>
<a href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/form/builder/${formDef.id}">${formDef.name}</a>
<a title="<fmt:message key="general.method.label.openNewWindow"/>" class="builder_qn_open" target="_blank" href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/form/builder/${formDef.id}"><span><fmt:message key="general.method.label.openNewWindow"/></span></a>
<div class="clear"></div>
</li>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<li><fmt:message key="general.method.label.noItemAvailable"/></li>
</c:otherwise>
</c:choose>
</ul>
</div>
</div>
<div id="builder_qv_db" class="builder_qn_type">
<a class="builder_qn_type_name"><span class="col-1"></span><span class="col-2"><fmt:message key="dbuilder.title"/></span><span class="col-3"></span></a>
<div class="builder_qn_items">
<ul>
<c:choose>
<c:when test="${(fn:length(datalistDefinitionList) gt 0 && builder ne 'd') || (fn:length(datalistDefinitionList) gt 1 && builder eq 'd')}">
<c:forEach items="${datalistDefinitionList}" var="listDef">
<c:if test="${!(builder eq 'd' && id eq listDef.id)}">
<li>
<a href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/datalist/builder/${listDef.id}">${listDef.name}</a>
<a title="<fmt:message key="general.method.label.openNewWindow"/>" class="builder_qn_open" target="_blank" href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/datalist/builder/${listDef.id}"><span><fmt:message key="general.method.label.openNewWindow"/></span></a>
<div class="clear"></div>
</li>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<li><fmt:message key="general.method.label.noItemAvailable"/></li>
</c:otherwise>
</c:choose>
</ul>
</div>
</div>
<div id="builder_qv_ub" class="builder_qn_type">
<a class="builder_qn_type_name"><span class="col-1"></span><span class="col-2"><fmt:message key="ubuilder.title"/></span><span class="col-3"></span></a>
<div class="builder_qn_items">
<ul>
<c:choose>
<c:when test="${(fn:length(userviewDefinitionList) gt 0 && builder ne 'u') || (fn:length(userviewDefinitionList) gt 1 && builder eq 'u')}">
<c:forEach items="${userviewDefinitionList}" var="userviewDef">
<c:if test="${!(builder eq 'u' && id eq userviewDef.id)}">
<li>
<a href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/userview/builder/${userviewDef.id}">${userviewDef.name}</a>
<a title="<fmt:message key="general.method.label.openNewWindow"/>" class="builder_qn_open" target="_blank" href="${pageContext.request.contextPath}/web/console/app/${appDef.id}/${appDef.version}/userview/builder/${userviewDef.id}"><span><fmt:message key="general.method.label.openNewWindow"/></span></a>
<div class="clear"></div>
</li>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<li><fmt:message key="general.method.label.noItemAvailable"/></li>
</c:otherwise>
</c:choose>
</ul>
</div>
</div>
</div>
</div>
@@ -29,7 +29,9 @@
};
window.onbeforeunload = function() {
return "<fmt:message key="dbuilder.saveBeforeClose"/>";
if(!DatalistBuilder.isSaved()){
return "<fmt:message key="dbuilder.saveBeforeClose"/>";
}
};
$(document).ready(function() {
@@ -77,6 +79,7 @@
<div id="builder-container">
<div id="builder-header">
<img alt="logo" width="107" height="38" src="${pageContext.request.contextPath}/images/v3/builder/logo.png" align="left" /> <div id="builder-title"><fmt:message key="dbuilder.title"/></div>
<jsp:include page="/web/console/app/${appId}/${appVersion}/builder/navigator/d/${id}" flush="true" />
</div>
<div id="builder-body">
<div id="builder-bar">
@@ -47,6 +47,7 @@
data: {"json": json },
url: saveUrl,
success: function(response) {
FormBuilder.originalJson = FormBuilder.generateJSON();
alert("<fmt:message key="fbuilder.saved"/>");
},
error: function(jqXHR, textStatus, errorThrown) {
@@ -57,7 +58,9 @@
}
window.onbeforeunload = function() {
return "<fmt:message key="fbuilder.saveBeforeClose"/>";
if(!FormBuilder.isSaved()){
return "<fmt:message key="fbuilder.saveBeforeClose"/>";
}
};
$(document).ready(function() {
@@ -104,6 +107,7 @@
<div id="builder-container">
<div id="builder-header">
<img alt="logo" width="107" height="38" src="${pageContext.request.contextPath}/images/v3/builder/logo.png" align="left" /> <div id="builder-title"><fmt:message key="fbuilder.title"/></div>
<jsp:include page="/web/console/app/${appId}/${appDefinition.version}/builder/navigator/f/${formId}" flush="true" />
</div>
<div id="builder-body">
<div id="builder-bar">
@@ -61,7 +61,9 @@
});
window.onbeforeunload = function() {
return "<fmt:message key="ubuilder.saveBeforeClose" />";
if(UserviewBuilder.saveChecker != 0){
return "<fmt:message key="ubuilder.saveBeforeClose" />";
}
};
</script>
</head>
@@ -70,6 +72,7 @@
<div id="builder-container">
<div id="builder-header">
<img alt="logo" width="107" height="38" src="${pageContext.request.contextPath}/images/v3/builder/logo.png" align="left" /> <div id="builder-title"><fmt:message key="ubuilder.title"/></div>
<jsp:include page="/web/console/app/${appId}/${appVersion}/builder/navigator/u/${userviewId}" flush="true" />
</div>
<div id="builder-body">
<div id="builder-bar">
@@ -0,0 +1,144 @@
#builder-header{
position:relative;
}
#builder_quick_navigator{
width:350px;
position:absolute;
right:0;
top:4px;
}
.builder_qn_label{
font-size:11px;
font-weight:bold;
display:none;
}
.builder_qn_type{
margin-right:10px;
float:left;
position:relative;
}
.builder_qn_type_name{
font-size: 12px;
color: #cef281;
text-decoration: none;
display: block;
padding: 10px 0;
line-height: 20px
}
.builder_qv_ub{
margin-right:0;
}
.builder_qn_type_name span.col-1 {
background: url(../images/v3/builder/navlist_img.png) 0 0 no-repeat;
display: block;
float: left;
width: 10px;
height: 22px
}
.builder_qn_type_name span.col-2 {
background: url(../images/v3/builder/navlist_img_bg.png) 0 0 repeat-x;
display: block;
float: left;
height: 22px
}
.builder_qn_type_name span.col-3 {
background: url(../images/v3/builder/navlist_img.png) -20px 0 no-repeat;
display: block;
float: left;
width: 10px;
height: 22px
}
.builder_qn_type:hover a.builder_qn_type_name span.col-1 {
background: url(../images/v3/builder/navlist_img.png) 0 -31px no-repeat;
display: block;
float: left;
width: 10px;
height: 22px
}
.builder_qn_type:hover a.builder_qn_type_name span.col-2 {
background: url(../images/v3/builder/navlist_img_bg.png) 0 -31px repeat-x;
display: block;
float: left;
height: 22px
}
.builder_qn_type:hover a.builder_qn_type_name span.col-3 {
background: url(../images/v3/builder/navlist_img.png) -20px -31px no-repeat;
display: block;
float: left;
width: 10px;
height: 22px
}
.builder_qn_items{
display:none;
}
.builder_qn_type:hover .builder_qn_items{
display:block;
width: 200px;
color:#ffffff;
position:absolute;
background: #8e8e8e;
border:1px solid #797979;
right:0px;
top:32px;
}
#builder_qv_fb:hover .builder_qn_items{
left:0px;
}
.builder_qn_items ul{
margin:0;
padding:0;
max-height:300px;
overflow:auto;
}
.builder_qn_items ul li{
clear:both;
padding:5px 5px;
border:1px solid #797979;
list-style-type: none;
}
.builder_qn_items ul li:hover{
background: #565656;
}
.builder_qn_items ul li a{
width:140px;
float:left;
display:block;
color:#fff;
font-size: 13px;
text-decoration:none;
}
.builder_qn_items ul li a.builder_qn_open{
height:15px;
width:15px;
float:right;
display:block;
background: url(../images/v3/builder/icon_open_new_window.png) 0 0 no-repeat transparent;
}
.builder_qn_items ul li a.builder_qn_open span{
display:none;
}
.clear{
clear:both;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,6 +8,7 @@ DatalistBuilder = {
previewUrl : '',
contextPath : '',
appPath : '',
originalJson : '',
columnPrefix : "column_",
rowActionPrefix : "rowAction_",
@@ -1050,6 +1051,7 @@ DatalistBuilder = {
DatalistBuilder.renderFilter(obj.filters[e].id);
}
DatalistBuilder.originalJson = DatalistBuilder.getJson();
},
preview : function(){
@@ -1062,6 +1064,7 @@ DatalistBuilder = {
$.post(DatalistBuilder.saveUrl + DatalistBuilder.datalistProperties.id, { json : DatalistBuilder.getJson() } , function(data) {
var d = JSON.decode(data);
if(d.success == true){
DatalistBuilder.originalJson = DatalistBuilder.getJson();
alert(get_dbuilder_msg('dbuilder.saved'));
}else{
alert(get_dbuilder_msg('dbuilder.errorSaving'));
@@ -1122,5 +1125,13 @@ DatalistBuilder = {
// update JSON definition
var jsonString = '(' + DatalistBuilder.getJson() + ')';
$('#list-json').val(jsonString);
},
isSaved : function(){
if(DatalistBuilder.originalJson == DatalistBuilder.getJson()){
return true;
}else{
return false;
}
}
}
Oops, something went wrong.

0 comments on commit 16b72e8

Please sign in to comment.