/** * Creates a new {@link CmsRelation} object from the given result set entry.<p> * * @param res the result set * * @return the new {@link CmsRelation} object * * @throws SQLException if something goes wrong */ protected CmsRelation internalReadRelation(ResultSet res) throws SQLException { CmsUUID sourceId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_ID"))); String sourcePath = res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_PATH")); CmsUUID targetId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_RELATION_TARGET_ID"))); String targetPath = res.getString(m_sqlManager.readQuery("C_RELATION_TARGET_PATH")); int type = res.getInt(m_sqlManager.readQuery("C_RELATION_TYPE")); return new CmsRelation(sourceId, sourcePath, targetId, targetPath, CmsRelationType.valueOf(type)); }
/** * Creates a new {@link CmsRelation} object from the given result set entry.<p> * * @param res the result set * * @return the new {@link CmsRelation} object * * @throws SQLException if something goes wrong */ protected CmsRelation internalReadRelation(ResultSet res) throws SQLException { CmsUUID sourceId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_ID"))); String sourcePath = res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_PATH")); CmsUUID targetId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_RELATION_TARGET_ID"))); String targetPath = res.getString(m_sqlManager.readQuery("C_RELATION_TARGET_PATH")); int type = res.getInt(m_sqlManager.readQuery("C_RELATION_TYPE")); return new CmsRelation(sourceId, sourcePath, targetId, targetPath, CmsRelationType.valueOf(type)); }
CmsRelationType type = CmsRelationType.valueOf(relationType); CmsRelation relation = new CmsRelation( resource.getStructureId(), resource.getRootPath(),
CmsRelationType type = CmsRelationType.valueOf(relationType); CmsRelation relation = new CmsRelation( resource.getStructureId(), resource.getRootPath(),
m_relations.put(m_resource.getRootPath(), currentRelations); currentRelations.add(new CmsRelation( m_resource.getStructureId(), m_resource.getRootPath(),
originalRelation = new CmsRelation(resource, target, link.getType()); } catch (Exception e) { originalRelation = new CmsRelation( resource.getStructureId(), resource.getRootPath(), while (itSiblings.hasNext()) { CmsResource sibling = (CmsResource)itSiblings.next(); CmsRelation relation = new CmsRelation( sibling.getStructureId(), sibling.getRootPath(),
new CmsRelation( m_resource.getStructureId(), m_resource.getRootPath(),
new CmsRelation( m_resource.getStructureId(), m_resource.getRootPath(),
CmsRelation originalRelation = new CmsRelation( resource.getStructureId(), resource.getRootPath(), while (itSiblings.hasNext()) { CmsResource sibling = itSiblings.next(); CmsRelation relation = new CmsRelation( sibling.getStructureId(), sibling.getRootPath(),
/** * Creates a new {@link CmsRelation} object from the given result set entry.<p> * * @param rr the resource relation * * @return the new {@link CmsRelation} object */ protected CmsRelation internalReadRelation(I_CmsDAOResourceRelations rr) { CmsUUID sourceId = new CmsUUID(rr.getRelationSourceId()); String sourcePath = rr.getRelationSourcePath(); CmsUUID targetId = new CmsUUID(rr.getRelationTargetId()); String targetPath = rr.getRelationTargetPath(); int type = rr.getRelationType(); return new CmsRelation(sourceId, sourcePath, targetId, targetPath, CmsRelationType.valueOf(type)); }
CmsRelation relation = new CmsRelation(ouResource, resource, CmsRelationType.OU_RESOURCE); m_driverManager.getVfsDriver().createRelation(dbc, dbc.currentProject().getUuid(), relation); m_driverManager.getVfsDriver().createRelation(dbc, CmsProject.ONLINE_PROJECT_ID, relation);
CmsRelation relation = new CmsRelation(ouResource, resource, CmsRelationType.OU_RESOURCE); m_driverManager.getVfsDriver(dbc).createRelation(dbc, dbc.currentProject().getUuid(), relation); m_driverManager.getVfsDriver(dbc).createRelation(dbc, CmsProject.ONLINE_PROJECT_ID, relation);
CmsRelation relation = new CmsRelation(ouResource, resource, CmsRelationType.OU_RESOURCE); m_driverManager.getVfsDriver(dbc).createRelation(dbc, dbc.currentProject().getUuid(), relation); m_driverManager.getVfsDriver(dbc).createRelation(dbc, CmsProject.ONLINE_PROJECT_ID, relation);
/** * 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()); } }
type.getLocalizedName(dbc.getRequestContext().getLocale()))); CmsRelation relation = new CmsRelation(resource, target, type); getVfsDriver(dbc).createRelation(dbc, dbc.currentProject().getUuid(), relation); if (!importCase) {