none
WebUI throws error for editing custom resources

    Question

  • Hi everybody,

    I have added a custom model to Zentity, and I would like to be able to add my custom entities through WebUI. However, once I try to do this, I get an error. Here are the repro steps:

    1. Import your own model (i.e. I did this via XML file from RDF)
    2. Click on the custom entity (in order to add it)

    3. Error appears after click

    How can I fix this? Does anyone know? I'm going to check the docs again, maybe I missed something.

    Cheers,

    WizMan

    Saturday, March 24, 2012 3:55 PM

Answers

  • Hi Wiz,

    The above issue cannot be solved under "Zentity Design". The Zentity.Platform project is tightly associated with the Zentity.ScholarlyWorks and so is webUI. Zentity Resource Manager is a way of overcoming this limit for custom resources and data models.

    Please let me know, by accepting it as answer, if I can close this issue now.

    -Regards

    • Proposed as answer by Kalnemi Tuesday, April 17, 2012 7:14 AM
    • Marked as answer by WizMan Wednesday, April 18, 2012 5:58 PM
    Tuesday, April 17, 2012 7:14 AM

All replies

  • Hey Wiz,

    I have reproduced this bug at my end. I am currently investigating it and will get back to you with the updates.

    -Regards

    This is the stack trace: I would recommend to "Off" the custom error in WebUI web.config file

    <customErrors defaultRedirect="Error.htm" mode="Off">
     <error statusCode="404" redirect="Error.aspx?Error=PageNotFound"/>
     <error statusCode="408" redirect="Error.aspx?Error=Timeout"/>
    </customErrors>

    [FileNotFoundException: Could not load file or assembly 'TestScholarlyWorks' or one of its dependencies. The system cannot find the file specified.]
       System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
       System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
       System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
       System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
       System.Reflection.Assembly.Load(String assemblyString) +28
       Zentity.Web.UI.ToolKit.ResourceProperties.GetTypeOfResource() +50
       Zentity.Web.UI.ToolKit.ResourceProperties.IsInHierarchy(String actualClass, Boolean IsInUpperHierarchy) +20
       Zentity.Web.UI.ToolKit.ResourceProperties.GetScalarProperties(String type) +464
       Zentity.Web.UI.ToolKit.ResourceProperties.GetDataSource() +1171
       Zentity.Web.UI.ToolKit.ZentityTable.OnLoad(EventArgs e) +38
       Zentity.Web.UI.ToolKit.ResourceProperties.OnLoad(EventArgs e) +229
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

    • Edited by Kalnemi Tuesday, March 27, 2012 1:26 AM Stack Trace update
    Tuesday, March 27, 2012 1:14 AM
  • Wiz,

    I needed to copy the TestScholarlyWorks.dll fom the location C:\Program Files\Zentity\ZentityWebSite\DataService\bin to the bin folder of WebUI ( C:\Program Files\Zentity\ZentityWebSite\WebUI\bin ).

    Sorry for the delay Wiz.

    Thanks

    • Proposed as answer by Kalnemi Tuesday, March 27, 2012 6:10 AM
    Tuesday, March 27, 2012 6:10 AM
  • Hi Kalnemi, no sweat, I will try this procedure and get back with feedback! Thanks!
    Tuesday, March 27, 2012 10:31 AM
  • Hmm, after copying the .dll the WebUI worked, even the Metadata entry form for the entity appeared. However, once I clicked 'Save' the following error appeared:

    Server Error in '/WebUI' Application.


    [TargetException: Non-static method requires a target.]
       System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) +9352741
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +100
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
       System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) +101
       System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) +25
       Zentity.Web.UI.ToolKit.ResourceProperties.GetResourceDetails() +568
       Zentity.Web.UI.ToolKit.ResourceProperties.SaveResourceProperties() +43
       UserControls_CreateResource.SaveResource() +18
       UserControls_CreateResource.Submit_Click(Object sender, EventArgs e) +190
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

    Version Information:

    Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

    Tuesday, March 27, 2012 10:40 AM
  • You might have got this point, the culprit here is the casting of the newly created resource as "Resource". No idea why this is happening. Need to do some investigation. Will update you once find any clue.

    -Regards

    Tuesday, March 27, 2012 3:29 PM
  • Hi Kalnemi, any updates on this one? Thanks!
    Tuesday, April 03, 2012 2:05 PM
  • Hi Wiz,

    The issue is due to no base type for the newly created entities. The database entry for the basetypeId is showing Resource type as the base type  but it fails in code. I have not tested the latest issue but it is due to the same reason. In the screen shot pasted in my last reply, the _resource variable will set to null when the highlighted line will execute. Below, two screen shots are compared, one for the newly created Scholar sample and one  for the lecture resource that comes with the Scholarly work. It just clarifies what I said above.

    Wednesday, April 04, 2012 3:15 AM
  • In the above screen shots the hierarchies of both of the resources are shown. The lecture resourcew is well and shows the hierarchy as given in the Zentity database but the TestResearchDocument shows no Resource as its base type. I am not sure where the code breaks. I will start researching again and will update you in next 12 hours. Also, by the time, if you find some trick to overcome this issue please share with us on the forum.

    Hope we resolve this today!

    -Regards

    Wednesday, April 04, 2012 3:23 AM
  • No luck Wiz. Need some more time. I will keep you posted on the updates.

    -Regards

    Wednesday, April 04, 2012 6:05 PM
  • Ok, I understand the problem as you've described it and thanks for the update! I am also working in parallel to attempt to solve this. I've tried creating a custom entity via code which definitely inherits from the type Resource (explicit base type), but I receive the same error still. Maybe you have more luck than I do tomorrow :(

    Cheers

    WizMan

    Wednesday, April 04, 2012 11:03 PM
  • I need to confirm with the Zentity product team before responding to your this query and overall guidelines on your observation "why Zentity generally dislikes models other than ScholarlyWorks", posted in the other thread. Will keep you posted on the updates.

    -Regards

    Friday, April 06, 2012 1:12 PM
  • Hi Wiz,

    The above issue cannot be solved under "Zentity Design". The Zentity.Platform project is tightly associated with the Zentity.ScholarlyWorks and so is webUI. Zentity Resource Manager is a way of overcoming this limit for custom resources and data models.

    Please let me know, by accepting it as answer, if I can close this issue now.

    -Regards

    • Proposed as answer by Kalnemi Tuesday, April 17, 2012 7:14 AM
    • Marked as answer by WizMan Wednesday, April 18, 2012 5:58 PM
    Tuesday, April 17, 2012 7:14 AM