/** * Returns a localized name for the given relation type.<p> * * @param locale the locale * * @return a localized name */ public String getLocalizedName(Locale locale) { return getLocalizedName(Messages.get().getBundle(locale)); }
/** * Returns a localized name for the given relation type.<p> * * @param locale the locale * * @return a localized name */ public String getLocalizedName(Locale locale) { return getLocalizedName(Messages.get().getBundle(locale)); }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { List<CmsListItem> newItems = new ArrayList<CmsListItem>(); List<CmsListItem> items = super.getListItems(); Iterator<CmsListItem> itItems = items.iterator(); while (itItems.hasNext()) { CmsListItem item = itItems.next(); CmsResource resource = getResourceUtil(item).getResource(); CmsRelationType relationType = getRelationTypes().get(resource).remove(0); String localizedRelationType = relationType.getLocalizedName(getMessages()); Map<String, Object> itemValues = item.getValues(); CmsListItem newItem = getList().newItem(localizedRelationType + "_" + resource.getStructureId().toString()); Iterator<Entry<String, Object>> itItemValuesKeys = itemValues.entrySet().iterator(); while (itItemValuesKeys.hasNext()) { Entry<String, Object> e = itItemValuesKeys.next(); String currentKey = e.getKey(); newItem.set(currentKey, e.getValue()); } newItem.set(LIST_COLUMN_RELATION_TYPE, localizedRelationType); newItems.add(newItem); } return newItems; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List getListItems() throws CmsException { List newItems = new ArrayList(); List items = super.getListItems(); Iterator itItems = items.iterator(); while (itItems.hasNext()) { CmsListItem item = (CmsListItem)itItems.next(); CmsResource resource = getResourceUtil(item).getResource(); CmsRelationType relationType = (CmsRelationType)((List)getRelationTypes().get(resource)).remove(0); String localizedRelationType = relationType.getLocalizedName(getMessages()); Map itemValues = item.getValues(); CmsListItem newItem = getList().newItem(localizedRelationType + "_" + resource.getStructureId().toString()); Iterator itItemValuesKeys = itemValues.entrySet().iterator(); while (itItemValuesKeys.hasNext()) { Map.Entry e = (Map.Entry)itItemValuesKeys.next(); String currentKey = (String)e.getKey(); newItem.set(currentKey, e.getValue()); } newItem.set(LIST_COLUMN_RELATION_TYPE, localizedRelationType); newItems.add(newItem); } return newItems; }
html.append(relation.getType().getLocalizedName(getMessages())); html.append(")</span>"); if (itRelations.hasNext()) {
html.append(relation.getType().getLocalizedName(getMessages())); html.append(")</span>"); if (itRelations.hasNext()) {
html.append(relation.getType().getLocalizedName(getMessages())); html.append(")</span>"); if (itRelations.hasNext()) {
html.append(relation.getType().getLocalizedName(getMessages())); html.append(")</span>"); if (itRelations.hasNext()) {
0); if (!brokenLinks.contains(resource)) { brokenLinks.add(relation.getType().getLocalizedName( getWp().getJsp().getRequestContext().getLocale()) + "_"
if (!brokenLinks.contains(resource)) { brokenLinks.add( relation.getType().getLocalizedName(getWp().getJsp().getRequestContext().getLocale()) + "_" + resource.getStructureId());
/** * Adds a new relation to the given resource.<p> * * @param dbc the database context * @param resource the resource to add the relation to * @param target the target of the relation * @param type the type of the relation * @param importCase if importing relations * * @throws CmsException if something goes wrong */ public void addRelationToResource( CmsDbContext dbc, CmsResource resource, CmsResource target, CmsRelationType type, boolean importCase) throws CmsException { if (type.isDefinedInContent()) { throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_ADD_RELATION_IN_CONTENT_3, dbc.removeSiteRoot(resource.getRootPath()), dbc.removeSiteRoot(target.getRootPath()), type.getLocalizedName(dbc.getRequestContext().getLocale()))); } CmsRelation relation = new CmsRelation(resource, target, type); m_vfsDriver.createRelation(dbc, dbc.currentProject().getUuid(), relation); if (!importCase) { setDateLastModified(dbc, resource, System.currentTimeMillis()); } }
dbc.removeSiteRoot(resource.getRootPath()), dbc.removeSiteRoot(target.getRootPath()), type.getLocalizedName(dbc.getRequestContext().getLocale())));