We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Custom Archives - SOWeb

Hi again,

I fixed the sorting in the CustomArchives for SOWindows and have now configured the Archives for display in SOWeb

I have noticed though that the sorting does not work at all in the SOWeb archives

In the Project Linked Sales Archive that I have wrote I am also not able to right-click the headers to get the Column Chooser or Sorter menu to appear

In the Project Linked Activities Archive the menu does appear but it affects the SuperOffice Project Activity Archive rather than my Custom archive (and switches context to it when the menu is closed)

Waht have I missed doing as this probably should be working (I didn't have to do anything in SOWin to get these menus to appear)

 

Cheers James

RE: Custom Archives - SOWeb

HI James,

Several things... In web, you have to declare your new control and what actions it can handle, including opening the configure columns/sort dialog.

You can discover all of the requirements and configuration options by reading about Custom Archives in the SuperOffice Web documentation.

In reference to the sorting issue... Does your custom archive provider implement SetSortOrder, and then use those arguments in the GetRows method?

Hope this helps!

By: Tony Yates 3 Sep 2020

RE: Custom Archives - SOWeb

Thanks Tony, I'll be sure to read through those articles

Cheers James

By: James Carter 3 Sep 2020

RE: Custom Archives - SOWeb

Hi Tony,
so do I need to create another merge file for SoMenuConfiguration.config
and with reference to this question:
"In reference to the sorting issue... Does your custom archive provider implement SetSortOrder, and then use those arguments in the GetRows method?"
No, I have no code for SetSortOrder - I assume you mean SetOrderBy?
If so, it is implemented but is empty:

 public void SetOrderBy(params ArchiveOrderByInfo[] orderBy)
 {
 }

Cheers James
By: James Carter 3 Sep 2020

RE: Custom Archives - SOWeb

Win talking here...
By default the Win client sorts archives from in-memory data after the archive is completely loaded.
But Win also has a means of letting the provider sort during the load phase.

See: https://community.superoffice.com/en/blog/letting-the-db-sort-in-the-load-sequence-of-a-netserver-based-archive/

(just so you know)

/Conrad

By: Conrad Weyns 3 Sep 2020

RE: Custom Archives - SOWeb

Hi again,

I now have the menu displaying after defining it in a menu merge file
I am getting the following error though when the column config dialog opens

The provider/guiname archiveColumns:ProjectSalesProvider/ProjectSalesGUIName is not known. Please check the config section of your ArchiveColumnConfigDataHandler
Source: SuperOffice.CRMWeb

Thanks James

PS Thanks for additional info the SOWin Archives Conrad

The SOProjectPage Merge files looks like this:

<pages>
	<page id="ProjectPage">
	  <data>
		<datahandlers>
		<datahandler id="ArchiveColumnConfigDataHandler" type="ArchiveColumnConfigDataHandler">
        <config>
          <archivecolumninfos>
            <archivecolumninfo mergeaction="insert" guiname="ProjectSalesGUIName" providername="ProjectSalesProvider"/>
          </archivecolumninfos>
        </config>
		</datahandler>
		</datahandlers>
	  </data>
	</page>
</pages>


and the definition of the menu in the menu merge file is:

  <menus>
  <menu context="archive" subcontext="projectlinkedsales" id="0" position="below" group="mainmenu" displayaccesskeys="false">
    <menuitems>
      <menuitem id="archivesort" type="normal" trackingId="archive.projectlinkedsales.sort">
        <caption>[SR_MENU_SORT]</caption>
        <url>javascript:VygonProjectSalesArchiveArchiveControl.OrgOrderBy();</url>
      </menuitem>
      <menuitem id="" type="divider" />
      <menuitem id="archivesortconfig" type="normal" trackingId="archive.projectsale.sortConfig">
        <caption>[SR_MENU_SORT_CONFIG]</caption>
        <url>Javascript:Dialog.open("archiveconfiguration", "archiveconfiguration[dialog=stop].sortorder?provider_name=ProjectSalesProvider&amp;gui_name=ProjectSalesGUIName","VygonProjectSalesArchiveArchiveControl.Refresh();");</url>
      </menuitem>
      <menuitem id="archivecolumnconfig" type="normal" trackingId="archive.projectsale.columnsConfig">
        <caption>[SR_MENU_COLUMNS_CONFIG]</caption>
        <url>Javascript:Dialog.open("archiveconfiguration", "archiveconfiguration[dialog=stop].columns?provider_name=ProjectSalesProvider&amp;gui_name=ProjectSalesGUIName","VygonProjectSalesArchiveArchiveControl.Refresh();");</url>
      </menuitem>
      <menuitem id="" type="divider" />
      <menuitem id="archivesorthelp" type="normal" trackingId="archive.projectsale.listHelpSort">
        <caption>[SR_MENU_LIST_HELP_SORT]</caption>
        <url>javascript:Dialog.ShowHelpFromIndex('archive.sort');</url>
      </menuitem>
      <menuitem id="archivecolumnresize" type="normal" trackingId="archive.projectsale.listHelpResize">
        <caption>[SR_MENU_LIST_HELP_RESIZE]</caption>
        <url>javascript:Dialog.ShowHelpFromIndex('archive.resize');</url>
      </menuitem>
    </menuitems>
  </menu>
  </menus>
By: James Carter 4 Sep 2020

RE: Custom Archives - SOWeb

Hi again,

I noticed some comments on other posts about certain names having to be lower case so I chnaged the Provider Name and GUIName to be lower case and the menu now works :)

