<%@ page language="java" %> <% String VERSION_LM = "04-29-2013"; String rzmodule = ""; %> <%@ include file="/util/setup_editform_header.jsp" %> <%@ page import="revize.db.LinkManager, revize.publish.PublishingUtils" %> <% /* * * * * * * * * * * * * * * LINK MANAGER PROCESSING * * * * * * * * * * * * * * =============== Input Arguments =============== Some arguments are passed on the url; others are passed as link properties of the the RZ.link. object of the window opener (as of build 82). See RZsetLinkManagerProperties() in snippet_helper.js for details. ========== HTML Forms ========== 3 forms are required to properly hide the filename input field on Netscape. The XMLForm is always the first form and contains the linkmanager fields. The filenameForm is next and only defined if at least one of the specified templates permits user specified filenames. It is hidden unless the selected template permits user specified filenames (If the window is resized in Netscape, the form must always be displayed because older versions of Netscape lose layer properties after resizing). The controlForm is last and always defined. It contains the continue and cancel buttons as well as additional working fields. Link properties are initially stored there in case the calling window is closed or refreshed. ---------------------------------------------------------------------------*/ String validfilecharacters = "~!@#$%()+-"; //DCO 07-05-2009 String defaultFileExt = System.getProperty(RevizeProperties.PUBLISHER_DEFAULT_FILE_EXTENSION); String linkoptions = "," + StringUtils.getParameter(request,"linkoptions") + ","; String linkname = StringUtils.getParameter(request,"linkname"); String listModule = StringUtils.getParameter(request,"module"); String urlModule = StringUtils.getParameter(request,"urlmodule"); String linkType = StringUtils.getParameter(request,"linktype"); String recordId = StringUtils.getParameter(request,"recordid"); String urlRecord = StringUtils.getParameter(request,"urlrecord"); String templateLabel = StringUtils.getParameter(request,"templatename"); String linkfilename = ""; String href = java.net.URLDecoder.decode(StringUtils.getParameter(request,"href")); if( !rz.isvalidmodule(listModule) ) { linkoptions = ",url,"; listModule = ""; } if( linkoptions.indexOf(",template,") > 0 && listModule.length() == 0) linkoptions = StringUtils.replaceAll(linkoptions,",template,", ","); boolean isRTE = StringUtils.getParameterBoolean(request,"rte"); boolean isTinyMCE = StringUtils.getParameter(request,"rte").equals("tinymce"); boolean isExistingTemplate = false; //----- Get List Module and Link field names - were specified as url parameters // but now are now hard coded names. String linkIdField = "linkid"; String linkTypeField = "linktype"; String linkFileField = "linkfile"; String linkImageField = "linkimage"; String linkPageField = "linkpage"; String linkDisplayField = "linkdisplay"; String linkSeqField = "linkseq"; String appendOther=""; if (linkoptions.indexOf(",noseq,") != -1) linkSeqField = ""; //seq number suppressed String linkId = rz.fetch( listModule, linkIdField, "raw" ); if (rz.editaction.equals("create")) linkId = "-1"; if(!isRTE) linkType = rz.fetch( listModule, linkTypeField, "raw" ); String linkPageRaw = rz.fetch( listModule, linkPageField, "raw" ); String linkPage = StringUtils.convertStringForSource(linkPageRaw); // If it's a url link and a revize managed page if(linkType.equals("urltemplate")) { String linkurl = rz.gettemplateinstanceurl(linkPageRaw,"",new Integer(linkId).intValue()); // Aray started if (rz.fieldtype( listModule, "other" ) != -1) { appendOther = rz.fetch( listModule, "other", "" ).trim(); linkurl = linkurl + appendOther; } // Aray finished linkPage = StringUtils.convertStringForSource(linkurl); linkType = "url"; } else if(linkType.equals("url") && !urlModule.equals("")) { String linkurl = rz.gettemplateinstanceurl(templateLabel,urlModule,new Integer(urlRecord).intValue()); linkPage = StringUtils.convertStringForSource(linkurl); } else if(isRTE && linkType.equals("url")) { linkPage = StringUtils.convertStringForSource(href); } //----- if existing template link, no other link type choices are displayed else if(linkType.equals("template")) { isExistingTemplate = true; linkoptions = ",template,"; } // link reference file retrieved in XMLform field String linkDisplay = rz.fetch( listModule, linkDisplayField, "raw" ); linkDisplay = StringUtils.convertStringForSource(linkDisplay); String linkFilename = rz.fetch( listModule, "linkfilename", "raw" ); String linkRTE = rz.fetch( listModule, "linkrte", "raw" ); if (linkRTE.indexOf("Unknown Field") != -1) linkRTE=""; String linkStatus = ""; //TODO: linkStatus is new field needed for future rollback when RTE is canceled //linkStatus = rz.fetch( listModule, "linkstatus", "raw" ); String linkLevel = rz.fetch( listModule, "linklevel", "raw" ); String linkParent = rz.fetch( listModule, "linkparent", "raw" ); String linkParentId = rz.fetch( listModule, "linkparentid", "raw" ); String linkTarget = rz.fetch( listModule, "linktarget", "raw" ); String linkSortKey = ""; //original value used to populate form field if (rz.isvalidfield(listModule,"linksortkey")) { rz.fetch( listModule, "linksortkey", "raw" ).trim(); if (!rz.nodata) linkSortKey = rz.content; } String linkSectionId = ""; String linkToSectionId = "0"; String sectionFolder = ""; if (rz.isvalidfield(listModule,"linksectionid")) { linkSectionId = rz.fetch(listModule,"linksectionid","raw,report"); if (rz.isvalidfield(listModule,"linktosectionid")) { linkToSectionId = rz.fetch(listModule,"linktosectionid","raw,report"); if (rz.editaction.equals("update") && linkType.equals("template") && !linkLevel.equals("0") && !linkSectionId.equals("0") && linkToSectionId.equals("0")) rz.setTrace( "Warning: linktosectionid should not be zero\n" + " unless linksectionid is not zero.\n" + "Contact your Revize Administrator."); } //----- Get sections folder if field defined if (rz.isvalidfield("sections","folder")) { rz.fetch("sections","folder","raw,report","sections.sectionid="+linkSectionId); if (rz.nodata) rz.setTrace("No section properties found (sectionid="+linkSectionId+")."); else sectionFolder = rz.content.trim(); } } //----- Get the parent as defined in the webspace_permissions_table String repair_page_key = ""; String repair_parent_key = ""; if (rz.editaction.equals("update") && rz.permissions_module.length() > 0 && !linkPage.equals("")) { repair_page_key = linkPageRaw + "[" + linkId + "]"; String repair_where = rz.permissions_module+".page_key=" + repair_page_key; rz.fetch(rz.permissions_module,"parent_key","raw",repair_where); if (!rz.nodata) repair_parent_key = rz.content; // For urltemplate, breadcrumb parent is the real template's linkparent if (linkType.indexOf("urltemplate") == 0) { String repair_options = "raw,report,recordid=" + linkId; repair_parent_key = rz.fetch(rz.pagemodule,"linkparent",repair_options); } } //----- Get list of live channels //04-29-2013 List channels = rz.getDataStore().readChannels(); Channel liveChannel = PublishingUtils.getLiveChannel(channels); String liveChannelUrl = liveChannel.getBaseUrl(); String revizeChannelUrl = PublishingUtils.getRevizeChannel(channels).getBaseUrl(); //----- Get list of templates rz.string = StringUtils.getParameter(request,"linktemplate"); String [] linkTemplates = StringUtils.split(rz.string,","); for (int i=0; i <%-- #RevizeProperties USE REVIZE MENU (DOCUMENT PROPERTIES) TO EDIT DATA BELOW: status= options= server=localhost:8080 projectName=jamesisland label=index location=linkmanager_select.jsp version= docType=edit subType=list moduleName= fieldName= channels=| description= --%> Revize Link Manager Select <%-- /********************************************/ /* RZhidden class hides elements in browser */ /* BUT allows DW to show in design view */ /* Following css does not get published */ /* DW uses these in design view */ /********************************************/ --%> <% if (false){ %> <% } %> <%-- /********************************************/ /* Following published for Browser display */ /********************************************/ --%> <% int thumnbsCssWidth = 66*4; if(templateImageList.size() >=4){ thumnbsCssWidth = 66*templateImageList.size(); } %> <%@ include file="/util/setup_editform_javascript.jsp" %>

