-
Notifications
You must be signed in to change notification settings - Fork 15
How to register a details view for a entity
David Schöne edited this page Jul 26, 2019
·
6 revisions
If there are several entities in the system and they are mapped in the search, the target is to load a different details view for each entity.
To call a seperate view from the search for an own entity, you need 2 extensions
- when installing the entity, the information to which module the entity belongs must be stored.
- a function for the mode Show must be created in the manifest file.
- when installing the entity, the information to which module the entity belongs must be stored. Example
#region create entities
// Entities
Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == "Sample".ToUpperInvariant()).FirstOrDefault();
if (entity == null)
{
entity = new Entity();
entity.Name = "Sample";
entity.EntityType = typeof(Dataset);
entity.EntityStoreType = typeof(Xml.Helpers.DatasetStore);
entity.UseMetadata = true;
entity.Securable = true;
//add to Extra
XmlDocument xmlDoc = new XmlDocument();
XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper();
xmlDatasetHelper.AddReferenceToXml(xmlDoc, AttributeNames.name.ToString(), "rdb", AttributeType.parameter.ToString(), "extra/modules/module");
entity.Extra = xmlDoc;
entityManager.Create(entity);
}
else
{
if (entity.Extra == null)
{
//update to Extra
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.AppendChild(entity.Extra);
XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper();
xmlDatasetHelper.AddReferenceToXml(xmlDoc, AttributeNames.name.ToString(), "rdb", AttributeType.parameter.ToString(), "extra/modules/module");
entity.Extra = xmlDoc;
entityManager.Update(entity);
}
}
#endregion- a function for the mode Show must be created in the manifest file.
<EntityActions>
<EntityAction id="showSample" entity="sample" controller="Sample" action="Show" area="Rdb" modus="show"/>
</EntityActions>
- create an object of the entity X
- open the search
- when you have found the object, open the detail view