Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\common\partition\update_partition_for_object.jsp
<%@page import="com.edeal.frontline.FrontlineException"%> <%@page import="com.edeal.frontline.Utils"%> <%@page import="com.edeal.frontline.ObjectsBean"%> <%@page import="com.edeal.frontline.BasicBean"%> <%@page import="org.json.JSONObject"%> <%@page import="org.json.JSONArray"%> <%@page import="java.util.Vector"%> <%@page import="com.edeal.frontline.partition.PartitionManager"%> <%@page import="com.edeal.frontline.PartitionBean"%> <%@page import="com.edeal.frontline.DataDictionary"%> <%@page import="com.edeal.frontline.FlContext"%> <%@page import="com.edeal.frontline.navigation.FlRequest"%> <%@page import="com.edeal.frontline.FieldNotInitializedException" %> <%@taglib uri="http://www.e-deal.com/taglib/ft" prefix="ft" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String id = flRequest.getRequestParameterOrAttribute("id"); String type = flRequest.getRequestParameterOrAttribute("type"); BasicBean bbObject = dico.getTable("sql", type).getBasicBean(id); String partitionField; partitionField = bbObject.getPartitionField(); Vector<String> partitionsIDs = new Vector<String>(); if ("Actor".equals(type)) { try { partitionsIDs.add((String)bbObject.getProperty(partitionField)); } catch (FieldNotInitializedException fnie) { } catch (FrontlineException fe) { } } else { try { partitionsIDs = (Vector<String>)bbObject.getProperty(partitionField); } catch (FieldNotInitializedException fnie) { } catch (FrontlineException fe) { } } JSONArray jsonValuesArray = new JSONArray(); for (String aPartitionId : partitionsIDs) { JSONObject aPartitionValue = new JSONObject(); aPartitionValue.put("value", Utils.formatToWeb(aPartitionId, true)); jsonValuesArray.put(aPartitionValue); } Vector<PartitionBean> partitionsList = PartitionBean.list(context); JSONArray jsonPossibleValuesArray = new JSONArray(); for (PartitionBean partitionBean : partitionsList) { JSONObject aPartitionPossibleValue = new JSONObject(); aPartitionPossibleValue.put("value", Utils.formatToWeb(partitionBean.getID(), true)); //http://u-project2.umanis.com/view.php?id=36849 : non urgent String entityLabel = Utils.formatToWeb(partitionBean.getPrtName(), true); entityLabel = entityLabel.replaceAll("'", "’"); aPartitionPossibleValue.put("label", entityLabel); jsonPossibleValuesArray.put(aPartitionPossibleValue); } %> <script language="javascript"> function savePartitionForObjects() { var strPartitionIds = ""; var partitionView = edManager.getViewByID('partitionField'); var partitionDialog = edManager.getViewByID("PartitionDialog"); partitionDialog.displayNowLoading(); if (partitionView.options.ismultivalued) { partitionView.model.each(function(item) { if (item.get("value") != "") { strPartitionIds = strPartitionIds + item.get("value") + ";"; } }); } else { if (partitionView.model.get("value") != "") { strPartitionIds = partitionView.model.get("value"); } } var url = edApplication().path + "update_partitions_for_object.fl"; var data = {objId: '<%=id%>', objType: '<%=type%>', partitionIds: strPartitionIds}; $.ajax({ url: url, data: data, async: true, dataType: "json" }) .success(function(data) { partitionDialog.removeNowLoading(); window.location.reload(); }) .error(function(jqXHR, textStatus, errorThrown) { partitionDialog.removeNowLoading(); console.error("jqXHR object :"); console.error(jqXHR); console.error("textStatus :"); console.error(textStatus); console.error("errorThrown : "); console.error(errorThrown); }); } $(document).ready(function() { var view = edManager.getViewByID("PartitionDialog"); view.on("ondialogopen", createDialogButton); }); function createDialogButton() { var view = edManager.getViewByID("PartitionDialog"); view.$el.dialog( "option", "buttons", [{id: "CANCEL", text: "Annuler", click: function() {$(this).dialog("close");}}, {id: "OK", text: "OK", click: function() {savePartitionForObjects();}}]); } </script> <div style=" display: block; width:97%; height:92%; padding: 5px; border: 3px solid DodgerBlue; background-color: white; overflow: auto;" align="center"> <edSelectAutoFilter id='partitionField' <%if (!"Actor".equals(type)) { %> values='<%=jsonValuesArray.toString() %>' isMultiValued = 'true' actions='{"add": {"authorizedouble": false}}' <% } else { if (jsonValuesArray.length() > 0) {%> values='<%=jsonValuesArray.get(0).toString() %>' <% } else {%> values='' <%}%> <%}%> possiblevalues='<%=jsonPossibleValuesArray.toString() %>' ></edSelectAutoFilter> </div>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de