/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getUri().hashCode(); }
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getUri().hashCode(); }
/** * 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()); } } }
/** * 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()); } } }
/** * 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 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 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 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 if (!isNewExportPoint()) { 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 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())); } }
/** * 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 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())); } }
/** * @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; }
while (i.hasNext()) { CmsExportPoint exportpoint = (CmsExportPoint)i.next(); if (exportpoint.getUri().equals(m_paramExportpoint)) { m_exportpoint = exportpoint;
while (i.hasNext()) { CmsExportPoint exportpoint = (CmsExportPoint)i.next(); if (exportpoint.getUri().equals(m_paramExportpoint)) { m_exportpoint = exportpoint;
while (i.hasNext()) { CmsExportPoint exp = (CmsExportPoint)i.next(); if (!exp.getUri().equals(exportpoint)) { newExportpoints.add(exp);
while (exportPoints.hasNext()) { CmsExportPoint point = exportPoints.next(); resourceloadersElement.addElement(N_EXPORTPOINT).addAttribute(A_URI, point.getUri()).addAttribute( A_DESTINATION, point.getConfiguredDestination());
exportpointsElement.addElement(I_CmsXmlConfiguration.N_EXPORTPOINT).addAttribute( I_CmsXmlConfiguration.A_URI, point.getUri()).addAttribute(I_CmsXmlConfiguration.A_DESTINATION, point.getConfiguredDestination());
exportpointsElement.addElement(I_CmsXmlConfiguration.N_EXPORTPOINT).addAttribute( I_CmsXmlConfiguration.A_URI, point.getUri()).addAttribute(I_CmsXmlConfiguration.A_DESTINATION, point.getConfiguredDestination());