PublicPersonalProfile: DomainObject für verfügbare Navigationspunkte.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1033 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
6ceadd40d6
commit
b5a0cbb11e
|
|
@ -23,5 +23,19 @@ association {
|
||||||
to ct_public_personal_profile_owner_map.profile_id,
|
to ct_public_personal_profile_owner_map.profile_id,
|
||||||
join ct_public_personal_profile_owner_map.owner_id
|
join ct_public_personal_profile_owner_map.owner_id
|
||||||
to cms_persons.person_id;
|
to cms_persons.person_id;
|
||||||
|
|
||||||
|
Integer[0..1] ownerOrder = ct_public_personal_profile_owner_map.owner_order INTEGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object type PublicPersonalProfileNavItem {
|
||||||
|
|
||||||
|
BigDecimal[1..1] id = ct_public_personal_profile_nav_items.object_id INTEGER;
|
||||||
|
String[0..1] key = ct_public_personal_profile_nav_items.key VARCHAR(128);
|
||||||
|
String[0..1] lang = ct_public_personal_profile_nav_items.lang VARCHAR(2);
|
||||||
|
String[0..1] label = ct_public_personal_profile_nav_items.label VARCHAR(128);
|
||||||
|
Integer[0..1] navItemOrder = ct_public_personal_profile_nav_items.nav_item_order INTEGER;
|
||||||
|
String[0..1] generatorClass = ct_public_personal_profile_nav_items.generator_class VARCHAR(1024);
|
||||||
|
|
||||||
|
unique(key, lang, label);
|
||||||
|
object key (id);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class PublicPersonalProfileNavItem extends DomainObject {
|
||||||
|
|
||||||
|
public static final String ID = "id";
|
||||||
|
public static final String KEY = "key";
|
||||||
|
public static final String LANG = "lang";
|
||||||
|
public static final String LABEL = "label";
|
||||||
|
public static final String ORDER = "navItemOrder";
|
||||||
|
public static final String GENERATOR_CLASS = "generatorClass";
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
|
"com.arsdigita.cms.PublicPersonalProfileNavItem";
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem() {
|
||||||
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem(
|
||||||
|
final BigDecimal id) throws DataObjectNotFoundException {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem(final DataObject dobj) {
|
||||||
|
super(dobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem(final String typeName) {
|
||||||
|
super(typeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem(final String key,
|
||||||
|
final String lang,
|
||||||
|
final String label,
|
||||||
|
final Integer order) {
|
||||||
|
this();
|
||||||
|
setKey(key);
|
||||||
|
setLang(lang);
|
||||||
|
setLabel(label);
|
||||||
|
setOrder(order);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getBaseDataObjectType() {
|
||||||
|
return BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final BigDecimal getId() {
|
||||||
|
return(BigDecimal) get(ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getKey() {
|
||||||
|
return (String) get(KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setKey(final String key) {
|
||||||
|
set(KEY, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getLang() {
|
||||||
|
return (String) get(LANG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setLang(final String lang) {
|
||||||
|
set(LANG, lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getLabel() {
|
||||||
|
return (String) get(LABEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setLabel(final String label) {
|
||||||
|
set(LABEL, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Integer getOrder() {
|
||||||
|
return (Integer) get(ORDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setOrder(final Integer order) {
|
||||||
|
set(ORDER, order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getGeneratorClass() {
|
||||||
|
return (String) get(GENERATOR_CLASS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setGeneratorClass(final String generatorClass) {
|
||||||
|
set(GENERATOR_CLASS, generatorClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
import com.arsdigita.persistence.Filter;
|
||||||
|
import com.arsdigita.persistence.SessionManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class PublicPersonalProfileNavItemCollection extends DomainCollection {
|
||||||
|
|
||||||
|
private Filter keyFilter = null;
|
||||||
|
private Filter languageFilter = null;
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItemCollection() {
|
||||||
|
super(SessionManager.getSession().retrieve(PublicPersonalProfileNavItem.BASE_DATA_OBJECT_TYPE));
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItemCollection(
|
||||||
|
final DataCollection dataCollection) {
|
||||||
|
super(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem getNavItem() {
|
||||||
|
return new PublicPersonalProfileNavItem(m_dataCollection.getDataObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void addKeyFilter(final String key) {
|
||||||
|
keyFilter = this.addEqualsFilter(PublicPersonalProfileNavItem.KEY,
|
||||||
|
key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean removeKeyFilter(final String key) {
|
||||||
|
boolean retVal = false;
|
||||||
|
|
||||||
|
retVal = this.removeFilter(keyFilter);
|
||||||
|
if (retVal == true) {
|
||||||
|
keyFilter = null;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void addLanguageFilter(final String language) {
|
||||||
|
languageFilter = this.addEqualsFilter(PublicPersonalProfileNavItem.KEY,
|
||||||
|
language);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean removeLanguageFilter(final String language) {
|
||||||
|
boolean retVal = false;
|
||||||
|
|
||||||
|
retVal = this.removeFilter(languageFilter);
|
||||||
|
if (retVal == true) {
|
||||||
|
languageFilter = null;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeAllFilters() {
|
||||||
|
this.removeAllFilters();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getKey() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (String) get(PublicPersonalProfileNavItem.KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getLanguage() {
|
||||||
|
if (this.isBeforeFirst()) {
|
||||||
|
this.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (String) get(PublicPersonalProfileNavItem.LANG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPersonalProfileNavItem getNavItem(final String key,
|
||||||
|
final String language) {
|
||||||
|
if (!(this.isBeforeFirst()) && key.equals(this.getKey()) && language.equals(this.getLanguage())) {
|
||||||
|
return this.getNavItem();
|
||||||
|
} else {
|
||||||
|
this.rewind();
|
||||||
|
|
||||||
|
while(this.next()) {
|
||||||
|
if ( key.equals(this.getKey()) && language.equals(this.getLanguage())) {
|
||||||
|
return this.getNavItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue