/** * Returns the formatted date of expiration.<p> * * @return the formatted date of expiration */ public String getDateExpired() { long release = m_resource.getDateExpired(); if (release != CmsResource.DATE_EXPIRED_DEFAULT) { return getMessages().getDateTime(release); } else { return CmsWorkplace.DEFAULT_DATE_STRING; } }
/** * Returns the formatted date of expiration.<p> * * @return the formatted date of expiration */ public String getDateExpired() { long release = m_resource.getDateExpired(); if (release != CmsResource.DATE_EXPIRED_DEFAULT) { return getMessages().getDateTime(release); } else { return CmsTouch.DEFAULT_DATE_STRING; } }
if ((resource.getDateReleased() < now) && (resource.getDateExpired() > now)) { CmsFlexController.setDateExpiresHeader(res, resource.getDateExpired(), m_clientCacheMaxAge);
if ((resource.getDateReleased() < now) && (resource.getDateExpired() > now)) { CmsFlexController.setDateExpiresHeader(res, resource.getDateExpired(), m_clientCacheMaxAge);
long expireTime = resource.getDateExpired(); if (expireTime == CmsResource.DATE_EXPIRED_DEFAULT) { expireTime--;
long expireTime = resource.getDateExpired(); if (expireTime == CmsResource.DATE_EXPIRED_DEFAULT) { expireTime--;
/** * Updates the "last modified" date for this context as well as the * "expires" date with the values from a given resource.<p> * * The "expires" date is the calculated from the given date values * of resource release and expiration and also the current time.<p> * * @param resource the resource to use for updating the context values */ public void updateFromResource(CmsResource resource) { // first set the last modification date updateDateLastModified(resource.getDateLastModified()); // now use both release and expiration date from the resource to update the expires info updateDateExpires(resource.getDateReleased()); updateDateExpires(resource.getDateExpired()); } }
/** * Updates the "last modified" date for this context as well as the * "expires" date with the values from a given resource.<p> * * The "expires" date is the calculated from the given date values * of resource release and expiration and also the current time.<p> * * @param resource the resource to use for updating the context values */ public void updateFromResource(CmsResource resource) { // first set the last modification date updateDateLastModified(resource.getDateLastModified()); // now use both release and expiration date from the resource to update the expires info updateDateExpires(resource.getDateReleased()); updateDateExpires(resource.getDateExpired()); } }
/** * Returns the current expire date as String formatted in localized pattern.<p> * * @return the current expire date as String formatted in localized pattern */ public String getCurrentExpireDate() { // get the expiration date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateExpired() == CmsResource.DATE_EXPIRED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateExpired()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }
/** * Returns the current expire date as String formatted in localized pattern.<p> * * @return the current expire date as String formatted in localized pattern */ public String getCurrentExpireDate() { // get the expiration date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateExpired() == CmsResource.DATE_EXPIRED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateExpired()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }
resource.getUserLastModified(), resource.getDateReleased(), resource.getDateExpired(), resource.getSiblingCount(), resource.getLength(),
/** * 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 } }
result.setDateExpired(res.getDateExpired());
/** * @see org.opencms.search.fields.CmsSearchFieldConfiguration#appendDates(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List) */ @Override protected I_CmsSearchDocument appendDates( I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, List<CmsProperty> propertiesSearched) { document.addDateField(CmsSearchField.FIELD_DATE_CREATED, resource.getDateCreated(), false); document.addDateField(CmsSearchField.FIELD_DATE_LASTMODIFIED, resource.getDateLastModified(), false); document.addDateField(CmsSearchField.FIELD_DATE_CONTENT, resource.getDateContent(), false); document.addDateField(CmsSearchField.FIELD_DATE_RELEASED, resource.getDateReleased(), false); document.addDateField(CmsSearchField.FIELD_DATE_EXPIRED, resource.getDateExpired(), false); return document; }
/** * 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()); }
expireDate = resource.getDateExpired();
/** * 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); }
/** * 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); }