congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Property.getString
Code IndexAdd Tabnine to your IDE (free)

How to use
getString
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getString (Showing top 20 results out of 1,620)

Refine searchRefine arrow

  • Node.getProperty
  • Node.setProperty
  • Session.save
  • Node.hasProperty
  • Test.<init>
  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: info.magnolia/magnolia-core

@Override
public String getNodeTypeName() throws RepositoryException {
  if (this.node.hasProperty(ItemType.JCR_FROZEN_PRIMARY_TYPE)) {
    return this.node.getProperty(ItemType.JCR_FROZEN_PRIMARY_TYPE).getString();
  }
  return this.node.getProperty(ItemType.JCR_PRIMARY_TYPE).getString();
}
origin: org.onehippo.cms7/hippo-repository-deprecated-updater-module

  @Override
  protected void leaving(Node node, int level) throws RepositoryException {
    if (node.hasProperty("hipposys:nodetype")) {
      if ("hipposys:request".equals(node.getProperty("hipposys:nodetype").getString())) {
        node.setProperty("hipposys:nodetype", "hippostdpubwf:request");
      } else if ("hippostd:publishable".equals(node.getProperty("hipposys:nodetype").getString())) {
        node.setProperty("hipposys:nodetype", "hippostdpubwf:document");
      }
    }
  } 
});
origin: apache/jackrabbit-oak

Node defineStandardPropertyIndex(Session session) throws Exception {
  Node index = new OakIndexUtils.PropertyIndex().property(INDEXED_PROPERTY).create(session);
  if (index == null) {
    throw new RuntimeException(
      "Error while creating the index definition. index node is null.");
  }
  if (!PropertyIndexEditorProvider.TYPE.equals(index.getProperty(
    IndexConstants.TYPE_PROPERTY_NAME).getString())) {
    throw new RuntimeException("The type of the index does not match the expected");
  }
  session.save();
  return index;
}
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 testCreatingAnExistingNodeDataDoesNotFail() throws Exception {
  Node content = getTestNode();
  Property nodeData = content.setProperty("nd1", "other");
  assertEquals("other", nodeData.getString());
}
origin: apache/jackrabbit-oak

@Test
public void testChangePassword() throws RepositoryException, NotExecutableException {
  try {
    String hash = getNode(user, superuser).getProperty(UserConstants.REP_PASSWORD).getString();
    user.changePassword("changed");
    superuser.save();
    assertFalse(hash.equals(getNode(user, superuser).getProperty(UserConstants.REP_PASSWORD).getString()));
  } catch (Exception e) {
    // success
  }
}
origin: org.chromattic/chromattic.core

public void testRemoveWithInvalidArg() throws Exception {
 cNode.setProperty("foo", "foo_value");
 Map<String, Object> props = c.getProperties();
 props.remove("foo");
 assertEquals("foo_value", cNode.getProperty("foo").getString());
}
origin: apache/jackrabbit

/**
 * Test the persistence of a property modified with a String parameter and
 * saved from the Session Requires a single-value String (PROP_VALUE_2)
 */
public void testStringSession() throws RepositoryException {
  property1.setValue(PROP_VALUE_2);
  superuser.save();
  assertEquals("String node property not saved", PROP_VALUE_2, property1.getString());
}
origin: info.magnolia/magnolia-4-5-migration

/**
 * Replace a Property value.
 */
public static void updatePropertyIfExist(Node node, String propertyName, String oldValue, String newValue) throws RepositoryException {
  if(node.hasProperty(propertyName) && oldValue.equals(node.getProperty(propertyName).getString())){
    node.setProperty(propertyName, newValue);
   }
}
origin: info.magnolia/magnolia-core

@Test
public void testDoNotUpdateLastModifiedWhenUpdateLastAccess() throws Exception {
  // GIVEN
  Node testUser = session.getNode("/admin/test");
  String lastModify = testUser.getProperty("mgnl:lastModified").getString();
  // WHEN
  um.updateLastAccessTimestamp(um.newUserInstance(testUser));
  // THEN
  assertNotEquals(StringUtils.EMPTY, testUser.getProperty("lastaccess").getString());
  assertEquals(lastModify, testUser.getProperty("mgnl:lastModified").getString());
}
origin: info.magnolia/magnolia-core

@Test
public void testSettingAnExistingNodeData() throws Exception {
  Node content = getTestNode();
  // this should not fail
  Value value = createValue("test");
  Property nodeData = content.setProperty("nd1", value);
  assertEquals("test", nodeData.getString());
}
origin: apache/jackrabbit-oak

