private Content getByPath( final ContentPath contentPath ) { try { return this.contentService.getByPath( contentPath ); } catch ( ContentNotFoundException e ) { return null; } }
private Content getContentByPath( final ContentPath contentPath ) { try { return this.contentService.getByPath( contentPath ); } catch ( ContentNotFoundException e ) { return null; } }
private Content getByPath( final ContentPath contentPath ) { try { return this.contentService.getByPath( contentPath ); } catch ( ContentNotFoundException e ) { return null; } }
private AttachmentsMapper getByPath( final ContentPath key ) { try { return convert( this.contentService.getByPath( key ) ); } catch ( final ContentNotFoundException e ) { return null; } }
private ByteSource getByPath( final ContentPath key ) { try { return getAttachment( this.contentService.getByPath( key ), this.name ); } catch ( final ContentNotFoundException e ) { return null; } }
private ContentMapper getByPath( final ContentPath key ) { try { return convert( this.contentService.getByPath( key ) ); } catch ( final ContentNotFoundException e ) { return null; } }
private PropertyTreeMapper getByPath( final ContentPath contentPath ) { try { final Content content = this.contentService.getByPath( contentPath ); return getById( content.getId() ); } catch ( final ContentNotFoundException e ) { return null; } }
private SiteMapper getByPath( final ContentPath contentPath ) { try { final Content content = this.contentService.getByPath( contentPath ); return getById( content.getId() ); } catch ( final ContentNotFoundException e ) { } return null; }
private ContentId getContentId() { try { if ( this.key.startsWith( "/" ) ) { final Content content = this.contentService.getByPath( ContentPath.from( this.key ) ); if ( content != null ) { return content.getId(); } } else { return ContentId.from( this.key ); } } catch ( final ContentNotFoundException e ) { LOG.warn( "Content not found: " + this.key ); } return null; }
private Content getExistingContent( final String key ) { try { if ( !key.startsWith( "/" ) ) { return this.contentService.getById( ContentId.from( key ) ); } else { return this.contentService.getByPath( ContentPath.from( key ) ); } } catch ( final ContentNotFoundException e ) { return null; } }
private Content getContent() { try { if ( this.key.startsWith( "/" ) ) { return this.contentService.getByPath( ContentPath.from( key ) ); } else { return this.contentService.getById( ContentId.from( key ) ); } } catch ( final ContentNotFoundException e ) { // Do nothing } return null; } }
public void execute() { UpdateContentParams updateContent = new UpdateContentParams(); if ( !this.key.startsWith( "/" ) ) { updateContent.contentId( ContentId.from( this.key ) ); } else { final Content contentByPath = this.contentService.getByPath( ContentPath.from( key ) ); updateContent.contentId( contentByPath.getId() ); } BinaryReferences binaryRefs = BinaryReferences.from( Arrays.stream( this.names ).map( BinaryReference::from ).collect( toList() ) ); updateContent.removeAttachments( binaryRefs ); contentService.update( updateContent ); }
public void execute() { UpdateContentParams updateContent = new UpdateContentParams(); if ( !this.key.startsWith( "/" ) ) { updateContent.contentId( ContentId.from( this.key ) ); } else { final Content contentByPath = this.contentService.getByPath( ContentPath.from( key ) ); updateContent.contentId( contentByPath.getId() ); } final CreateAttachment createAttachment = CreateAttachment.create(). name( this.name ). label( this.label ). mimeType( this.mimeType ). byteSource( getData() ). build(); updateContent.createAttachments( CreateAttachments.from( createAttachment ) ); contentService.update( updateContent ); }
final Content sourceContent = contentService.getByPath( sourcePath ); sourceId = sourceContent.getId();