AnsweredAssumed Answered

Migrate custom widget from Jive 6 to Jive 7

Question asked by applebeary on Nov 24, 2014

Hi All,

 

I got a problem when migrate my widget from Jive 6 to Jive 7...

 

There was no error when I created and built this Jive 7 widget.. but after I installed it, it was just not working. "Edit widget", "Remove widget" buttons were not working, and there was no preview. (This widget is working well on Jive 6 instance) 

 

The .java file is like:

 

package com.jivesoftware.plugin.widget;

 

 

import com.jivesoftware.base.UserManager;

import com.jivesoftware.community.annotations.PropertyNames;

import com.jivesoftware.community.widget.*;

import org.apache.log4j.Logger;

 

 

import java.util.Map;

 

 

/* use WidgetTypeMarker to set what kinds of places we would put this widget */

@WidgetTypeMarker({WidgetType.SOCIALGROUP, WidgetType.HOMEPAGE, WidgetType.PROJECT})

 

public class MyWidget extends BaseWidget {

 

 

    private static final Logger log = Logger.getLogger(GitHubActivity.class);

    private UserManager userManager;

 

 

    /*Widget Description, shows on the preview*/

    public String getDescription(WidgetContext widgetContext){

        return "My description.....";

    }

 

    public String render(WidgetContext widgetContext, ContainerSize containerSize){

        // display my contents, return html string

    }

 

 

    protected Map<String, Object> loadProperties(WidgetContext widgetContext, ContainerSize containerSize){

        Map<String, Object> properties=super.loadProperties(widgetContext,containerSize);

        String communityName=((CommunityWidgetContext)widgetContext).getCommunity().getName();

        String userName=widgetContext.getUser().getName();

 

 

 

        properties.put("userName",userName);

 

        return properties;

    }

}

 

 

Anywhere I need to make changes to make it work on Jive 7?

 

Thank you!

Best Regards,

Yulan

Outcomes