/** * Adds newly created export point to the workplace configuration.<p> * * @param uri the export point uri * @param destination the export point destination */ public void addExportPoint(String uri, String destination) { CmsExportPoint point = new CmsExportPoint(uri, destination); m_exportPoints.add(point); if (CmsLog.INIT.isInfoEnabled() && (point.getDestinationPath() != null)) { CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_ADD_EXPORT_POINT_2, point.getUri(), point.getDestinationPath())); } }
/** * Adds an export point to the module configuration.<p> * * @param uri the export point uri * @param destination the export point destination */ public void addExportPoint(String uri, String destination) { CmsExportPoint point = new CmsExportPoint(uri, destination); m_exportPoints.add(point); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_ADD_EXPORT_POINT_2, point.getUri(), point.getConfiguredDestination())); } }
/** * @see java.lang.Object#clone() */ @Override public Object clone() { CmsExportPoint clone = new CmsExportPoint(m_uri, m_configuredDestination); clone.setDestinationPath(getDestinationPath()); return clone; }
/** * Constructor for a CmsExportPointDriver.<p> * * @param exportpoints the list of export points */ public CmsExportPointDriver(Set<CmsExportPoint> exportpoints) { m_exportpoints = exportpoints; m_exportpointLookupMap = new HashMap<String, String>(); Iterator<CmsExportPoint> i = m_exportpoints.iterator(); while (i.hasNext()) { CmsExportPoint point = i.next(); if (point.getDestinationPath() != null) { // otherwise this point is not valid, but must be kept for serializing the configuration m_exportpointLookupMap.put(point.getUri(), point.getDestinationPath()); } } }
while (exportPoints.hasNext()) { CmsExportPoint point = exportPoints.next(); resourceloadersElement.addElement(N_EXPORTPOINT).addAttribute(A_URI, point.getUri()).addAttribute( A_DESTINATION, point.getConfiguredDestination());
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List getListItems() { List ret = new ArrayList(); String moduleName = getParamModule(); CmsModule module = OpenCms.getModuleManager().getModule(moduleName); // get exportpoints List exportpoints = module.getExportPoints(); Iterator i = exportpoints.iterator(); while (i.hasNext()) { CmsExportPoint exportpoint = (CmsExportPoint)i.next(); CmsListItem item = getList().newItem(exportpoint.getUri()); // name item.set(LIST_COLUMN_URI, exportpoint.getUri()); // destination item.set(LIST_COLUMN_DESTINATION, exportpoint.getConfiguredDestination()); // server item.set(LIST_COLUMN_SERVERDESTINATION, exportpoint.getDestinationPath()); ret.add(item); } return ret; }
m_exportpoint = new CmsExportPoint(); if ((exportpoints != null) && (exportpoints.size() > 0)) { Iterator i = exportpoints.iterator(); while (i.hasNext()) { CmsExportPoint exportpoint = (CmsExportPoint)i.next(); if (exportpoint.getUri().equals(m_paramExportpoint)) { m_exportpoint = exportpoint;
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getUri().hashCode(); }
/** * Clones the export points of the module and adjusts its paths.<p> * * @param sourceModule the source module * @param targetModule the target module * @param sourcePathPart the source path part * @param targetPathPart the target path part */ private void cloneExportPoints( CmsModule sourceModule, CmsModule targetModule, String sourcePathPart, String targetPathPart) { for (CmsExportPoint exp : targetModule.getExportPoints()) { if (exp.getUri().contains(sourceModule.getName())) { exp.setUri(exp.getUri().replaceAll(sourceModule.getName(), targetModule.getName())); } if (exp.getUri().contains(sourcePathPart)) { exp.setUri(exp.getUri().replaceAll(sourcePathPart, targetPathPart)); } } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return "[" + getClass().getName() + ", uri: " + m_uri + ", destination: " + getDestinationPath() + "]"; } }
String path = modulePath + PATH_LIB; getCms().createResource(path, folderId); CmsExportPoint exp = new CmsExportPoint(path, "WEB-INF/lib/"); exportPoints.add(exp); module.setExportPoints(exportPoints); String path = modulePath + PATH_CLASSES; getCms().createResource(path, folderId); CmsExportPoint exp = new CmsExportPoint(path, "WEB-INF/classes/"); exportPoints.add(exp); module.setExportPoints(exportPoints);
List<CmsExportPoint> exps = new ArrayList<CmsExportPoint>(); for (CmsExportPoint exp : getExportPoints()) { exps.add((CmsExportPoint)exp.clone());
while (it.hasNext()) { CmsExportPoint point = it.next(); if ((point.getUri().endsWith(module.getName() + "/lib/") || point.getUri().endsWith(module.getName() + "/lib")) && point.getConfiguredDestination().equals("WEB-INF/lib/")) { it.remove();
/** * Constructor for a CmsExportPointDriver.<p> * * @param exportpoints the list of export points */ public CmsExportPointDriver(Set exportpoints) { m_exportpoints = exportpoints; m_exportpointLookupMap = new HashMap(); Iterator i = m_exportpoints.iterator(); while (i.hasNext()) { CmsExportPoint point = (CmsExportPoint)i.next(); if (point.getDestinationPath() != null) { // otherwise this point is not valid, but must be kept for serializing the configuration m_exportpointLookupMap.put(point.getUri(), point.getDestinationPath()); } } }
m_exportpoint = new CmsExportPoint(); if ((exportpoints != null) && (exportpoints.size() > 0)) { Iterator i = exportpoints.iterator(); while (i.hasNext()) { CmsExportPoint exportpoint = (CmsExportPoint)i.next(); if (exportpoint.getUri().equals(m_paramExportpoint)) { m_exportpoint = exportpoint;
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getUri().hashCode(); }
/** * Adds an export point to the module configuration.<p> * * @param uri the export point uri * @param destination the export point destination */ public void addExportPoint(String uri, String destination) { CmsExportPoint point = new CmsExportPoint(uri, destination); m_exportPoints.add(point); if (CmsLog.INIT.isInfoEnabled() && (point.getDestinationPath() != null)) { CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_ADD_EXPORT_POINT_2, point.getUri(), point.getDestinationPath())); } }
exportpointsElement.addElement(I_CmsXmlConfiguration.N_EXPORTPOINT).addAttribute( I_CmsXmlConfiguration.A_URI, point.getUri()).addAttribute(I_CmsXmlConfiguration.A_DESTINATION, point.getConfiguredDestination());
/** * @see org.opencms.workplace.CmsWidgetDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { String moduleName = getParamModule(); // check module CmsModule module = OpenCms.getModuleManager().getModule(moduleName); if (module == null) { throw new Exception(); } // check export point Iterator it = module.getExportPoints().iterator(); while (it.hasNext()) { CmsExportPoint ep = (CmsExportPoint)it.next(); if (ep.getUri().equals(getParamExportpoint())) { // export point found return; } } throw new Exception(); } }
/** * Adds newly created export point to the workplace configuration.<p> * * @param uri the export point uri * @param destination the export point destination */ public void addExportPoint(String uri, String destination) { CmsExportPoint point = new CmsExportPoint(uri, destination); m_exportPoints.add(point); if (CmsLog.INIT.isInfoEnabled() && (point.getDestinationPath() != null)) { CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_ADD_EXPORT_POINT_2, point.getUri(), point.getDestinationPath())); } }