Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to associate assemblies containing DnnController implementation with friendlyname of the packageHow to associate assemblies containing DnnController implementation with friendlyname of the package
Previous
 
Next
New Post
12/15/2015 2:31 AM
 
I am looking for a way to associate assemblies that contain DnnController or IServiceRouteMapper implementations 
(as shown in the code below) and module definitions (friendlyname or modulename) they are part of. 

Basically I might have a few assemblies  in a package and some of them will have these implementations (see example manifest below the code).
Is that facts exposed anywhere in module definitions and if not how to figure out what packages certain assemblies are part of.
I guess in my case there will be one type in an assembly that can register one or more assemblies that contain DnnController-s.
I know there the manifest in string format are stored in DB:
SELECT Manifest FROM Packages, but I would like to avoid manually parsing that file or using DNN to do the parsing for me.
private FindModuleDefinitions()
{
    get
    {
        List<string> locations = new List<string>();
        foreach (Type routeMapperType in GetAllServiceRouteMapperTypes())
        {
            locations.add(routeMapperType.Assembly.Location);
// How to obtain module definition that this assembly is part of? I would prefer Friendly name at this point.
        }
        return locations;
    }
}
 
 private IEnumerable<Type> GetAllServiceRouteMapperTypes(){
    return (new TypeLocator()).GetAllMatchingTypes(IsValidServiceRouteMapper);
}
 
private static bool IsValidServiceRouteMapper(Type t){
    return t != null && t.IsClass && !t.IsAbstract && t.IsVisible && typeof(IServiceRouteMapper).IsAssignableFrom(t);
}

This package definition ilustrates visually what I want to get.

<dotnetnuke type="Package" version="5.0">
  <packages>
    <package name="Connect AccountRegistrationForm" type="Module" version="01.00.00">
      <friendlyName>Connect: AccountRegistration</friendlyName>     >>>> I want to get this element based on descoverd assembly names (**) and (****) below
                                                                         using a method like one above: GetAllServiceRouteMapperTypes()
...
        <component type="Assembly">
          <assemblies>
            <basePath>bin</basePath>
            <assembly>
              <name>Connect.Modules.AccountRegistration.dll</name> >>> contains IServiceRouteMapper implementation   (**)
            </assembly>
            <assembly>
              <name>Connect.Libraries.UserManagement.dll</name>    >>>> contains fist DnnController implementation   (****)
            </assembly>              
            <assembly>
              <name>Connect.Libraries.GroupManagement.dll</name>    >>>> contains second DnnController implementation   (****)
            </assembly
            <assembly>
              <name>Connect.Libraries.GrouprManagement.dll</name>    >>>> doesn't contain secondDnnController or  IServiceRouteMapperimplementation
            </assembly>                                                                   (some third party library or utility class) 
          </assemblies>
        </package>
     </package>

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to associate assemblies containing DnnController implementation with friendlyname of the packageHow to associate assemblies containing DnnController implementation with friendlyname of the package


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out