RelationAttribute
Auf der Webseite sollten jetzt für alle RelationAttribute statt des keys der lokalisierte Wert angezeigt. Dazu waren u.A. einige Änderungen am ContentItemXMLRenderer und dem RelationAttributeInterface nötig. git-svn-id: https://svn.libreccm.org/ccm/trunk@686 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0ae4b22d5f
commit
bed3eec727
|
|
@ -55,7 +55,6 @@ import com.arsdigita.util.Reporter;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
import com.arsdigita.versioning.VersionedACSObject;
|
import com.arsdigita.versioning.VersionedACSObject;
|
||||||
import com.arsdigita.versioning.Versions;
|
import com.arsdigita.versioning.Versions;
|
||||||
import java.util.logging.Level;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
@ -68,7 +67,6 @@ import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a content item.
|
* This class represents a content item.
|
||||||
|
|
@ -202,7 +200,7 @@ import java.util.StringTokenizer;
|
||||||
*
|
*
|
||||||
* @version $Id: ContentItem.java 1621 2007-09-13 12:43:12Z chrisg23 $
|
* @version $Id: ContentItem.java 1621 2007-09-13 12:43:12Z chrisg23 $
|
||||||
*/
|
*/
|
||||||
public class ContentItem extends VersionedACSObject implements CustomCopy, RelationAttributeInterface {
|
public class ContentItem extends VersionedACSObject implements CustomCopy {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ContentItem.class);
|
private static final Logger s_log = Logger.getLogger(ContentItem.class);
|
||||||
private static final Logger s_logDenorm = Logger.getLogger(ContentItem.class.getName() + ".Denorm");
|
private static final Logger s_logDenorm = Logger.getLogger(ContentItem.class.getName() + ".Denorm");
|
||||||
|
|
@ -235,7 +233,6 @@ public class ContentItem extends VersionedACSObject implements CustomCopy, Relat
|
||||||
public static final String DRAFT_VERSION = "masterVersion";
|
public static final String DRAFT_VERSION = "masterVersion";
|
||||||
public static final String VERSIONS = "slaveVersions";
|
public static final String VERSIONS = "slaveVersions";
|
||||||
public static final String CONTENT_SECTION = "section";
|
public static final String CONTENT_SECTION = "section";
|
||||||
private static final String RELATION_ATTRIBUTES = "";
|
|
||||||
private static final String PUBLISH_LISTENER_CLASS =
|
private static final String PUBLISH_LISTENER_CLASS =
|
||||||
PublishLifecycleListener.class.getName();
|
PublishLifecycleListener.class.getName();
|
||||||
private VersionCache m_pending;
|
private VersionCache m_pending;
|
||||||
|
|
@ -2083,11 +2080,4 @@ public class ContentItem extends VersionedACSObject implements CustomCopy, Relat
|
||||||
return extraXMLGenerators;
|
return extraXMLGenerators;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasRelationAttributes() {
|
|
||||||
return !RELATION_ATTRIBUTES.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
public StringTokenizer getRelationAttributes() {
|
|
||||||
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ import com.arsdigita.xml.Element;
|
||||||
*/
|
*/
|
||||||
public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
||||||
|
|
||||||
|
private String m_propertyName = "";
|
||||||
|
private String m_keyName = "";
|
||||||
|
private String m_relationAttribute = "";
|
||||||
|
|
||||||
public ContentItemXMLRenderer(Element root) {
|
public ContentItemXMLRenderer(Element root) {
|
||||||
super(root);
|
super(root);
|
||||||
}
|
}
|
||||||
|
|
@ -56,10 +60,11 @@ public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
||||||
String path,
|
String path,
|
||||||
Property property) {
|
Property property) {
|
||||||
|
|
||||||
String name = property.getName();
|
String propertyName = property.getName();
|
||||||
|
|
||||||
|
// Special handling for the isoCountryCode field in GenericAddress
|
||||||
if (obj instanceof GenericAddress) {
|
if (obj instanceof GenericAddress) {
|
||||||
if (name.equals("isoCountryCode")) {
|
if (propertyName.equals("isoCountryCode")) {
|
||||||
super.handleAttribute(obj, path, property);
|
super.handleAttribute(obj, path, property);
|
||||||
|
|
||||||
Element element = newElement(m_element, "country");
|
Element element = newElement(m_element, "country");
|
||||||
|
|
@ -68,6 +73,66 @@ public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special handling for the relation attribute keys
|
||||||
|
if (!m_relationAttribute.isEmpty()) {
|
||||||
|
String key = "";
|
||||||
|
|
||||||
|
// The RelationAttribute is part of this domain object as field
|
||||||
|
if (obj instanceof RelationAttributeInterface
|
||||||
|
&& ((RelationAttributeInterface) obj).hasRelationAttributeProperty(propertyName)) {
|
||||||
|
|
||||||
|
RelationAttributeInterface relationAttributeObject = (RelationAttributeInterface) obj;
|
||||||
|
key = relationAttributeObject.getRelationAttributeKey(propertyName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// This RelationAttribute is part of an n:m association as link attribute
|
||||||
|
if (obj instanceof LinkDomainObject
|
||||||
|
&& propertyName.equals(m_keyName)) {
|
||||||
|
key = (String) ((LinkDomainObject) obj).get(m_keyName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace value of the property defined in RELATION_ATTRIBUTES string
|
||||||
|
// of the primary domain object with the localized String.
|
||||||
|
if (!key.isEmpty()) {
|
||||||
|
RelationAttributeCollection relationAttributeCollection = new RelationAttributeCollection(m_relationAttribute, key);
|
||||||
|
relationAttributeCollection.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||||
|
Element element = newElement(m_element, m_keyName);
|
||||||
|
element.setText(relationAttributeCollection.getName());
|
||||||
|
relationAttributeCollection.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
super.handleAttribute(obj, path, property);
|
super.handleAttribute(obj, path, property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void beginAssociation(DomainObject obj, String path, Property property) {
|
||||||
|
super.beginAssociation(obj, path, property);
|
||||||
|
|
||||||
|
String propertyName = property.getName();
|
||||||
|
|
||||||
|
if (obj instanceof RelationAttributeInterface
|
||||||
|
&& ((RelationAttributeInterface) obj).hasRelationAttributeProperty(propertyName)) {
|
||||||
|
|
||||||
|
RelationAttributeInterface relationAttributeObject = (RelationAttributeInterface) obj;
|
||||||
|
|
||||||
|
m_propertyName = propertyName;
|
||||||
|
m_keyName = relationAttributeObject.getRelationAttributeKeyName(propertyName);
|
||||||
|
m_relationAttribute = relationAttributeObject.getRelationAttributeName(propertyName);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void endAssociation(DomainObject obj, String path, Property property) {
|
||||||
|
|
||||||
|
m_propertyName = "";
|
||||||
|
m_keyName = "";
|
||||||
|
m_relationAttribute = "";
|
||||||
|
|
||||||
|
super.endAssociation(obj, path, property);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,10 +101,16 @@ public class RelationAttributeCollection extends DomainCollection {
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
public final String getKey() {
|
public final String getKey() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
return (String) get(KEY);
|
return (String) get(KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String getLanguage() {
|
public final String getLanguage() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
return (String) get(LANGUAGE);
|
return (String) get(LANGUAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,10 +139,16 @@ public class RelationAttributeCollection extends DomainCollection {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
return getRelationAttribute().getName();
|
return getRelationAttribute().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
return getRelationAttribute().getDescription();
|
return getRelationAttribute().getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms;
|
package com.arsdigita.cms;
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
@ -15,6 +14,13 @@ public interface RelationAttributeInterface {
|
||||||
|
|
||||||
public abstract boolean hasRelationAttributes();
|
public abstract boolean hasRelationAttributes();
|
||||||
|
|
||||||
|
public abstract boolean hasRelationAttributeProperty(String propertyName);
|
||||||
|
|
||||||
public abstract StringTokenizer getRelationAttributes();
|
public abstract StringTokenizer getRelationAttributes();
|
||||||
|
|
||||||
|
public abstract String getRelationAttributeName(String propertyName);
|
||||||
|
|
||||||
|
public abstract String getRelationAttributeKeyName(String propertyName);
|
||||||
|
|
||||||
|
public abstract String getRelationAttributeKey(String propertyName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ public class GenericContact extends ContentPage implements
|
||||||
public static final String ADDRESS = "address";
|
public static final String ADDRESS = "address";
|
||||||
public static final String CONTACT_ENTRIES = "contactentries";
|
public static final String CONTACT_ENTRIES = "contactentries";
|
||||||
public static final String CONTACTS_KEY = GenericPersonContactCollection.CONTACTS_KEY;
|
public static final String CONTACTS_KEY = GenericPersonContactCollection.CONTACTS_KEY;
|
||||||
private static final String RELATION_ATTRIBUTES = "GenericContactType;GenericContactEntryType";
|
|
||||||
|
private static final String RELATION_ATTRIBUTES = "person.link_key:GenericContactTypes;contactentries.key:GenericContactEntryKeys";
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
private static final GenericContactConfig s_config =
|
private static final GenericContactConfig s_config =
|
||||||
|
|
@ -232,8 +233,50 @@ public class GenericContact extends ContentPage implements
|
||||||
return !RELATION_ATTRIBUTES.isEmpty();
|
return !RELATION_ATTRIBUTES.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRelationAttributeProperty(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StringTokenizer getRelationAttributes() {
|
public StringTokenizer getRelationAttributes() {
|
||||||
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKeyName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(".") + 1, token.indexOf(":"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(":") + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKey(String propertyName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,17 +21,19 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.RelationAttributeInterface;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class GenericContactEntry extends ContentItem {
|
public class GenericContactEntry extends ContentItem implements RelationAttributeInterface {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.GenericContactEntry";
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.GenericContactEntry";
|
||||||
private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.contenttypes";
|
private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.contenttypes";
|
||||||
|
|
@ -43,6 +45,7 @@ public class GenericContactEntry extends ContentItem {
|
||||||
public static final String VALUE = "value";
|
public static final String VALUE = "value";
|
||||||
public static final String DESCRIPTION = "description";
|
public static final String DESCRIPTION = "description";
|
||||||
|
|
||||||
|
private static final String RELATION_ATTRIBUTES = "key.key:GenericContactEntryKeys";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of GenericContactEntry
|
* Creates a new instance of GenericContactEntry
|
||||||
|
|
@ -111,4 +114,56 @@ public class GenericContactEntry extends ContentItem {
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
set(DESCRIPTION, description);
|
set(DESCRIPTION, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRelationAttributes() {
|
||||||
|
return !RELATION_ATTRIBUTES.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRelationAttributeProperty(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringTokenizer getRelationAttributes() {
|
||||||
|
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKeyName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(".") + 1, token.indexOf(":"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(":") + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKey(String propertyName) {
|
||||||
|
return getKey();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
||||||
public static final String CONTACTS = "contacts";
|
public static final String CONTACTS = "contacts";
|
||||||
public static final String CONTACTS_KEY = "link_key";
|
public static final String CONTACTS_KEY = "link_key";
|
||||||
public static final String CONTACTS_ORDER = "link_order";
|
public static final String CONTACTS_ORDER = "link_order";
|
||||||
private static final String RELATION_ATTRIBUTES = "GenericContactType";
|
|
||||||
|
private static final String RELATION_ATTRIBUTES = "contacts.link_key:GenericContactType";
|
||||||
|
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.cms.contenttypes.GenericPerson";
|
"com.arsdigita.cms.contenttypes.GenericPerson";
|
||||||
|
|
@ -74,7 +76,6 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
||||||
|
|
||||||
public GenericPerson(String type) {
|
public GenericPerson(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
//set(CONTACTS, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -170,7 +171,6 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
||||||
String fullname = getFullName();
|
String fullname = getFullName();
|
||||||
if (fullname != null && !fullname.isEmpty()) {
|
if (fullname != null && !fullname.isEmpty()) {
|
||||||
setTitle(fullname);
|
setTitle(fullname);
|
||||||
//setName(GenericPerson.urlSave(fullname));
|
|
||||||
setName(GenericPerson.urlSave(String.format("%s %s", getSurname(), getGivenName())));
|
setName(GenericPerson.urlSave(String.format("%s %s", getSurname(), getGivenName())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,16 +201,6 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
||||||
return !this.getContacts().isEmpty();
|
return !this.getContacts().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasRelationAttributes() {
|
|
||||||
return !RELATION_ATTRIBUTES.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public StringTokenizer getRelationAttributes() {
|
|
||||||
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a ulr save version of the full name
|
// Create a ulr save version of the full name
|
||||||
public static String urlSave(String in) {
|
public static String urlSave(String in) {
|
||||||
|
|
||||||
|
|
@ -234,4 +224,56 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
||||||
return in;
|
return in;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRelationAttributes() {
|
||||||
|
return !RELATION_ATTRIBUTES.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRelationAttributeProperty(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringTokenizer getRelationAttributes() {
|
||||||
|
return new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKeyName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(".") + 1, token.indexOf(":"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeName(String propertyName) {
|
||||||
|
StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";");
|
||||||
|
while(strTok.hasMoreTokens()) {
|
||||||
|
String token = strTok.nextToken();
|
||||||
|
if(token.startsWith(propertyName + ".")) {
|
||||||
|
return token.substring(token.indexOf(":") + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationAttributeKey(String propertyName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +189,7 @@ public abstract class DomainObjectTraversal {
|
||||||
s_log.debug("findAdapter for type " + type.getQualifiedName()
|
s_log.debug("findAdapter for type " + type.getQualifiedName()
|
||||||
+ " in context " + context);
|
+ " in context " + context);
|
||||||
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuilder buf = new StringBuilder();
|
||||||
buf.append("Adapters contain:\n");
|
buf.append("Adapters contain:\n");
|
||||||
Iterator keys = s_adapters.keySet().iterator();
|
Iterator keys = s_adapters.keySet().iterator();
|
||||||
while (keys.hasNext()) {
|
while (keys.hasNext()) {
|
||||||
|
|
@ -568,6 +568,7 @@ public abstract class DomainObjectTraversal {
|
||||||
m_context = context;
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof AdapterKey) {
|
if (o instanceof AdapterKey) {
|
||||||
AdapterKey k = (AdapterKey) o;
|
AdapterKey k = (AdapterKey) o;
|
||||||
|
|
@ -577,10 +578,12 @@ public abstract class DomainObjectTraversal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return m_type.hashCode() + m_context.hashCode();
|
return m_type.hashCode() + m_context.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return m_type.getQualifiedName() + ',' + m_context;
|
return m_type.getQualifiedName() + ',' + m_context;
|
||||||
}
|
}
|
||||||
|
|
@ -595,5 +598,10 @@ public abstract class DomainObjectTraversal {
|
||||||
public LinkDomainObject(DataObject object) {
|
public LinkDomainObject(DataObject object) {
|
||||||
super(object);
|
super(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get(String attr) {
|
||||||
|
return super.get(attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue