/** * @see org.opencms.file.CmsProject#clone() */ @Override public Object clone() { return new CmsHistoryProject( m_publishTag, getUuid(), getName(), getDescription(), getOwnerId(), getGroupId(), getManagerGroupId(), getDateCreated(), getType(), m_datePublished, m_userPublished, m_projectResources); }
/** * Gets the versionId. * * @return the versionId * * @deprecated Use {@link #getPublishTag()} instead */ public int getVersionId() { return getPublishTag(); }
List<CmsHistoryProject> projects = cms.getAllHistoricalProjects(); for (CmsHistoryProject project : projects) { Item item = m_container.addItem(new Integer(project.getPublishTag())); if (item != null) { item.getItemProperty(CmsProjectsTable.PROP_ID).setValue(project.getUuid()); item.getItemProperty(CmsProjectsTable.PROP_NAME).setValue(project.getSimpleName()); item.getItemProperty(CmsProjectsTable.PROP_DESCRIPTION).setValue(project.getDescription()); item.getItemProperty(PROP_PUBLISH_DATE).setValue(new Date(project.getPublishingDate())); item.getItemProperty(PROP_PUBLISH_USER).setValue(project.getPublishedByName(cms)); try { item.getItemProperty(CmsProjectsTable.PROP_ORG_UNIT).setValue( OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName( locale)); item.getItemProperty(CmsProjectsTable.PROP_OWNER).setValue( cms.readUser(project.getOwnerId()).getName()); item.getItemProperty(CmsProjectsTable.PROP_MANAGER).setValue( cms.readGroup(project.getManagerGroupId()).getSimpleName()); item.getItemProperty(CmsProjectsTable.PROP_USER).setValue( cms.readGroup(project.getGroupId()).getSimpleName()); } catch (CmsException e) { new Date(project.getDateCreated()));
while (itProjects.hasNext()) { CmsHistoryProject project = (CmsHistoryProject)itProjects.next(); CmsListItem item = getList().newItem(new Integer(project.getPublishTag()).toString()); item.set(LIST_COLUMN_NAME, project.getName()); item.set(LIST_COLUMN_DESCRIPTION, project.getDescription()); try { item.set(LIST_COLUMN_OWNER, project.getOwnerName(getCms())); } catch (Exception e) { item.set(LIST_COLUMN_MANAGER, project.getGroupManagersName(getCms())); } catch (Exception e) { item.set(LIST_COLUMN_USER, project.getGroupUsersName(getCms())); } catch (Exception e) { item.set(LIST_COLUMN_PUBLISHED_DATE, new Date(project.getPublishingDate())); } catch (Exception e) { item.set(LIST_COLUMN_PUBLISHED_BY, project.getPublishedByName(getCms())); } catch (Exception e) { item.set(LIST_COLUMN_CREATION, new Date(project.getDateCreated())); ret.add(item);
/** * Fills details of the project into the given item. <p> * * @param item the list item to fill * * @param detailId the id for the detail to fill * */ private void fillDetailProject(CmsListItem item, String detailId) { StringBuffer html = new StringBuffer(); // search /read for the corresponding history project: it's tag id transmitted from getListItems() // in a hidden column Object tagIdObj = item.get(LIST_COLUMN_PUBLISH_TAG); if (tagIdObj != null) { // it is null if the offline version with changes is shown here: now history project available then int tagId = ((Integer)tagIdObj).intValue(); try { CmsHistoryProject project = getCms().readHistoryProject(tagId); // output of project info html.append(project.getName()).append("<br/>").append(project.getDescription()); } catch (CmsException cmse) { html.append(cmse.getMessageContainer().key(this.getLocale())); } } item.set(detailId, html.toString()); } }
while (itProjects.hasNext()) { CmsHistoryProject project = (CmsHistoryProject)itProjects.next(); if (project.isHidden()) { if (!project.getOuFqn().startsWith(dbc.currentUser().getOuFqn())) { CmsOrganizationalUnit ou = readOrganizationalUnit(dbc, project.getOuFqn()); if (manOus.contains(ou)) { } else if (project.getOwnerId().equals(dbc.currentUser().getId())) { while (itGroups.hasNext()) { CmsGroup group = (CmsGroup)itGroups.next(); if (project.getManagerGroupId().equals(group.getId())) { found = true; break;
int publishTag = ((I_CmsHistoryResource)historyRes).getPublishTag(); CmsHistoryProject project = cms.readHistoryProject(publishTag); long publishDate = project.getPublishingDate(); result.setDatePublished(formatDate(publishDate, locale)); int version = ((I_CmsHistoryResource)historyRes).getVersion();
/** * Returns the project name that locked the current resource's.<p> * * @return the the project name that locked the current resource's */ public String getLockedInProjectName() { try { CmsUUID pId = getLockedInProjectId(); if ((pId == null) || pId.isNullUUID()) { // the resource is unlocked and unchanged return ""; } try { return getCurrentOuRelativeName(getCms().readProject(pId).getName()); } catch (CmsDbEntryNotFoundException e) { return getCurrentOuRelativeName(getCms().readHistoryProject(pId).getName()); } } catch (Throwable e) { LOG.error(e.getLocalizedMessage(), e); return ""; } }
/** * Returns the projects user group name.<p> * * @return the projects user group name * * @deprecated use {@link #getGroupUsersName(CmsObject)} instead */ public String getGroupName() { return getGroupId().toString(); }
/** * Gets the ownername. * * @return the ownername * * @deprecated use {@link #getOwnerName(CmsObject)} instead */ public String getOwnerName() { return getOwnerId().toString(); }
/** * Returns the project manager group name.<p> * * @return the projects manager group name * * @deprecated use {@link #getGroupManagersName(CmsObject)} instead */ public String getManagerGroupName() { return getManagerGroupId().toString(); }
/** * Creates a historical project from the given result set and resources.<p> * @param res the resource set * @param resources the historical resources * * @return the historical project * * @throws SQLException if something goes wrong */ protected CmsHistoryProject internalCreateProject(ResultSet res, List resources) throws SQLException { String ou = CmsOrganizationalUnit.removeLeadingSeparator(res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_OU_0"))); CmsUUID publishedById = new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECT_PUBLISHED_BY_0"))); CmsUUID userId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_USER_ID_0"))); return new CmsHistoryProject( res.getInt(m_sqlManager.readQuery("C_PROJECTS_PUBLISH_TAG_0")), new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_ID_0"))), ou + res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_NAME_0")), res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_DESCRIPTION_0")), userId, new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_GROUP_ID_0"))), new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_MANAGERGROUP_ID_0"))), res.getLong(m_sqlManager.readQuery("C_PROJECTS_DATE_CREATED_0")), CmsProject.CmsProjectType.valueOf(res.getInt(m_sqlManager.readQuery("C_PROJECTS_PROJECT_TYPE_0"))), res.getLong(m_sqlManager.readQuery("C_PROJECT_PUBLISHDATE_0")), publishedById, resources); }
/** * Fills details of the project into the given item. <p> * * @param item the list item to fill * * @param detailId the id for the detail to fill * */ private void fillDetailProject(CmsListItem item, String detailId) { StringBuffer html = new StringBuffer(); // search /read for the corresponding history project: it's tag id transmitted from getListItems() // in a hidden column Object tagIdObj = item.get(LIST_COLUMN_PUBLISH_TAG); if (tagIdObj != null) { // it is null if the offline version with changes is shown here: now history project available then int tagId = ((Integer)tagIdObj).intValue(); try { CmsHistoryProject project = getCms().readHistoryProject(tagId); // output of project info html.append(project.getName()).append("<br/>").append(project.getDescription()); } catch (CmsException cmse) { html.append(cmse.getMessageContainer().key(getLocale())); } } item.set(detailId, html.toString()); } }
while (itProjects.hasNext()) { CmsHistoryProject project = itProjects.next(); if (project.isHidden()) { if (!project.getOuFqn().startsWith(dbc.currentUser().getOuFqn())) { CmsOrganizationalUnit ou = readOrganizationalUnit(dbc, project.getOuFqn()); if (manOus.contains(ou)) { } else if (project.getOwnerId().equals(dbc.currentUser().getId())) { while (itGroups.hasNext()) { CmsGroup group = itGroups.next(); if (project.getManagerGroupId().equals(group.getId())) { found = true; break;
String filetype = String.valueOf(histRes.getTypeId()); String dateLastModified = getMessages().getDateTime(histRes.getDateLastModified()); String datePublished = getMessages().getDateTime(project.getPublishingDate());
/** * Returns the project name that locked the current resource's.<p> * * @return the the project name that locked the current resource's */ public String getLockedInProjectName() { try { CmsUUID pId = getLockedInProjectId(); if ((pId == null) || pId.isNullUUID()) { // the resource is unlocked and unchanged return ""; } try { return getCurrentOuRelativeName(getCms().readProject(pId).getName()); } catch (CmsDbEntryNotFoundException e) { return getCurrentOuRelativeName(getCms().readHistoryProject(pId).getName()); } } catch (Throwable e) { LOG.error(e.getLocalizedMessage(), e); return ""; } }
/** * Returns the projects user group name.<p> * * @param cms the current cms context * * @return the projects user group name */ public String getGroupUsersName(CmsObject cms) { try { return CmsPrincipal.readPrincipalIncludingHistory(cms, getGroupId()).getName(); } catch (CmsException e) { return getGroupId().toString(); } }
/** * Returns the owner name.<p> * * @param cms the current cms context * * @return the owner name */ public String getOwnerName(CmsObject cms) { try { return CmsPrincipal.readPrincipalIncludingHistory(cms, getOwnerId()).getName(); } catch (CmsException e) { return getOwnerId().toString(); } }
/** * Returns the project manager group name.<p> * * @param cms the current cms context * * @return the projects manager group name */ public String getGroupManagersName(CmsObject cms) { try { return CmsPrincipal.readPrincipalIncludingHistory(cms, getManagerGroupId()).getName(); } catch (CmsException e) { return getManagerGroupId().toString(); } }
/** * Creates a historical project from the given result set and resources.<p> * @param res the resource set * @param resources the historical resources * * @return the historical project * * @throws SQLException if something goes wrong */ protected CmsHistoryProject internalCreateProject(ResultSet res, List<String> resources) throws SQLException { String ou = CmsOrganizationalUnit.removeLeadingSeparator( res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_OU_0"))); CmsUUID publishedById = new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECT_PUBLISHED_BY_0"))); CmsUUID userId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_USER_ID_0"))); return new CmsHistoryProject( res.getInt(m_sqlManager.readQuery("C_PROJECTS_PUBLISH_TAG_0")), new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_ID_0"))), ou + res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_NAME_0")), res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_DESCRIPTION_0")), userId, new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_GROUP_ID_0"))), new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROJECTS_MANAGERGROUP_ID_0"))), res.getLong(m_sqlManager.readQuery("C_PROJECTS_DATE_CREATED_0")), CmsProject.CmsProjectType.valueOf(res.getInt(m_sqlManager.readQuery("C_PROJECTS_PROJECT_TYPE_0"))), res.getLong(m_sqlManager.readQuery("C_PROJECT_PUBLISHDATE_0")), publishedById, resources); }