Tabnine Logo
Property.getDate
Code IndexAdd Tabnine to your IDE (free)

How to use
getDate
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getDate (Showing top 20 results out of 648)

origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public Calendar getDate() throws ValueFormatException, RepositoryException {
  return property.getDate();
}
origin: org.apache.sling/org.apache.sling.scripting.javascript

public Object jsGet_date() {
  try {
    return property.getDate();
  } catch (RepositoryException re) {
    return Undefined.instance;
  }
}
origin: info.magnolia/magnolia-core

/**
 * Returns the date when the node was last activated or null if no activation date has been stored on the node.
 */
public static Calendar getLastActivated(Node node) throws RepositoryException {
  return node.hasProperty(LAST_ACTIVATED) ? node.getProperty(LAST_ACTIVATED).getDate() : null;
}
origin: info.magnolia/magnolia-core

/**
 * Returns the latest activated version creation time or null if the version creation time isn't set.
 */
public static Calendar getLastActivatedVersionCreated(Node node) throws RepositoryException {
  return node.hasProperty(LAST_ACTIVATED_VERSION_CREATED) ? node.getProperty(LAST_ACTIVATED_VERSION_CREATED).getDate() : null;
}
origin: info.magnolia/magnolia-core

/**
 * Returns the date when the node was deleted or null if no deletion date has been stored on the node.
 */
public static Calendar getDeleted(Node node) throws RepositoryException {
  return node.hasProperty(DELETED) ? node.getProperty(DELETED).getDate() : null;
}
origin: info.magnolia/magnolia-core

/**
 * Returns the creation date of a node or null if creation date isn't set.
 */
public static Calendar getCreated(Node node) throws RepositoryException {
  return node.hasProperty(CREATED) ? node.getProperty(CREATED).getDate() : null;
}
origin: info.magnolia/magnolia-core

/**
 * @return the lastModification or null it it was not set in JCR.
 * @deprecated since 5.0 use {@link info.magnolia.jcr.util.NodeTypes.LastModified#getLastModified(javax.jcr.Node)}.
 */
public static Calendar getLastModification(Node node) throws PathNotFoundException, RepositoryException, ValueFormatException {
  Node meta = node.getNode(MetaData.DEFAULT_META_NODE);
  String lastMod = RepositoryConstants.NAMESPACE_PREFIX + ":" + MetaData.LAST_MODIFIED;
  return (meta.hasProperty(lastMod)) ? meta.getProperty(lastMod).getDate() : null;
}
origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

/**
 * {@inheritDoc}
 */
public long getLastModified() {
  try {
    return content.getProperty(JcrConstants.JCR_LASTMODIFIED).getDate().getTimeInMillis();
  } catch (RepositoryException e) {
    log.error("Error while retrieving last modified of " + content, e);
    return 0;
  }
}
origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

private long getVersionStamp(final Node node) throws RepositoryException {
  final long versionStamp;
  if (node.hasProperty(HstNodeTypes.GENERAL_PROPERTY_LAST_MODIFIED)) {
    versionStamp = node.getProperty(HstNodeTypes.GENERAL_PROPERTY_LAST_MODIFIED).getDate().getTimeInMillis();
  } else {
    versionStamp = 0;
  }
  return versionStamp;
}
origin: info.magnolia/magnolia-core

/**
 * Returns the date when this node was last modified. If the no modification date has been stored on the node this
 * method return the creation date if set, otherwise null is returned.
 */
public static Calendar getLastModified(Node node) throws RepositoryException {
  return node.hasProperty(LAST_MODIFIED) ? node.getProperty(LAST_MODIFIED).getDate() : Created.getCreated(node);
}
origin: org.onehippo.cms7/hippo-addon-defaultcontent-repository

  @Override
  public void leaving(final Node node, int level) throws RepositoryException {
    if (node.hasNode("defaultcontent_1_6:date")) {
      Node dateNode = node.getNode("defaultcontent_1_6:date");
      Calendar value = dateNode.getProperty("hippostd:date").getDate();
      dateNode.remove();
      node.setProperty("defaultcontent_1_6:date", value);
    }
  }
});
origin: org.openl.rules/org.openl.rules.repository.jcr

public JcrVersion(Node node) throws RepositoryException {
  // frozen node
  initVersion(node);
  Node parent = node.getParent();
  if (parent.hasProperty("jcr:created")) {
    lastModified = parent.getProperty("jcr:created").getDate().getTime();
  }
}
origin: info.magnolia/magnolia-core