@Test
public void testChangePasswordWithOldPassword() throws RepositoryException, NotExecutableException {
  try {
    String hash = getNode(user, superuser).getProperty(UserConstants.REP_PASSWORD).getString();
    user.changePassword("changed", testPw);
    superuser.save();
    assertFalse(hash.equals(getNode(user, superuser).getProperty(UserConstants.REP_PASSWORD).getString()));
  } finally {
    user.changePassword(testPw);
    superuser.save();
  }
}
origin: info.magnolia/magnolia-core

/**
 * Returns the latest activated version name or null if the version name isn't set.
 */
public static String getLastActivatedVersion(Node node) throws RepositoryException {
  return node.hasProperty(LAST_ACTIVATED_VERSION) ? node.getProperty(LAST_ACTIVATED_VERSION).getString() : null;
}
origin: apache/jackrabbit

@SuppressWarnings("deprecation")
public void testRestoreRemoved() throws RepositoryException {
  Node parent = versionableNode.getParent();
  String oldName = versionableNode.getName();
  Version v1 = versionableNode.checkin();
  versionableNode.remove();
  versionableNode = null;
  parent.getSession().save();
  parent.restore(v1, oldName, true);
  versionableNode = parent.getNode(oldName);
  String value = versionableNode.getProperty(propertyName1).getString();
  assertEquals("Restoring a node must set the correct property.", propertyValue2, value);
}
origin: apache/jackrabbit

public void testRemovedProperty() throws RepositoryException, LockException, ConstraintViolationException, VersionException {
  Property p = testRootNode.setProperty(propertyName1, testValue);
  testRootNode.save();
  p.remove();
  testRootNode.refresh(false);
  // Property p must be reverted to 'existing' -> getString must succeed.
  p.getString();
  // similarly accessing the property again must succeed.
  testRootNode.getProperty(propertyName1);
}
origin: org.onehippo.cms7/hippo-repository-deprecated-updater-module

  @Override
  protected void leaving(Node node, int level) throws RepositoryException {
    if (node.hasProperty("hipposys:value")
        && node.getProperty("hipposys:value").getString().equals("hippo:facetsubsearch")) {
      node.setProperty("hipposys:value", "hipposys:facetsubsearch");
    }
  }
});
origin: info.magnolia/magnolia-core

@Test
public void testNodeFromStringAndObjectArray() throws Exception {
  // GIVEN
  Object[][] data = new String[][]{{"a", "a-value"}};
  // WHEN
  Node result = NodeTestUtil.createNode("root", data);
  // THEN
  assertEquals("root", result.getName());
  assertEquals("a-value", result.getProperty("a").getString());
}
origin: info.magnolia/magnolia-core

@Test
public void doNotOverride() throws Exception {
  // GIVEN
  sessionConfig.getRootNode().addNode("someSrcNode").setProperty("someProperty", "somePropertyValue");
  sessionConfig.getRootNode().addNode("someDestNode").setProperty("someProperty", "someOldValue");
  Task task = new CopyPropertyTask("name", RepositoryConstants.CONFIG, "/someSrcNode", "/someDestNode", "someProperty", false);
  // WHEN
  task.execute(installContext);
  // THEN
  assertTrue(sessionConfig.propertyExists("/someSrcNode/someProperty"));
  assertEquals("someOldValue", sessionConfig.getProperty("/someDestNode/someProperty").getString());
}
origin: info.magnolia/magnolia-core

/**
 * Returns the comment set when then node was last versioned or null if no comment has been set.
 */
public static String getComment(Node node) throws RepositoryException {
  return node.hasProperty(COMMENT) ? node.getProperty(COMMENT).getString() : null;
}
origin: apache/jackrabbit

public void testRestoreRemovedJcr2() throws RepositoryException {
  String path = versionableNode.getPath();
  Version v1 = versionManager.checkin(path);
  versionableNode.remove();
  versionableNode = null;
  superuser.save();
  versionManager.restore(path, v1, true);
  versionableNode = superuser.getNode(path);
  String value = versionableNode.getProperty(propertyName1).getString();
  assertEquals("Restoring a node must set the correct property.", propertyValue2, value);
}
javax.jcrPropertygetString

Javadoc

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

Popular methods of Property

  • 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.
  • getDate
    Returns a Calendar representation of the value of this property. A shortcut for Property.getValue()
  • 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

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • putExtra (Intent)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Permission (java.security)
    Legacy security code; do not use.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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