Column Header clicking to sort does not seem to work though :( Does anyone know what I have missed here? Is it the C# in public void SetOrderBy that needs coding up?

 

Cheers James

By: James Carter 4 Sep 2020

RE: Custom Archives - SOWeb

Hi James,

Yes, if you expect sorting on columns to work in the archive control, you should expect to implement sorting logic in your archive provider GetRows method.

In reference to the error, have you added a merge file for SoArchiveColumnList.config? Snippet from the docs:
 
 
Hope this helps!
 
 
By: Tony Yates 4 Sep 2020

RE: Custom Archives - SOWeb

Hi again!

I'm not sure what to put to in the SetOrderBy

Do I have to convert the sort array to a string and pass that as a parameter to a new call to GetRows(....)?

If I do then I will still need a custom sorter as the archive is made up of two separate queries - any ideas on this one?

Also since editing some of the names (provider and gui) in the code to keep the menu control happy one of the archives is throwing a DCF error that is stopping SOWeb from opening after logging in (SoWindows is perfectly happy so my guess is a config file)

The exception details displayed do not show which bit of code\configuration is causing this - any tips on debugging it?

 

Cheers James

By: James Carter 9 Sep 2020

RE: Custom Archives - SOWeb

Hi James,

You seem to have two separte issues here.

The first, dealing with SetOrderBy is quite straight forward. If you have created your own archive provider (by inheriting from IArchiveProvider), then you are responsible for accepting the arguments passed into SetOrderBy and determine how best to construct your query(ies) and process the results based on the array of ArchiveOrderByInfo.

The second, dealing with tangled persisted archive control configuration is tricky. 

Two things:

  1. Don't reuse the same names (gui, context, subcontext, etc) as you are essentially hijacking the other archive controls and messing with their state. It's even mentioned in the docs... Don't do that. ;-)


  2. These column configurations are persisted in the database.  This is mentioned in the docs I referenced earlier:

What's not mentioned in the docs however is that if/when you do change these keys, you have to either update the offending row in the SuperListColumnSize table, or simple purge all rows in that table with your associate ID. When building these myself, I tended to do the latter. 

This should correct your sign-in issue. If not, you're going to need to provide more logging details than "throwing a DCF error..." :-)

Hope this helps!

By: Tony Yates 9 Sep 2020

RE: Custom Archives - SOWeb

Hi Tony,

thanks for the tips - I have now renamed everything and am getting a bit further in the load process.

I am now getting a pop-up window with the below error (Object with mapping name not found)

Any tips on where to look for my possible renaming error?

 

Cheers James

 

 

The given key was not present in the dictionary.
Source: mscorlib
Click here to see stacktrace

at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SuperOffice.Util.ReaderWriteLockExtensions.WithReaderLock[TResult](ReaderWriterLock theLock, Func`1 body)
at SuperOffice.DCF.Web.ConfigurationManager.GetObjectMapping(String mappingName)




Click here for more information

Object with mapping name: not found.
Source: SuperOffice.DCFWeb
Click here to see stacktrace
at SuperOffice.DCF.Web.ConfigurationManager.GetObjectMapping(String mappingName)
at SuperOffice.DCF.Web.Factory.ClassFactory.CreateObject(String name, Type type, Page page, Object[] constructorArguments)
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeDataHandlers(XmlNodeList datahandlerNodes)

Unable to initalize datahandler.
Source: SuperOffice.DCFWeb
Click here to see stacktrace
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeDataHandlers(XmlNodeList datahandlerNodes)
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.Initialize()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.OnInit(EventArgs e)
By: James Carter 11 Sep 2020