public Calendar getDateProperty(String name) {
  try {
    final Property property = getJCRProperty(name);
    if (property != null) {
      return property.getDate();
    }
  } catch (RepositoryException re) {
    log.error(re.getMessage(), re);
  }
  return null;
}
origin: info.magnolia/magnolia-core

@Override
public Calendar getDate() {
  if (isExist()) {
    try {
      return getJCRProperty().getDate();
    } catch (RepositoryException e) {
      throw new RuntimeException("Can't read value of nodedata " + toString(), e);
    }
  }
  return null;
}
origin: org.openl.rules/org.openl.rules.repository.jcr

public JcrVersion(Version version) throws RepositoryException {
  // storing node's properties into variables to reduce 'throws' for
  // getters
  Node frozen = version.getNode(JcrNT.FROZEN_NODE);
  initVersion(frozen);
  lastModified = version.getProperty("jcr:created").getDate().getTime();
}
origin: pentaho/pentaho-platform

 public Object doInJcr( final Session session ) throws RepositoryException {
  Item item = session.getItem( absPath );
  Assert.isTrue( !item.isNode() );
  return ( (Property) item ).getDate().getTime();
 }
} );
origin: info.magnolia/magnolia-core

@Test
public void testSetCreation() throws RepositoryException {
  // GIVEN
  final String userName = "Junit";
  // WHEN
  NodeTypes.Created.set(first, userName, Calendar.getInstance());
  // THEN
  assertTrue("Created should just have been set", (Calendar.getInstance().getTimeInMillis() - first.getProperty(NodeTypes.Created.CREATED).getDate().getTimeInMillis()) < 1000);
  assertEquals(first.getProperty(NodeTypes.Created.CREATED).getString(), first.getProperty(NodeTypes.LastModified.LAST_MODIFIED).getString());
  assertEquals(userName, first.getProperty(NodeTypes.Created.CREATED_BY).getString());
  assertEquals(userName, first.getProperty(NodeTypes.LastModified.LAST_MODIFIED_BY).getString());
}
origin: info.magnolia/magnolia-core

@Test
public void setPropertyToDate() throws Exception {
  // GIVEN
  final Object value = new Date();
  PropertyUtil.setProperty(root, PROPERTY_NAME, value);
  // WHEN
  Calendar res = root.getProperty(PROPERTY_NAME).getDate();
  // THEN
  assertEquals(value, res.getTime());
}
origin: info.magnolia/magnolia-core

@Test
public void setPropertyToCalendar() throws Exception {
  // GIVEN
  final Object value = Calendar.getInstance();
  PropertyUtil.setProperty(root, PROPERTY_NAME, value);
  // WHEN
  Calendar res = root.getProperty(PROPERTY_NAME).getDate();
  // THEN
  assertEquals(value, res);
}
origin: ModeShape/modeshape

 @Test
public void shouldAccessCreationDatePropertyForDocument() throws Exception {
  Node node = getSession().getNode("/cmis/My_Folder-0-0/My_Document-1-0");
  Calendar date = node.getProperty("jcr:created").getDate();
  assertTrue(date != null);
}
javax.jcrPropertygetDate

Javadoc

Returns a Calendar representation of the value of this property. A shortcut for Property.getValue().getDate().

Popular methods of Property

  • getString
    Returns a String representation of the value of this property. A shortcut for Property.getValue().g
  • getValues
    Returns an array of all the values of this property. Used to access multi-value properties. The arra
  • getValue
    Returns the value of this property as a Value object. The object returned is a copy of the stored va
  • getName
  • getType
    Returns the type of this Property. One of: * PropertyType.STRING * PropertyType.BINARY * Property
  • getBinary
    Returns a Binary representation of the value of this property. A shortcut for Property.getValue().g
  • getBoolean
    Returns a boolean representation of the value of this property. A shortcut for Property.getValue().
  • remove
  • isMultiple
    Returns true if this property is multi-valued andfalse if this property is single-valued.
  • getLong
    Returns a long representation of the value of this property. A shortcut for Property.getValue().get
  • getDefinition
    Returns the property definition that applies to this property. In some cases there may appear to be
  • setValue
    Sets the value of this property to the values array. If this property's property type is not constra
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now