/** * Returns the name of the user who created the given resource.<p> * * @return the name of the user who created the given resource */ public String getUserCreated() { String user = m_resource.getUserCreated().toString(); try { user = getCurrentOuRelativeName( CmsPrincipal.readPrincipalIncludingHistory(getCms(), m_resource.getUserCreated()).getName()); } catch (Throwable e) { LOG.info(e.getLocalizedMessage()); } return user; }
/** * Returns the name of the user who created the given resource.<p> * * @return the name of the user who created the given resource */ public String getUserCreated() { String user = m_resource.getUserCreated().toString(); try { user = getCurrentOuRelativeName(CmsPrincipal.readPrincipalIncludingHistory( getCms(), m_resource.getUserCreated()).getName()); } catch (Throwable e) { LOG.error(e.getLocalizedMessage()); } return user; }
resource.getState(), resource.getDateCreated(), resource.getUserCreated(), resource.getDateLastModified(), resource.getUserLastModified(),
createdUser = resource.getUserCreated();
createdUser = resource.getUserCreated();
resource.getState(), resource.getDateCreated(), resource.getUserCreated(), resource.getDateLastModified(), resource.getUserLastModified(),
if (resource.getUserCreated().equals(principalId)) { createdUser = replacementId; attrModified = true;
stmt.setInt(3, offlineResource.getFlags()); stmt.setLong(4, offlineResource.getDateCreated()); stmt.setString(5, offlineResource.getUserCreated().toString()); stmt.setLong(6, offlineResource.getDateLastModified()); stmt.setString(7, offlineResource.getUserLastModified().toString());
if (resource.getUserCreated().equals(principalId)) { createdUser = replacementId; attrModified = true;
/** * @see org.opencms.db.I_CmsVfsDriver#transferResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID) */ public void transferResource( CmsDbContext dbc, CmsProject project, CmsResource resource, CmsUUID createdUser, CmsUUID lastModifiedUser) throws CmsDataAccessException { if (createdUser == null) { createdUser = resource.getUserCreated(); } if (lastModifiedUser == null) { lastModifiedUser = resource.getUserLastModified(); } try { Query q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_TRANSFER_RESOURCE); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setUserCreated(createdUser.toString()); r.setUserLastModified(lastModifiedUser.toString()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } }
m_structureId = res.getStructureId().toString(); try { m_userCreated = cms.readUser(res.getUserCreated()).getFullName(); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e);
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
CmsListItem item = ret.getObject(resource.getResourceId().toString()); if (item == null) { String userCreated = resource.getUserCreated().toString(); try { userCreated = getCms().readUser(resource.getUserCreated()).getFullName(); } catch (CmsException exc) {
/** * Constructor, creates a new CmsFolder Object from the given CmsResource.<p> * * @param resource the base resource object to create a folder from */ public CmsFolder(CmsResource resource) { this( resource.getStructureId(), resource.getResourceId(), resource.getRootPath(), resource.getTypeId(), resource.getFlags(), resource.getProjectLastModified(), resource.getState(), resource.getDateCreated(), resource.getUserCreated(), resource.getDateLastModified(), resource.getUserLastModified(), resource.getDateReleased(), resource.getDateExpired(), resource.getVersion()); }
/** * Returns the virtual resource.<p> * * @return the virtual resource */ public CmsResource getResource() { return new CmsResource( m_base.getStructureId(), m_base.getResourceId(), m_rootPath, m_typeId, m_isFolder, m_base.getFlags(), m_base.getProjectLastModified(), m_base.getState(), m_base.getDateCreated(), m_base.getUserCreated(), m_base.getDateLastModified(), m_base.getUserLastModified(), m_base.getDateReleased(), m_base.getDateExpired(), m_base.getSiblingCount(), m_length, m_base.getDateContent(), m_base.getVersion()); }
CmsResource.STATE_KEEP, source.getUserCreated(), source.getDateLastModified(), source.getUserLastModified(),
/** * Creates a new instance.<p> * * @param cms the current CMS context * @param res the resource to wrap */ public CmsJspResourceWrapper(CmsObject cms, CmsResource res) { super( res.getStructureId(), res.getResourceId(), res.getRootPath(), res.getTypeId(), res.isFolder(), res.getFlags(), res.getProjectLastModified(), res.getState(), res.getDateCreated(), res.getUserCreated(), res.getDateLastModified(), res.getUserLastModified(), res.getDateReleased(), res.getDateExpired(), res.getSiblingCount(), res.getLength(), res.getDateContent(), res.getVersion()); m_cms = cms; }
/** * Constructor, creates a new file Object from the given resource with * an empty byte array as file content, if the resource does not * implement a file.<p> * * @param resource the base resource object to create a file from */ public CmsFile(CmsResource resource) { this( resource.getStructureId(), resource.getResourceId(), resource.getRootPath(), resource.getTypeId(), resource.getFlags(), resource.getProjectLastModified(), resource.getState(), resource.getDateCreated(), resource.getUserCreated(), resource.getDateLastModified(), resource.getUserLastModified(), resource.getDateReleased(), resource.getDateExpired(), resource.getSiblingCount(), resource.getLength(), resource.getDateContent(), resource.getVersion(), // if the resource already is a file, keep contents that might have been already read resource instanceof CmsFile ? ((CmsFile)resource).getContents() : null); }
/** * Constructor, creates a new file Object from the given resource with * an empty byte array as file content, if the resource does not * implement a file.<p> * * @param resource the base resource object to create a file from * @param doc the search document */ public CmsSearchResource(CmsResource resource, I_CmsSearchDocument doc) { this( resource.getStructureId(), resource.getResourceId(), resource.getRootPath(), resource.getTypeId(), resource.getFlags(), resource.getProjectLastModified(), resource.getState(), resource.getDateCreated(), resource.getUserCreated(), resource.getDateLastModified(), resource.getUserLastModified(), resource.getDateReleased(), resource.getDateExpired(), resource.getSiblingCount(), resource.getLength(), resource.getDateContent(), resource.getVersion(), doc); }
r.setResourceFlags(offlineResource.getFlags()); r.setDateCreated(offlineResource.getDateCreated()); r.setUserCreated(offlineResource.getUserCreated().toString()); r.setDateLastModified(offlineResource.getDateLastModified()); r.setUserLastModified(offlineResource.getUserLastModified().toString());