<%@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 partitionsIDs = new Vector(); if ("Actor".equals(type)) { try { partitionsIDs.add((String)bbObject.getProperty(partitionField)); } catch (FieldNotInitializedException fnie) { } catch (FrontlineException fe) { } } else { try { partitionsIDs = (Vector)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 partitionsList = PartitionBean.list(context); JSONArray jsonPossibleValuesArray = new JSONArray(); for (PartitionBean partitionBean : partitionsList) { JSONObject aPartitionPossibleValue = new JSONObject(); aPartitionPossibleValue.put("value", Utils.formatToWeb(partitionBean.getID(), true)); aPartitionPossibleValue.put("label", Utils.formatToWeb(partitionBean.getPrtName(), true)); jsonPossibleValuesArray.put(aPartitionPossibleValue); } %>
values='<%=jsonValuesArray.toString() %>' isMultiValued = 'true' actions='{"add": {"authorizedouble": false}}' <% } else { if (jsonValuesArray.length() > 0) {%> values='<%=jsonValuesArray.get(0).toString() %>' <% } else {%> values='' <%}%> <%}%> possiblevalues='<%=jsonPossibleValuesArray.toString() %>' >