Link Manager

Spell Check
<% if (!linkSeqField.equals("") && rz.fieldtype(listModule,"linkseq") != -1){%>
Display order relative to other links
<%} // new test code for linkimage field // This should solve the need for special quicklink editlists. if ( linkoptions.indexOf(",linkimage,") != -1 && rz.isvalidfield(listModule, linkImageField) ) { %> <%}%> <% if (!isExistingTemplate) {%> <%} else {%>
This link created a new page and cannot be changed to another type of link. To change Delete link and create another.
<%}%> <% if (linkoptions.indexOf(",none,") != -1 && !isRTE){%> None (link text displayed as heading or placeholder) <%}%> <% if (linkoptions.indexOf(",url,") != -1){%>
<% if (isRTE && !isTinyMCE) { %> <% } %> <% if (isRTE){ //always display dropdown of current bookmarks %>
<%}%> <%}%> <% if (linkoptions.indexOf(",file,") != -1){%>
Upload Current selection displayed above - click on upload to change
<%}%> <% if (linkoptions.indexOf(",template,") != -1){%>
<% }//end template fields %>
<% if(usePathFilename){%>
Page will have the following top level side navigation links: <%--not used on initial 04-29-2013 release <%@include file="/plugins/menus/menus_head_java_include.jsp"%> <% /*BOOKMARK -----newsection popup with parent leftnav links listed*/ if (linkoptions.indexOf(",template,") != -1 && rz.isvalidfield(listModule,"linktosectionid")) { rz.pagerecordid = rz.pageparentid; revize_menu_linkplacement = "leftnav"; %> <%@ include file="/plugins/menus/menus_leftnav_section_filter_include_code.jsp" %> <% } %> --%> Top navigation links usually create a new landing page for a group of related pages such as "Departments", "Boards", Residents." or Business" which share the same side navigation links.

However if this link is related to the following pages (i.e. shares same side navigation links), Select Page has same side navigation links as

Side navigation links are usually the same for all related pages such as all pages within a department

if this link will NOT have same side navigation links as the following related pages shown below, Select Page starts new side navigation links

<%}//end usePathFilename%> <% if (linkoptions.indexOf(",template,") != -1){%>
<% String on = ""; String off = ""; if (rz.editaction.equals("update")) { if (rz.isvalidfield(listModule,"linktosectionid") && linkToSectionId.equals(linkId)) on = " checked"; else off = " checked"; } %>
disabled /> Page starts new side navigation links
CANNOT change after save
<%}//end template fields%>
<%=rz.tracestack%>