Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

feature not visible in dlux ui

asked 2015-09-01 00:34:55 -0800

hjdeore gravatar image

Hi Guys ,

i created one feature using guidelines given on

https://wiki.opendaylight.org/view/OpenDaylightdlux:Addnew_application

But i am not able to see tab in DLUX UI. Feature got installed successfully. can you guide me for this? i have doubt in blueprint.xml for section

<property name="url" value="/src/app/topology"> <property name="directory" value="/topology"></property></property>

what exactly i should use values for this ?? My js/html files are in folder src/main/resources/vlan of vlan-resources in dlux project.

Thanks, Harish

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-02 02:53:23 -0800

Mandeep gravatar image

updated 2015-09-02 05:08:48 -0800

Use url value "src/app/vlan" and directory value "/vlan"

Are you able to see other tabs in dlux ui?

If yes... Have you included code related to Nav Menu mentioned in odl wiki guide https://wiki.opendaylight.org/view/OpenDaylightdlux:Createandadda_module?

Use NavHelperProvider instead of NavMenuHelper.

For reference (below is my working structure, module name is 'gconfig'):

File listing in dlux/modules/gconfig-resources/ :

./pom.xml
./src
./src/main
./src/main/resources
./src/main/resources/gconfig
./src/main/resources/gconfig/gconfig.module.js
./src/main/resources/gconfig/gconfig.controller.js
./src/main/resources/gconfig/gconfig.tpl.html

Content of gconfig.module.js

define(['angularAMD','app/routingConfig', 'angular-ui-router','app/core/core.services'], function(ng) {
var gconfig = angular.module('app.gconfig', ['ui.router.state', 'app.core']);

// module configuration
gconfig.config(function($compileProvider, $controllerProvider, $provide, $stateProvider, NavHelperProvider) {

    gconfig.register = {
      controller : $controllerProvider.register,
      directive : $compileProvider.directive,
      factory : $provide.factory,
      service : $provide.service
    };

    var access = routingConfig.accessLevels;
    $stateProvider.state('main.gconfig', {
      url: 'gconfig',
      views : {
        'content' : {
          templateUrl: 'src/app/gconfig/gconfig.tpl.html',
          controller: 'GConfigCtrl'
        }
      }
    });

    NavHelperProvider.addControllerUrl('app/gconfig/gconfig.controller');
    NavHelperProvider.addToMenu('My Config', {
        "link" : "#/gconfig",
        "active" : "main.gconfig",
        "title" : "My Global Configuration",
        "icon" : "icon-link",
        "page" : {
            "title" : "GConfig",
            "description" : "My first global config module"
        }
    });
});

return gconfig;
});

Content in gconfig.controller.js (empty define structure)

define(['app/topology/topology.module','app/topology/topology.services', 'app/topology/topology.directives'], function(topology, service) {

topology.register.controller('GConfigCtrl', ['$scope', '$rootScope', function ($scope, $rootScope) {
}]);
});

Content in gconfig.tpl.html is some basic html content.

File structure in dlux/bundles/gconfig/ :

./pom.xml
./src
./src/main
./src/main/resources
./src/main/resources/OSGI-INF
./src/main/resources/OSGI-INF/blueprint
./src/main/resources/OSGI-INF/blueprint/blueprint.xml

Content in blueprint.xml

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<reference id="httpService" availability="mandatory" activation="eager" interface="org.osgi.service.http.HttpService"/>
<reference id="loader" availability="mandatory" activation="eager" interface="org.opendaylight.dlux.loader.DluxModuleLoader"/>

<bean id="bundle" init-method="initialize" destroy-method="clean" class="org.opendaylight.dlux.loader.DluxModule">
  <property name="httpService" ref="httpService"/>
  <property name="loader" ref="loader"/>
  <property name="moduleName" value="gconfig "/>
  <property name="url" value="/src/app/gconfig"/>
  <property name="directory" value="/gconfig"/>
  <property name="requireJs" value="app/gconfig/gconfig.module"/>
  <property name="angularJs" value="app.gconfig"/>
</bean>
</blueprint>

Pick modules/gconfig/pom.xml and bundle/gconfig/pom.xml are same mentioned in wiki (change topology to gconfig).

At this point your mvn clean install should be working from gconfig folder in both modules and bundles.

Now, every thing in place. Only thing is remaining is adding these into dlux and karaf. Edit following files:

./modules/pom.xml
./dlux-web/pom.xml
./bundles/pom.xml:
./features/pom.xml:
./pom.xml

Search for 'topology' and add similar structure for gconfig in all above files.

Note: Adding to dlux features list. In

features/src/main/resources/features.xml

you can add gconfig as dlux core bundle (similar to topology). But I would suggest to add separate feature tag so later you can easily uninstall and install it ... (more)

edit flag offensive delete publish link more

Comments

Thanks Mandeep. I have used NavHelperProvider only. I have one query, that is wiki says building module contains two parts Application module & Application bundle Now i have created two separate folder structure as per wiki. & after compiling i am getting total 4 jars in module, dlux.vlan.resources-0.2.0-Lithium.jar dlux.vlan.resources-0.2.0-Lithium-sources.jar & in bundle , i got dlux.vlan-0.2.0-Lithium.jar dlux.vlan-0.2.0-Lithium-sources.jar which jar i should deploy in karaf ? Hope i following right steps of two folder structure . If possible please share your email id. Thanks, Harish

hjdeore ( 2015-09-02 03:47:26 -0800 )edit

I did not manually replacing any jars. I prefer uninstall and install my module specific feature... updated my answer for better clarity.

Mandeep ( 2015-09-02 05:10:21 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-09-01 00:34:55 -0800

Seen: 323 times

Last updated: Sep 02 '15