idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
15,600
public long getNodeChangedSize ( String nodePath ) { long nodeDelta = 0 ; Iterator < ChangesItem > changes = iterator ( ) ; while ( changes . hasNext ( ) ) { nodeDelta += changes . next ( ) . getNodeChangedSize ( nodePath ) ; } return nodeDelta ; }
Return changed size for particular node accumulated during some period .
15,601
private boolean checkValueConstraints ( int requiredType , String [ ] constraints , Value value ) { ValueConstraintsMatcher constrMatcher = new ValueConstraintsMatcher ( constraints , locationFactory , dataManager , nodeTypeDataManager ) ; try { return constrMatcher . match ( ( ( BaseValue ) value ) . getInternalData (...
Check value constrains .
15,602
private MembershipType createMembershipType ( Session session , MembershipTypeImpl mt , boolean broadcast ) throws Exception { Node storageTypesNode = utils . getMembershipTypeStorageNode ( session ) ; Node typeNode = storageTypesNode . addNode ( mt . getName ( ) . equals ( MembershipTypeHandler . ANY_MEMBERSHIP_TYPE )...
Persists new membership type object .
15,603
private MembershipType findMembershipType ( Session session , String name ) throws Exception { Node membershipTypeNode ; try { membershipTypeNode = utils . getMembershipTypeNode ( session , name ) ; } catch ( PathNotFoundException e ) { return null ; } MembershipType mt = readMembershipType ( membershipTypeNode ) ; put...
Find membership type .
15,604
private MembershipType removeMembershipType ( Session session , String name , boolean broadcast ) throws RepositoryException , Exception { Node membershipTypeNode = utils . getMembershipTypeNode ( session , name ) ; MembershipType type = readMembershipType ( membershipTypeNode ) ; if ( broadcast ) { preDelete ( type ) ...
Removing membership type and related membership entities .
15,605
private void removeMemberships ( Node membershipTypeNode ) throws Exception { PropertyIterator refTypes = membershipTypeNode . getReferences ( ) ; while ( refTypes . hasNext ( ) ) { Property refTypeProp = refTypes . nextProperty ( ) ; Node refTypeNode = refTypeProp . getParent ( ) ; Node refUserNode = refTypeNode . get...
Removes related membership entity .
15,606
void migrateMembershipType ( Node oldMembershipTypeNode ) throws Exception { MembershipType membershipType = readMembershipType ( oldMembershipTypeNode ) ; if ( findMembershipType ( membershipType . getName ( ) ) != null ) { removeMembershipType ( membershipType . getName ( ) , false ) ; } createMembershipType ( member...
Method for membership type migration .
15,607
private MembershipType saveMembershipType ( Session session , MembershipTypeImpl mType , boolean broadcast ) throws Exception { Node mtNode = getOrCreateMembershipTypeNode ( session , mType ) ; boolean isNew = mtNode . isNew ( ) ; if ( broadcast ) { preSave ( mType , isNew ) ; } String oldType = mtNode . getName ( ) . ...
Persists new membership type entity .
15,608
private Node getOrCreateMembershipTypeNode ( Session session , MembershipTypeImpl mType ) throws Exception { try { return mType . getInternalId ( ) != null ? session . getNodeByUUID ( mType . getInternalId ( ) ) : utils . getMembershipTypeNode ( session , mType . getName ( ) ) ; } catch ( ItemNotFoundException e ) { re...
Creates and returns membership type node . If node already exists it will be returned otherwise the new one will be created .
15,609
private Node createNewMembershipTypeNode ( Session session , MembershipTypeImpl mType ) throws Exception { Node storageTypesNode = utils . getMembershipTypeStorageNode ( session ) ; return storageTypesNode . addNode ( mType . getName ( ) ) ; }
Creates and returns new membership type node .
15,610
private MembershipType readMembershipType ( Node node ) throws Exception { MembershipTypeImpl mt = new MembershipTypeImpl ( ) ; mt . setName ( node . getName ( ) . equals ( JCROrganizationServiceImpl . JOS_MEMBERSHIP_TYPE_ANY ) ? ANY_MEMBERSHIP_TYPE : node . getName ( ) ) ; mt . setInternalId ( node . getUUID ( ) ) ; m...
Reads membership type from the node .
15,611
private void writeMembershipType ( MembershipType membershipType , Node mtNode ) throws Exception { if ( ! mtNode . isNodeType ( "exo:datetime" ) ) { mtNode . addMixin ( "exo:datetime" ) ; } mtNode . setProperty ( MembershipTypeProperties . JOS_DESCRIPTION , membershipType . getDescription ( ) ) ; }
Writes membership type properties to the node .
15,612
private MembershipType getFromCache ( String name ) { return ( MembershipType ) cache . get ( name , CacheType . MEMBERSHIPTYPE ) ; }
Gets membership type from cache .
15,613
private void removeAllRelatedFromCache ( String name ) { cache . remove ( CacheHandler . MEMBERSHIPTYPE_PREFIX + name , CacheType . MEMBERSHIP ) ; }
Removes all related memberships from cache .
15,614
private void moveMembershipsInCache ( String oldType , String newType ) { cache . move ( CacheHandler . MEMBERSHIPTYPE_PREFIX + oldType , CacheHandler . MEMBERSHIPTYPE_PREFIX + newType , CacheType . MEMBERSHIP ) ; }
Moves memberships in cache from old key to new one .
15,615
private void putInCache ( MembershipType mt ) { cache . put ( mt . getName ( ) , mt , CacheType . MEMBERSHIPTYPE ) ; }
Puts membership type in cache .
15,616
private void preSave ( MembershipType type , boolean isNew ) throws Exception { for ( MembershipTypeEventListener listener : listeners ) { listener . preSave ( type , isNew ) ; } }
Notifying listeners before membership type creation .
15,617
private void postSave ( MembershipType type , boolean isNew ) throws Exception { for ( MembershipTypeEventListener listener : listeners ) { listener . postSave ( type , isNew ) ; } }
Notifying listeners after membership type creation .
15,618
private void preDelete ( MembershipType type ) throws Exception { for ( MembershipTypeEventListener listener : listeners ) { listener . preDelete ( type ) ; } }
Notifying listeners before membership type deletion .
15,619
private void postDelete ( MembershipType type ) throws Exception { for ( MembershipTypeEventListener listener : listeners ) { listener . postDelete ( type ) ; } }
Notifying listeners after membership type deletion .
15,620
public void write ( ObjectWriter out , AccessControlList acl ) throws IOException { out . writeInt ( SerializationConstants . ACCESS_CONTROL_LIST ) ; String owner = acl . getOwner ( ) ; if ( owner != null ) { out . writeByte ( SerializationConstants . NOT_NULL_DATA ) ; out . writeString ( owner ) ; } else { out . write...
Write AccessControlList data .
15,621
private boolean validateRange ( Range range , long contentLength ) { long start = range . getStart ( ) ; long end = range . getEnd ( ) ; if ( start < 0 && end == - 1 ) { if ( ( - 1 * start ) >= contentLength ) { start = 0 ; end = contentLength - 1 ; } else { start = contentLength + start ; end = contentLength - 1 ; } }...
Checks is the range is valid .
15,622
private String generateCacheControl ( Map < MediaType , String > cacheControlMap , String contentType ) { ArrayList < MediaType > mediaTypesList = new ArrayList < MediaType > ( cacheControlMap . keySet ( ) ) ; Collections . sort ( mediaTypesList , MediaTypeHelper . MEDIA_TYPE_COMPARATOR ) ; String cacheControlValue = "...
Generates the value of Cache - Control header according to the content type .
15,623
public void internalRemoveWorkspace ( final String workspaceName ) throws RepositoryException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; final WorkspaceContainer workspaceContainer = repositoryContainer . getWorkspaceContainer ( workspaceName ) ; try { Secur...
Internal Remove Workspace .
15,624
SessionImpl internalLogin ( ConversationState state , String workspaceName ) throws LoginException , NoSuchWorkspaceException , RepositoryException { if ( workspaceName == null ) { workspaceName = config . getDefaultWorkspaceName ( ) ; if ( workspaceName == null ) { throw new NoSuchWorkspaceException ( "Both workspace ...
Internal login .
15,625
public void write ( ObjectWriter out , ItemState itemState ) throws IOException { out . writeInt ( SerializationConstants . ITEM_STATE ) ; out . writeInt ( itemState . getState ( ) ) ; out . writeBoolean ( itemState . isPersisted ( ) ) ; out . writeBoolean ( itemState . isEventFire ( ) ) ; if ( itemState . getOldPath (...
Write item state into file .
15,626
public String getAsString ( boolean showIndex ) { if ( showIndex ) { if ( cachedToStringShowIndex != null ) { return cachedToStringShowIndex ; } } else { if ( cachedToString != null ) { return cachedToString ; } } String res ; if ( showIndex ) { res = super . getAsString ( ) + QPath . PREFIX_DELIMITER + getIndex ( ) ; ...
Return entry textual representation .
15,627
private List < NodeTypeData > registerListOfNodeTypes ( final List < NodeTypeData > nodeTypes , final int alreadyExistsBehaviour ) throws RepositoryException { nodeTypeDataValidator . validateNodeType ( nodeTypes ) ; nodeTypeRepository . registerNodeType ( nodeTypes , this , accessControlPolicy , alreadyExistsBehaviour...
Registers the provided node types
15,628
public Query rewrite ( IndexReader reader ) throws IOException { if ( transform == TRANSFORM_NONE ) { Query stdRangeQueryImpl = new TermRangeQuery ( lowerTerm . field ( ) , lowerTerm . text ( ) , upperTerm . text ( ) , inclusive , inclusive ) ; try { stdRangeQuery = stdRangeQueryImpl . rewrite ( reader ) ; return stdRa...
Tries to rewrite this query into a standard lucene RangeQuery . This rewrite might fail with a TooManyClauses exception . If that happens we use our own implementation .
15,629
public static void start ( final Cache < Serializable , Object > cache ) { PrivilegedAction < Object > action = new PrivilegedAction < Object > ( ) { public Object run ( ) { cache . start ( ) ; return null ; } } ; SecurityHelper . doPrivilegedAction ( action ) ; }
Start Infinispan cache in privileged mode .
15,630
public static Object put ( final Cache < Serializable , Object > cache , final Serializable key , final Object value , final long lifespan , final TimeUnit unit ) { PrivilegedAction < Object > action = new PrivilegedAction < Object > ( ) { public Object run ( ) { return cache . put ( key , value , lifespan , unit ) ; }...
Put in Infinispan cache in privileged mode .
15,631
public Response lock ( Session session , String path , HierarchicalProperty body , Depth depth , String timeout ) { boolean bodyIsEmpty = ( body == null ) ; String lockToken ; if ( isReadOnly ( session , path ) ) { return Response . status ( HTTPStatus . METHOD_NOT_ALLOWED ) . entity ( "Permission denied" ) . build ( )...
Webdav Lock comand implementation .
15,632
private StreamingOutput body ( WebDavNamespaceContext nsContext , LockRequestEntity input , Depth depth , String lockToken , String lockOwner , String timeout ) { return new LockResultResponseEntity ( nsContext , lockToken , lockOwner , timeout ) ; }
Writes response body into the stream .
15,633
private boolean isReadOnly ( Session session , String path ) { try { session . checkPermission ( path , PermissionType . SET_PROPERTY ) ; return false ; } catch ( AccessControlException e ) { return true ; } catch ( RepositoryException e ) { return false ; } }
Check node permission
15,634
public String dump ( ) throws RepositoryException { StringBuilder tmp = new StringBuilder ( ) ; QueryTreeDump . dump ( this , tmp ) ; return tmp . toString ( ) ; }
Dumps this QueryNode and its child nodes to a String .
15,635
public Query createQuery ( SessionImpl session , SessionDataManager sessionDataManager , Node node ) throws InvalidQueryException , RepositoryException { AbstractQueryImpl query = createQueryInstance ( ) ; query . init ( session , sessionDataManager , handler , node ) ; return query ; }
Creates a query object from a node that can be executed on the workspace .
15,636
public Query createQuery ( SessionImpl session , SessionDataManager sessionDataManager , String statement , String language ) throws InvalidQueryException , RepositoryException { AbstractQueryImpl query = createQueryInstance ( ) ; query . init ( session , sessionDataManager , handler , statement , language ) ; return q...
Creates a query object that can be executed on the workspace .
15,637
public void checkIndex ( final InspectionReport report , final boolean isSystem ) throws RepositoryException , IOException { if ( isSuspended . get ( ) ) { try { SecurityHelper . doPrivilegedExceptionAction ( new PrivilegedExceptionAction < Object > ( ) { public Object run ( ) throws RepositoryException , IOException {...
Check index consistency . Iterator goes through index documents and check does each document have according jcr - node . If index is suspended then it will be temporary resumed while check is running and suspended afterwards .
15,638
public Set < String > getNodesByUri ( final String uri ) throws RepositoryException { Set < String > result ; final int defaultClauseCount = BooleanQuery . getMaxClauseCount ( ) ; try { final ValueFactoryImpl valueFactory = new ValueFactoryImpl ( new LocationFactory ( nsReg ) , cleanerHolder ) ; BooleanQuery . setMaxCl...
Return set of uuid of nodes . Contains in names prefixes maped to the given uri
15,639
protected String getIndexDirParam ( ) throws RepositoryConfigurationException { String dir = config . getParameterValue ( QueryHandlerParams . PARAM_INDEX_DIR , null ) ; if ( dir == null ) { LOG . warn ( QueryHandlerParams . PARAM_INDEX_DIR + " parameter not found. Using outdated parameter name " + QueryHandlerParams ....
^ Returns index - dir parameter from configuration .
15,640
@ SuppressWarnings ( "unchecked" ) protected IndexerChangesFilter initializeChangesFilter ( ) throws RepositoryException , RepositoryConfigurationException { IndexerChangesFilter newChangesFilter = null ; Class < ? extends IndexerChangesFilter > changesFilterClass = DefaultChangesFilter . class ; String changesFilterCl...
Initialize changes filter .
15,641
protected void initializeQueryHandler ( ) throws RepositoryException , RepositoryConfigurationException { String className = config . getType ( ) ; if ( className == null ) { throw new RepositoryConfigurationException ( "Content hanler configuration fail" ) ; } try { Class < ? > qHandlerClass = ClassLoading . for...
Initializes the query handler .
15,642
public void setOnline ( boolean isOnline , boolean allowQuery , boolean dropStaleIndexes ) throws IOException { handler . setOnline ( isOnline , allowQuery , dropStaleIndexes ) ; }
Switches index into corresponding ONLINE or OFFLINE mode . Offline mode means that new indexing data is collected but index is guaranteed to be unmodified during offline state . Passing the allowQuery flag can allow or deny performing queries on index during offline mode . AllowQuery is not used when setting index back...
15,643
public CompletableFuture < Boolean > reindexWorkspace ( final boolean dropExisting , int nThreads ) throws IllegalStateException { if ( handler == null || handler . getIndexerIoModeHandler ( ) == null || changesFilter == null ) { throw new IllegalStateException ( "Index might have not been initialized yet." ) ; } if ( ...
Perform hot reindexing of the workspace
15,644
private void cleanIndexDirectory ( String path ) throws IOException { SecurityHelper . doPrivilegedIOExceptionAction ( ( PrivilegedExceptionAction < Void > ) ( ) -> { File newIndexFolder = new File ( path ) ; if ( newIndexFolder . exists ( ) ) { DirectoryHelper . removeDirectory ( newIndexFolder ) ; } return null ; } )...
remove index directory if exist
15,645
protected void postInit ( Connection connection ) throws SQLException { String select = "select * from " + DBInitializerHelper . getItemTableName ( containerConfig ) + " where ID='" + Constants . ROOT_PARENT_UUID + "' and PARENT_ID='" + Constants . ROOT_PARENT_UUID + "'" ; if ( ! connection . createStatement ( ) . exec...
Init root node parent record .
15,646
private static Field . Index getIndexParameter ( int flags ) { if ( ( flags & INDEXED_FLAG ) == 0 ) { return Field . Index . NO ; } else if ( ( flags & TOKENIZED_FLAG ) > 0 ) { return Field . Index . ANALYZED ; } else { return Field . Index . NOT_ANALYZED ; } }
Returns the index parameter extracted from the flags .
15,647
private static Field . Store getStoreParameter ( int flags ) { if ( ( flags & STORED_FLAG ) > 0 ) { return Field . Store . YES ; } else { return Field . Store . NO ; } }
Returns the store parameter extracted from the flags .
15,648
private static Field . TermVector getTermVectorParameter ( int flags ) { if ( ( ( flags & STORE_POSITION_WITH_TERM_VECTOR_FLAG ) > 0 ) && ( ( flags & STORE_OFFSET_WITH_TERM_VECTOR_FLAG ) > 0 ) ) { return Field . TermVector . WITH_POSITIONS_OFFSETS ; } else if ( ( flags & STORE_POSITION_WITH_TERM_VECTOR_FLAG ) > 0 ) { r...
Returns the term vector parameter extracted from the flags .
15,649
private void addNamespace ( String prefix , String uri ) { prefixToURI . put ( prefix , uri ) ; uriToPrefix . put ( uri , prefix ) ; }
Adds the given namespace declaration to this resolver .
15,650
public Response versionControl ( Session session , String path ) { try { Node node = ( Node ) session . getItem ( path ) ; if ( ! node . isNodeType ( "mix:versionable" ) ) { node . addMixin ( "mix:versionable" ) ; session . save ( ) ; } return Response . ok ( ) . build ( ) ; } catch ( LockException exc ) { return Respo...
Webdav Version - Control method implementation .
15,651
public byte [ ] generateLinkContent ( ) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; for ( int i = 0 ; i < linkHeader . length ; i ++ ) { byte curByteValue = ( byte ) linkHeader [ i ] ; outStream . write ( curByteValue ) ; } byte [ ] linkContent = getLinkContent ( ) ; writeInt ...
Generates the content of link .
15,652
private byte [ ] getLinkContent ( ) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; byte [ ] firstItem = getFirstItem ( ) ; writeInt ( firstItem . length + 2 , outStream ) ; writeBytes ( firstItem , outStream ) ; byte [ ] lastItem = getLastItem ( ) ; writeInt ( lastItem . length +...
Gets the content of the link .
15,653
private byte [ ] getFirstItem ( ) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; int [ ] firstItem = { 0x1F , 0x50 , 0xE0 , 0x4F , 0xD0 , 0x20 , 0xEA , 0x3A , 0x69 , 0x10 , 0xA2 , 0xD8 , 0x08 , 0x00 , 0x2B , 0x30 , 0x30 , 0x9D , } ; writeInts ( firstItem , outStream ) ; return ou...
Returns the first item .
15,654
private byte [ ] getLastItem ( ) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; int [ ] lastItem = { 0x2E , 0x80 , 0x00 , 0xDF , 0xEA , 0xBD , 0x65 , 0xC2 , 0xD0 , 0x11 , 0xBC , 0xED , 0x00 , 0xA0 , 0xC9 , 0x0A , 0xB5 , 0x0F } ; writeInts ( lastItem , outStream ) ; return outStre...
Returns the last item .
15,655
private byte [ ] getRootValue ( String rootName ) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; simpleWriteString ( rootName , outStream ) ; int [ ] rootVal = { 0x20 , 0x00 , 0x3D , 0x04 , 0x30 , 0x04 , 0x20 , 0x00 } ; writeInts ( rootVal , outStream ) ; simpleWriteString ( host...
Returns the root value .
15,656
private void writeZeroString ( String outString , OutputStream outStream ) throws IOException { simpleWriteString ( outString , outStream ) ; outStream . write ( 0 ) ; outStream . write ( 0 ) ; }
Writes zero - string into stream .
15,657
private void writeInt ( int intValue , OutputStream outStream ) throws IOException { outStream . write ( intValue & 0xFF ) ; outStream . write ( ( intValue >> 8 ) & 0xFF ) ; }
Writes int into stream .
15,658
private void writeInts ( int [ ] bytes , OutputStream outStream ) throws IOException { for ( int i = 0 ; i < bytes . length ; i ++ ) { byte curByte = ( byte ) bytes [ i ] ; outStream . write ( curByte ) ; } }
Writes int array into stream .
15,659
private void commitPending ( ) throws IOException { if ( pending . isEmpty ( ) ) { return ; } super . addDocuments ( ( Document [ ] ) pending . values ( ) . toArray ( new Document [ pending . size ( ) ] ) ) ; pending . clear ( ) ; aggregateIndexes . clear ( ) ; }
Commits pending documents to the index .
15,660
public Query rewrite ( IndexReader reader ) throws IOException { @ SuppressWarnings ( "serial" ) Query stdWildcardQuery = new MultiTermQuery ( ) { protected FilteredTermEnum getEnum ( IndexReader reader ) throws IOException { return new WildcardTermEnum ( reader , field , propName , pattern , transform ) ; } public Str...
Either rewrites this query to a lucene MultiTermQuery or in case of a TooManyClauses exception to a custom jackrabbit query implementation that uses a BitSet to collect all hits .
15,661
public BaseXmlExporter getExportVisitor ( XmlMapping type , OutputStream stream , boolean skipBinary , boolean noRecurse , boolean exportChildVersionHistory , ItemDataConsumer dataManager , NamespaceRegistry namespaceRegistry , ValueFactoryImpl systemValueFactory ) throws NamespaceException , RepositoryException , IOEx...
Create export visitor for given type of view . \
15,662
protected JCRPathMatcher parsePathMatcher ( LocationFactory locFactory , String path ) throws RepositoryException { JCRPath knownPath = null ; boolean forDescendants = false ; boolean forAncestors = false ; if ( path . equals ( "*" ) || path . equals ( ".*" ) ) { forDescendants = true ; forAncestors = true ; } else if ...
Parses JCR path matcher from string .
15,663
public boolean checkedOut ( ) throws UnsupportedRepositoryOperationException , RepositoryException { NodeData vancestor = getVersionableAncestor ( ) ; if ( vancestor != null ) { PropertyData isCheckedOut = ( PropertyData ) dataManager . getItemData ( vancestor , new QPathEntry ( Constants . JCR_ISCHECKEDOUT , 1 ) , Ite...
Tell if this node or its nearest versionable ancestor is checked - out .
15,664
private void doAddMixin ( NodeTypeData type ) throws NoSuchNodeTypeException , ConstraintViolationException , VersionException , LockException , RepositoryException { InternalQName [ ] mixinTypes = nodeData ( ) . getMixinTypeNames ( ) ; List < InternalQName > newMixin = new ArrayList < InternalQName > ( mixinTypes . le...
Internal method to add mixin Nodetype to the Node .
15,665
protected NodeData getCorrespondingNodeData ( SessionImpl corrSession ) throws ItemNotFoundException , AccessDeniedException , RepositoryException { final QPath myPath = nodeData ( ) . getQPath ( ) ; final SessionDataManager corrDataManager = corrSession . getTransientNodesManager ( ) ; if ( this . isNodeType ( Constan...
Return Node corresponding to this Node .
15,666
public String [ ] getMixinTypeNames ( ) throws RepositoryException { NodeType [ ] mixinTypes = getMixinNodeTypes ( ) ; String [ ] mtNames = new String [ mixinTypes . length ] ; for ( int i = 0 ; i < mtNames . length ; i ++ ) { mtNames [ i ] = mixinTypes [ i ] . getName ( ) ; } return mtNames ; }
Return mixin Nodetype names .
15,667
private void initDefinition ( NodeData parent ) throws RepositoryException , ConstraintViolationException { if ( this . isRoot ( ) ) { this . definition = new NodeDefinitionData ( null , null , true , true , OnParentVersionAction . ABORT , true , new InternalQName [ ] { Constants . NT_BASE } , null , false ) ; return ;...
Init NodeDefinition .
15,668
public VersionHistoryImpl versionHistory ( boolean pool ) throws UnsupportedRepositoryOperationException , RepositoryException { if ( ! this . isNodeType ( Constants . MIX_VERSIONABLE ) ) { throw new UnsupportedRepositoryOperationException ( "Node is not mix:versionable " + getPath ( ) ) ; } PropertyData vhProp = ( Pro...
For internal use . Doesn t check the InvalidItemStateException and may return unpooled VersionHistory object .
15,669
private List < PropertyData > childPropertiesData ( ) throws RepositoryException , AccessDeniedException { List < PropertyData > storedProps = new ArrayList < PropertyData > ( dataManager . getChildPropertiesData ( nodeData ( ) ) ) ; Collections . sort ( storedProps , new PropertiesDataOrderComparator < PropertyData > ...
Return child Properties list .
15,670
private List < NodeData > childNodesData ( ) throws RepositoryException , AccessDeniedException { List < NodeData > storedNodes = new ArrayList < NodeData > ( dataManager . getChildNodesData ( nodeData ( ) ) ) ; Collections . sort ( storedNodes , new NodeDataOrderComparator ( ) ) ; return storedNodes ; }
Return child Nodes list .
15,671
private int getNextChildIndex ( InternalQName nameToAdd , InternalQName primaryTypeName , NodeData parentNode , NodeDefinitionData def ) throws RepositoryException , ItemExistsException { boolean allowSns = def . isAllowsSameNameSiblings ( ) ; int ind = 1 ; boolean hasSibling = dataManager . hasItemData ( parentNode , ...
Calculates next child node index . Is used existed node definition if no - get one based on node name and node type .
15,672
protected boolean accept ( Node node ) { try { return status == UserStatus . ANY || status . matches ( node . canAddMixin ( JCROrganizationServiceImpl . JOS_DISABLED ) ) ; } catch ( RepositoryException e ) { if ( LOG . isDebugEnabled ( ) ) { String path = "unknown" ; try { path = node . getPath ( ) ; } catch ( Reposito...
Tests whether or not the specified node should be included in the node list .
15,673
public String getPositionSegment ( ) { HierarchicalProperty position = member . getChild ( new QName ( "DAV:" , "position" ) ) ; return position . getChild ( 0 ) . getChild ( new QName ( "DAV:" , "segment" ) ) . getValue ( ) ; }
Position segment getter .
15,674
public Response copy ( Session destSession , String sourcePath , String destPath ) { try { Workspace workspace = destSession . getWorkspace ( ) ; workspace . copy ( sourcePath , destPath ) ; if ( itemExisted ) { return Response . noContent ( ) . build ( ) ; } else { if ( uriBuilder != null ) { return Response . created...
Webdav COPY method implementation for the same workspace .
15,675
public void execute ( ) throws IOException { Runtime run = Runtime . getRuntime ( ) ; try { String command ; if ( excludeDir != null && ! excludeDir . isEmpty ( ) ) { command = "rsync -rv --delete --exclude " + excludeDir + " " + src + " " + dst ; } else { command = "rsync -rv --delete " + src + " " + dst ; } if ( LOG ...
Executes RSYNC synchronization job
15,676
private List < ValueData > parseValues ( ) throws RepositoryException { List < ValueData > values = new ArrayList < ValueData > ( propertyInfo . getValuesSize ( ) ) ; List < String > stringValues = new ArrayList < String > ( ) ; for ( int k = 0 ; k < propertyInfo . getValuesSize ( ) ; k ++ ) { if ( propertyInfo . getTy...
Returns the list of ValueData for current property
15,677
protected String getAttribute ( Map < String , String > attributes , InternalQName name ) throws RepositoryException { JCRName jname = locationFactory . createJCRName ( name ) ; return attributes . get ( jname . getAsString ( ) ) ; }
Returns the value of the named XML attribute .
15,678
protected void suspendRepository ( ) throws RepositoryException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; repository . setState ( ManageableRepository . SUSPENDED ) ; }
Suspend repository which means that allow only read operations . All writing threads will wait until resume operations invoked .
15,679
protected void resumeRepository ( ) throws RepositoryException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; repository . setState ( ManageableRepository . ONLINE ) ; }
Resume repository . All previously suspended threads continue working .
15,680
public static long getLength ( ValueData value , int propType ) { if ( propType == PropertyType . BINARY ) { return value . getLength ( ) ; } else if ( propType == PropertyType . NAME || propType == PropertyType . PATH ) { return - 1 ; } else { return value . toString ( ) . length ( ) ; } }
Returns length of the internal value .
15,681
public void recreateEntry ( final SessionProvider sessionProvider , final String groupPath , final RegistryEntry entry ) throws RepositoryException { final String entryRelPath = EXO_REGISTRY + "/" + groupPath + "/" + entry . getName ( ) ; final String parentFullPath = "/" + EXO_REGISTRY + "/" + groupPath ; try { Sessio...
Re - creates an entry in the group .
15,682
public void initRegistryEntry ( String groupName , String entryName ) throws RepositoryException , RepositoryConfigurationException { String relPath = EXO_REGISTRY + "/" + groupName + "/" + entryName ; for ( RepositoryEntry repConfiguration : repConfigurations ( ) ) { String repName = repConfiguration . getName ( ) ; S...
Initializes the registry entry
15,683
public boolean getForceXMLConfigurationValue ( InitParams initParams ) { ValueParam valueParam = initParams . getValueParam ( "force-xml-configuration" ) ; return ( valueParam != null ? Boolean . valueOf ( valueParam . getValue ( ) ) : false ) ; }
Get value of force - xml - configuration param .
15,684
private void checkGroup ( final SessionProvider sessionProvider , final String groupPath ) throws RepositoryException { String [ ] groupNames = groupPath . split ( "/" ) ; String prefix = "/" + EXO_REGISTRY ; Session session = session ( sessionProvider , repositoryService . getCurrentRepository ( ) ) ; for ( String nam...
check if group exists and creates one if necessary
15,685
private PlainChangesLog makeAutoCreatedItems ( final NodeData parent , final InternalQName nodeTypeName , final ItemDataConsumer targetDataManager , final String owner , boolean addedAutoCreatedNodes ) throws RepositoryException { final PlainChangesLogImpl changes = new PlainChangesLogImpl ( ) ; final NodeTypeData type...
Prepares changes log
15,686
@ Produces ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/repository-service-configuration" ) public Response getRepositoryServiceConfiguration ( ) { RepositoryServiceConfiguration configuration = repositoryService . getConfig ( ) ; RepositoryServiceConf conf = new RepositoryServiceConf...
Gives the repository service configuration which is composed of the configuration of all the repositories and workspaces
15,687
@ Produces ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/default-ws-config/{repositoryName}" ) public Response getDefaultWorkspaceConfig ( @ PathParam ( "repositoryName" ) String repositoryName ) { String errorMessage = new String ( ) ; Status status ; try { String defaultWorkspaceName...
Gives the configuration of the default workspace of the given repository
15,688
@ Produces ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/repositories" ) public Response getRepositoryNames ( ) { List < String > repositories = new ArrayList < String > ( ) ; for ( RepositoryEntry rEntry : repositoryService . getConfig ( ) . getRepositoryConfigurations ( ) ) { reposit...
Gives the name of all the existing repositories .
15,689
@ Produces ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/workspaces/{repositoryName}" ) public Response getWorkspaceNames ( @ PathParam ( "repositoryName" ) String repositoryName ) { String errorMessage = new String ( ) ; Status status ; try { List < String > workspaces = new ArrayList...
Gives the name of all the existing workspaces for a given repository .
15,690
@ Consumes ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/update-workspace-config/{repositoryName}/{workspaceName}" ) public Response updateWorkspaceConfiguration ( @ PathParam ( "repositoryName" ) String repositoryName , @ PathParam ( "workspaceName" ) String workspaceName , WorkspaceE...
Updates the configuration of a given workspace .
15,691
private String setProperty ( Node node , HierarchicalProperty property ) { String propertyName = WebDavNamespaceContext . createName ( property . getName ( ) ) ; if ( READ_ONLY_PROPS . contains ( property . getName ( ) ) ) { return WebDavConst . getStatusDescription ( HTTPStatus . CONFLICT ) ; } try { Workspace ws = no...
Sets changes the property value .
15,692
private String removeProperty ( Node node , HierarchicalProperty property ) { try { node . getProperty ( property . getStringName ( ) ) . remove ( ) ; node . save ( ) ; return WebDavConst . getStatusDescription ( HTTPStatus . OK ) ; } catch ( AccessDeniedException e ) { return WebDavConst . getStatusDescription ( HTTPS...
Removes the property .
15,693
public Response head ( Session session , String path , String baseURI ) { try { Node node = ( Node ) session . getItem ( path ) ; WebDavNamespaceContext nsContext = new WebDavNamespaceContext ( session ) ; URI uri = new URI ( TextUtil . escape ( baseURI + node . getPath ( ) , '%' , true ) ) ; if ( ResourceUtil . isFile...
Webdav Head method implementation .
15,694
public void remove ( ItemState item ) { if ( item . isNode ( ) ) { remove ( item . getData ( ) . getQPath ( ) ) ; } else { removeProperty ( item , - 1 ) ; } }
Removes the property or node and all descendants from the log
15,695
public void remove ( QPath rootPath ) { for ( int i = items . size ( ) - 1 ; i >= 0 ; i -- ) { ItemState item = items . get ( i ) ; QPath qPath = item . getData ( ) . getQPath ( ) ; if ( qPath . isDescendantOf ( rootPath ) || item . getAncestorToSave ( ) . isDescendantOf ( rootPath ) || item . getAncestorToSave ( ) . e...
Removes the item at the rootPath and all descendants from the log
15,696
private void removeNode ( ItemState item , int indexItem ) { items . remove ( indexItem ) ; index . remove ( item . getData ( ) . getIdentifier ( ) ) ; index . remove ( item . getData ( ) . getQPath ( ) ) ; index . remove ( new ParentIDQPathBasedKey ( item ) ) ; index . remove ( new IDStateBasedKey ( item . getData ( )...
Removes the node from the log
15,697
private void removeProperty ( ItemState item , int indexItem ) { if ( indexItem == - 1 ) { items . remove ( item ) ; } else { items . remove ( indexItem ) ; } index . remove ( item . getData ( ) . getIdentifier ( ) ) ; index . remove ( item . getData ( ) . getQPath ( ) ) ; index . remove ( new ParentIDQPathBasedKey ( i...
Removes the property from the log
15,698
public Collection < ItemState > getLastChildrenStates ( ItemData rootData , boolean forNodes ) { Map < String , ItemState > children = forNodes ? lastChildNodeStates . get ( rootData . getIdentifier ( ) ) : lastChildPropertyStates . get ( rootData . getIdentifier ( ) ) ; return children == null ? new ArrayList < ItemSt...
Collect last in ChangesLog order item child changes .
15,699
public ItemState getLastState ( ItemData item , boolean forNode ) { Map < String , ItemState > children = forNode ? lastChildNodeStates . get ( item . getParentIdentifier ( ) ) : lastChildPropertyStates . get ( item . getParentIdentifier ( ) ) ; return children == null ? null : children . get ( item . getIdentifier ( )...
Return the last item state from ChangesLog .