-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LA-17: ListView "Quick View" functionality [Selenium Tests fixed].
Introduced ShowView Configuration Unit. Added handling of missing ListView & ShowView Configuration Units: Default units populated with entity model persistent fields.
- Loading branch information
Showing
44 changed files
with
576 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...rc/main/java/org/lightadmin/core/config/domain/show/DefaultShowViewConfigurationUnit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.lightadmin.core.config.domain.show; | ||
|
||
import org.lightadmin.core.config.bootstrap.parsing.configuration.DomainConfigurationUnitType; | ||
import org.lightadmin.core.config.domain.field.FieldMetadata; | ||
import org.lightadmin.core.config.domain.field.PersistentFieldMetadata; | ||
import org.lightadmin.core.config.domain.unit.DomainTypeConfigurationUnit; | ||
import org.lightadmin.core.persistence.metamodel.DomainTypeEntityMetadata; | ||
import org.lightadmin.core.persistence.metamodel.DomainTypeEntityMetadataAware; | ||
|
||
import java.util.Iterator; | ||
import java.util.Set; | ||
|
||
import static com.google.common.collect.Sets.newLinkedHashSet; | ||
import static org.lightadmin.core.config.domain.field.FieldMetadataUtils.*; | ||
|
||
public class DefaultShowViewConfigurationUnit extends DomainTypeConfigurationUnit implements ShowViewConfigurationUnit, DomainTypeEntityMetadataAware { | ||
|
||
private Set<FieldMetadata> fields = newLinkedHashSet(); | ||
|
||
protected DefaultShowViewConfigurationUnit( final Class<?> domainType ) { | ||
super( domainType ); | ||
} | ||
|
||
public void addField( FieldMetadata fieldMetadata ) { | ||
fields.add( fieldMetadata ); | ||
} | ||
|
||
public Set<FieldMetadata> getFields() { | ||
return newLinkedHashSet( fields ); | ||
} | ||
|
||
@Override | ||
public Iterator<FieldMetadata> iterator() { | ||
return getFields().iterator(); | ||
} | ||
|
||
@Override | ||
public DomainConfigurationUnitType getDomainConfigurationUnitType() { | ||
return DomainConfigurationUnitType.SHOW_VIEW; | ||
} | ||
|
||
@Override | ||
public void setDomainTypeEntityMetadata( final DomainTypeEntityMetadata domainTypeEntityMetadata ) { | ||
if ( containsPersistentField( fields, domainTypeEntityMetadata.getIdAttribute().getName() ) ) { | ||
final PersistentFieldMetadata primaryKeyField = getPersistentField( fields, domainTypeEntityMetadata.getIdAttribute().getName() ); | ||
primaryKeyField.setPrimaryKey( true ); | ||
return; | ||
} | ||
|
||
fields = addPrimaryKeyPersistentField( fields, domainTypeEntityMetadata.getIdAttribute() ); | ||
} | ||
} |
Oops, something went wrong.