Codota Logo
ContentPath
Code IndexAdd Codota to your IDE (free)

How to use
ContentPath
in
com.enonic.xp.content

Best Java code snippets using com.enonic.xp.content.ContentPath (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: com.enonic.xp/core-api

public BUILDER path( final ContentPath path )
{
  this.parentPath = path.getParentPath() != null ? path.getParentPath().asAbsolute() : null;
  Preconditions.checkArgument( path.elementCount() > 0, "No content can be \"root content\": " + path.toString() );
  this.name = ContentName.from( path.getElement( path.elementCount() - 1 ) );
  return (BUILDER) this;
}
origin: com.enonic.xp/core-api

  @Override
  public ContentPath apply( final String value )
  {
    return ContentPath.from( value );
  }
}
origin: com.enonic.xp/core-api

@Override
public boolean equals( final Object o )
{
  if ( this == o )
  {
    return true;
  }
  if ( !( o instanceof DeleteContentParams ) )
  {
    return false;
  }
  final DeleteContentParams that = (DeleteContentParams) o;
  if ( !contentPath.equals( that.contentPath ) )
  {
    return false;
  }
  return true;
}
origin: com.enonic.xp/core-api

public boolean isChildOf( final ContentPath possibleParentPath )
{
  if ( elementCount() <= possibleParentPath.elementCount() )
  {
    return false;
  }
  for ( int i = 0; i < possibleParentPath.elementCount(); i++ )
  {
    if ( !elements.get( i ).equalsIgnoreCase( possibleParentPath.getElement( i ) ) )
    {
      return false;
    }
  }
  return true;
}
origin: com.enonic.xp/core-api

private static String getPathStartedSomeLevelsHigher( final Content content, final String path )
{
  int levels = getNumberOfLevelsToAscend( path );
  ContentPath contentPath = content.getPath();
  for ( int level = 1; level <= levels; level++ )
  {
    contentPath = contentPath.getParentPath();
    if ( contentPath.isRoot() )
    {
      return path.substring( levels * 3 );
    }
  }
  return contentPath.toString() + "/" + path.substring( levels * 3 );
}
origin: com.enonic.xp/lib-content

sourcePath = ContentPath.from( this.source );
final Content sourceContent = contentService.getByPath( sourcePath );
sourceId = sourceContent.getId();
return move( sourceId, ContentPath.from( target ).asAbsolute() );
final ContentPath targetPath = ContentPath.from( target );
final ContentPath targetParent = targetPath.getParentPath();
if ( targetParent.equals( sourcePath.getParentPath() ) )
  return rename( sourceId, targetPath.getName() );
return rename( sourceId, targetPath.getName() );
origin: com.enonic.xp/core-api

  private static ContentPath translateNodePathToContentPath( final NodePath nodePath )
  {
    final String contentPath = StringUtils.substringAfter( nodePath.asAbsolute().toString(), CONTENT_ROOT_NODE_NAME + "/" );
    return ContentPath.from( contentPath ).asAbsolute();
  }
}
origin: com.enonic.xp/core-api

public ContentNotFoundException( final ContentPath path, final Branch branch )
{
  super( MessageFormat.format( "Content with path [{0}] was not found in branch [{1}]", path.toString(), branch ) );
  this.path = path;
}
origin: com.enonic.xp/core-api

public static ContentPath from( final ContentPath parent, final ContentPath relative )
{
  final Builder builder = create().elements( parent.elements );
  builder.addElements( relative.elements );
  builder.absolute( parent.isAbsolute() );
  return builder.build();
}
origin: com.enonic.xp/core-api

public ContentPath getAncestorPath( final Integer deep )
{
  if ( this.elements.size() < 1 )
  {
    return null;
  }
  final LinkedList<String> parentElements = newListOfParentElements( deep );
  return parentElements != null ? create().absolute( absolute ).elements( parentElements ).build() : null;
}
origin: com.enonic.xp/core-api

public boolean isRoot()
{
  return this.path.elementCount() == 1;
}
origin: com.enonic.xp/core-api

  public ContentPath build()
  {
    return new ContentPath( this );
  }
}
origin: com.enonic.xp/core-api

public ContentPath getParentPath()
{
  return getAncestorPath(1);
}
origin: com.enonic.xp/core-api

public static ContentPath from( final String path )
{
  final Iterable<String> pathElements = Splitter.on( ELEMENT_DIVIDER ).omitEmptyStrings().split( path );
  boolean absolute = path.startsWith( ELEMENT_DIVIDER );
  return create().elements( pathElements ).absolute( absolute ).build();
}
origin: com.enonic.xp/portal-api

private boolean contentExists( final String contentSelector )
{
  final ContentId contentId = ContentId.from( contentSelector.substring( 1 ) );
  final ContentPath contentPath = ContentPath.from( contentSelector ).asAbsolute();
  return this.contentService.contentExists( contentId ) || this.contentService.contentExists( contentPath );
}
origin: com.enonic.xp/core-api

public ContentAlreadyExistsException( final ContentPath path )
{
  super( MessageFormat.format( "Content at path [{0}] already exists", path.toString() ) );
  this.path = path;
}
origin: com.enonic.xp/core-api

public static ContentPath from( final ContentPath parent, final String name )
{
  return create().elements( parent.elements ).absolute( parent.isAbsolute() ).addElement( name ).build();
}
origin: com.enonic.xp/portal-api

public PortalRequest( final WebRequest webRequest )
{
  super(webRequest);
  this.baseUri = "";
  this.contentPath = ContentPath.from( "/" );
  this.mode = RenderMode.LIVE;
  this.branch = DEFAULT_BRANCH;
}
origin: com.enonic.xp/portal-api

protected final Content getContentOrNull( final String contentSelector )
{
  final boolean inEditMode = ( this.request.getMode() == RenderMode.EDIT );
  if ( inEditMode )
  {
    final ContentId contentId = ContentId.from( contentSelector.substring( 1 ) );
    final Content contentById = getContentById( contentId );
    if ( contentById != null )
    {
      return contentById;
    }
  }
  final ContentPath contentPath = ContentPath.from( contentSelector ).asAbsolute();
  return getContentByPath( contentPath );
}
origin: com.enonic.xp/core-api

private static String resolveSitePath( final String pathExpression, final Site site )
{
  return site != null ? pathExpression.replace( SITE_WILDCARD, site.getPath().toString() ) : pathExpression;
}
com.enonic.xp.contentContentPath

Most used methods

  • asAbsolute
  • from
  • toString
  • equals
  • getParentPath
  • <init>
  • create
  • elementCount
  • getAncestorPath
  • getElement
  • getName
  • hashCode
  • getName,
  • hashCode,
  • isAbsolute,
  • isRelative,
  • isRoot,
  • newListOfParentElements

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now