private EntityReference appendNewReference(EntityReference reference, EntityReference newReference) { if (newReference != null) { if (reference != null) { return reference.appendParent(newReference); } else { return newReference; } } return reference; }
EntityReference parent = getNewEntityReference(entityName.reverse().toString(), entityTypesForType[entityTypeOffset++], parameters); entityReference = entityReference == null ? parent : entityReference.appendParent(parent); EntityReference parent = resolveDefaultReference(entityTypesForType[i], parameters); if (parent != null) { entityReference = entityReference == null ? parent : entityReference.appendParent(parent); } else {
@Override public DocumentReference get() { if (this.cachedReference == null) { EntityReference reference = this.provider.getDefaultReference(EntityType.DOCUMENT); // Add spaces reference = reference.appendParent(this.spaceReferenceProvider.get()); this.cachedReference = this.factory.getReference(new DocumentReference(reference)); } return this.cachedReference; } }
@Override public SpaceReference get() { if (this.cachedReference == null) { EntityReference reference = this.provider.getDefaultReference(EntityType.SPACE); // Add wikis reference = reference.appendParent(this.wikiReferenceProvider.get()); this.cachedReference = this.factory.getReference(new SpaceReference(reference)); } return this.cachedReference; } }
@Override public PageReference get() { if (this.cachedReference == null) { EntityReference reference = this.provider.getDefaultReference(EntityType.PAGE); // Add wiki reference = reference.appendParent(this.wikiReferenceProvider.get()); this.cachedReference = this.factory.getReference(new PageReference(reference)); } return this.cachedReference; } }
resolveDefaultReference(types.get(0), parameters).appendParent(reference.getParent()); normalizedReference = normalizedReference.replaceParent(reference.getParent(), newReference); reference = newReference; normalizedReference = normalizedReference.appendParent(newReference); reference = newReference; } else if (reference.getParent() != null && types.isEmpty()) {
private void setDescriptorDocMetadata(XWikiDocument descriptorDoc) { XWikiContext context = xcontextProvider.get(); // Set the document as hidden descriptorDoc.setHidden(true); // The document must have a creator if (descriptorDoc.getCreatorReference() == null) { descriptorDoc.setCreatorReference(context.getUserReference()); } // The document must have an author if (descriptorDoc.getAuthorReference() == null) { descriptorDoc.setAuthorReference(context.getUserReference()); } // Set the document parent if (descriptorDoc.getParentReference() == null) { EntityReference parentReference = new EntityReference("WebHome", EntityType.DOCUMENT); parentReference.appendParent(new EntityReference("WikiManager", EntityType.SPACE)); descriptorDoc.setParentReference(parentReference); } } }
needsUpdate = true; doc.setParentReference(new EntityReference("XWikiClasses", EntityType.DOCUMENT) .appendParent(new EntityReference("XWiki", EntityType.SPACE)));
evaluatedReference = defaultReference.getParent().appendParent(evaluatedParent);
normalizedReference = resolveDefaultReference(type, parameters).appendParent(normalizedReference);