@Test public void testSetName() throws Exception { String database = this.oldcore.getXWikiContext().getWikiId(); BaseObject baseObject = new BaseObject(); baseObject.setName("space.page"); assertEquals(database, baseObject.getDocumentReference().getWikiReference().getName()); assertEquals("space", baseObject.getDocumentReference().getLastSpaceReference().getName()); assertEquals("page", baseObject.getDocumentReference().getName()); }
@Deprecated @Override public void setName(String name) { DocumentReference reference = getDocumentReference(); if (reference != null) { EntityReference relativeReference = getRelativeEntityReferenceResolver().resolve(name, EntityType.DOCUMENT); reference = new DocumentReference(relativeReference.extractReference(EntityType.DOCUMENT).getName(), new SpaceReference(relativeReference.extractReference(EntityType.SPACE).getName(), reference.getParent().getParent())); } else { reference = getCurrentMixedDocumentReferenceResolver().resolve(name); } setDocumentReference(reference); }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Deprecated @Override public void setName(String name) { DocumentReference reference = getDocumentReference(); if (reference != null) { EntityReference relativeReference = getRelativeEntityReferenceResolver().resolve(name, EntityType.DOCUMENT); reference = new DocumentReference(relativeReference.extractReference(EntityType.DOCUMENT).getName(), new SpaceReference(relativeReference.extractReference(EntityType.SPACE).getName(), reference.getParent().getParent())); } else { reference = getCurrentMixedDocumentReferenceResolver().resolve(name); } setDocumentReference(reference); } }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Deprecated @Override public void setName(String name) { DocumentReference reference = getDocumentReference(); if (reference != null) { EntityReference relativeReference = getRelativeEntityReferenceResolver().resolve(name, EntityType.DOCUMENT); reference = new DocumentReference(relativeReference.extractReference(EntityType.DOCUMENT).getName(), new SpaceReference(relativeReference.extractReference(EntityType.SPACE).getName(), reference.getParent().getParent())); } else { reference = getCurrentMixedDocumentReferenceResolver().resolve(name); } setDocumentReference(reference); }  }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Deprecated @Override public void setName(String name) { DocumentReference reference = getDocumentReference(); if (reference != null) { EntityReference relativeReference = getRelativeEntityReferenceResolver().resolve(name, EntityType.DOCUMENT); reference = new DocumentReference(relativeReference.extractReference(EntityType.DOCUMENT).getName(), new SpaceReference(relativeReference.extractReference(EntityType.SPACE).getName(), reference.getParent().getParent())); } else { reference = getCurrentMixedDocumentReferenceResolver().resolve(name); } setDocumentReference(reference); }  @Deprecated @Override String getName(); @Deprecated @Override void setName(String name); @Override void setNumber(int number); @Override void setXClassReference(EntityReference xClassReference); void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context); String displayHidden(String name, String prefix, XWikiContext context); String displayView(String name, String prefix, XWikiContext context); String displayEdit(String name, String prefix, XWikiContext context); String displayHidden(String name, XWikiContext context); String displayView(String name, XWikiContext context); String displayEdit(String name, XWikiContext context); @Override BaseObject clone(); BaseObject duplicate(); BaseObject duplicate(DocumentReference documentReference); @Override boolean equals(Object obj); @Override int hashCode(); @Override void fromXML(Element oel); @Override List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context); com.xpn.xwiki.api.Object newObjectApi(BaseObject obj, XWikiContext context); void set(String fieldname, java.lang.Object value, XWikiContext context); String getGuid(); void setGuid(String guid); @Override void setOwnerDocument(XWikiDocument ownerDocument); }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Deprecated @Override public void setName(String name) { DocumentReference reference = getDocumentReference(); if (reference != null) { EntityReference relativeReference = getRelativeEntityReferenceResolver().resolve(name, EntityType.DOCUMENT); reference = new DocumentReference(relativeReference.extractReference(EntityType.DOCUMENT).getName(), new SpaceReference(relativeReference.extractReference(EntityType.SPACE).getName(), reference.getParent().getParent())); } else { reference = getCurrentMixedDocumentReferenceResolver().resolve(name); } setDocumentReference(reference); }  @Deprecated @Override String getName(); @Deprecated @Override void setName(String name); @Override void setNumber(int number); @Override void setXClassReference(EntityReference xClassReference); void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context); String displayHidden(String name, String prefix, XWikiContext context); String displayView(String name, String prefix, XWikiContext context); String displayEdit(String name, String prefix, XWikiContext context); String displayHidden(String name, XWikiContext context); String displayView(String name, XWikiContext context); String displayEdit(String name, XWikiContext context); @Override BaseObject clone(); BaseObject duplicate(); BaseObject duplicate(DocumentReference documentReference); @Override boolean equals(Object obj); @Override int hashCode(); @Override void fromXML(Element oel); @Override List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context); com.xpn.xwiki.api.Object newObjectApi(BaseObject obj, XWikiContext context); void set(String fieldname, java.lang.Object value, XWikiContext context); String getGuid(); void setGuid(String guid); @Override void setOwnerDocument(XWikiDocument ownerDocument);  }