本文整理汇总了Java中blackboard.data.navigation.NavigationItem类的典型用法代码示例。如果您正苦于以下问题:Java NavigationItem类的具体用法?Java NavigationItem怎么用?Java NavigationItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavigationItem类属于blackboard.data.navigation包,在下文中一共展示了NavigationItem类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: redirectUser
import blackboard.data.navigation.NavigationItem; //导入依赖的package包/类
/**
* Redirects the user back the the manage plugins page, with a 'configuration saved' message.
*
* @param response {@link HttpServletResponse} belonging to the current request.
*
* @throws IOException if the redirect cannot be executed.
*/
public static void redirectUser(HttpServletResponse response) throws IOException {
StringBuffer returnUrl = new StringBuffer("");
// generate a final cancelUrl
try {
NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
NavigationItem navItem = niLoader.loadByInternalHandle("admin_plugin_manage");
returnUrl.append(navItem.getHref());
} catch (blackboard.persist.KeyNotFoundException kE) {
returnUrl.append("/webapps/blackboard/admin/manage_plugins.jsp");
} catch (blackboard.persist.PersistenceException pE) {
returnUrl.append("/webapps/blackboard/admin/manage_plugins.jsp");
}
returnUrl.append("?");
returnUrl.append(InlineReceiptUtil.SIMPLE_STRING_KEY);
returnUrl.append("=");
returnUrl.append("Configuration saved.");
response.sendRedirect(returnUrl.toString());
}
示例2: getPersonalEditNics
import blackboard.data.navigation.NavigationItem; //导入依赖的package包/类
private List<NavigationItemControl> getPersonalEditNics() throws PersistenceException
{
NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
// For Personal Info Edit
List<NavigationItem> personalEditNis = Lists.newArrayList( niLoader.loadByInternalHandle( "my_inst_personal_edit" ),
niLoader.loadByInternalHandle( "my_inst_personal_change_password" ) );
List<NavigationItemControl> personalEditNics = NavigationItemControl.createList( personalEditNis );
return personalEditNics;
}
示例3: getUserAdminNics
import blackboard.data.navigation.NavigationItem; //导入依赖的package包/类
private List<NavigationItemControl> getUserAdminNics() throws PersistenceException
{
NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
// For admin
List<NavigationItem> userAdminNis = Lists.newArrayList( niLoader.loadByInternalHandle( "create_user" ),
niLoader.loadByInternalHandle( "batch_create_users" ),
niLoader.loadByInternalHandle( "batch_remove_users" ) );
List<NavigationItemControl> userAdminNics = NavigationItemControl.createList( userAdminNis );
return userAdminNics;
}
示例4: createNavigationItem
import blackboard.data.navigation.NavigationItem; //导入依赖的package包/类
protected void createNavigationItem() {
NavigationItem ni = new NavigationItem();
String appName = this.b2Context.getVendorId() + "-" + this.b2Context.getHandle() + this.toolId;
ni.setInternalHandle(appName + this.type + "-1");
if (this.tool != null) {
ni.setLabel(this.tool.getName());
ni.setDescription(this.tool.getDescription());
ni.setHref(this.b2Context.getPath() + this.url + Constants.TOOL_ID + "=" + this.tool.getId());
ni.setSrc(this.b2Context.getPath() + "[email protected]@[email protected]@&" + Constants.TOOL_ID + "=" + this.tool.getId());
} else {
ni.setLabel(this.b2Context.getResourceString("plugin.name", b2Context.getVendorId() + "-" + b2Context.getHandle()));
ni.setDescription(this.b2Context.getResourceString("plugin.description", ""));
ni.setHref(this.b2Context.getPath() + this.url);
ni.setSrc(this.b2Context.getPath() + "icon.jsp");
}
ni.setApplication(appName + this.type);
ni.setFamily("0");
ni.setSubGroup("");
this.navItem = ni;
this.setIsAvailable();
this.navChanged = true;
}
示例5: getCommands
import blackboard.data.navigation.NavigationItem; //导入依赖的package包/类
@Override
public Iterable<Command> getCommands()
{
List<Theme> themes = ThemeManagerFactory.getInstance().getAllThemes();
Set<Command> commands = Sets.newTreeSet();
Context bbCtxt = ContextManagerFactory.getInstance().getContext();
NavigationItem ni = null;
List<PortalBranding> portalBrandings = null;
PortalBranding currentPortalBranding = null;
Branding branding = null;
ColorPalette colorPalette = null;
Theme currentTheme = null;
try
{
NavigationItemDbLoader niDbLoader = NavigationItemDbLoader.Default.getInstance();
ni = niDbLoader.loadByInternalHandle( "pa_customize_brand" );
NavigationItemControl nic = NavigationItemControl.createInstance( ni );
if ( !nic.userHasAccess() )
{
return commands;
}
currentTheme = BrandingUtil.getCurrentBrandTheme( bbCtxt.getHostName() );
branding = BrandingManager.Factory.getInstance().getBrandingByHostNameAndRole( bbCtxt.getHostName(), null );
ColorPaletteManager colorPaletteManager = ColorPaletteManagerFactory.getInstance();
colorPalette = colorPaletteManager.getColorPaletteByBrandingId( branding.getId() );
PortalBrandingDbLoader pbLoader = PortalBrandingDbLoader.Default.getInstance();
portalBrandings = pbLoader.loadByThemeId( currentTheme.getId() );
}
catch ( Exception e )
{
throw new PersistenceRuntimeException( e );
}
for ( PortalBranding pb : portalBrandings )
{
if ( pb.isDefault() )
{
currentPortalBranding = pb;
break;
}
}
for ( Theme theme : themes )
{
String themeExtRef = theme.getExtRef();
HashMap<String, String> params = new HashMap<String, String>();
params.put( "cmd", "save" );
params.put( "brand_id", branding.getId().getExternalString() );
params.put( "pageType", "Navigation" );
params.put( "usesCustomBrand", "true" );
params.put( "startThemeExtRef", currentTheme.getExtRef() );
String colorExtRef = "";
if ( colorPalette != null )
{
colorExtRef = colorPalette.getExtRef();
}
params.put( "startPaletteExtRef", colorExtRef );
params.put( "color_palette_extRef", colorExtRef );
params.put( "theme_extRef", themeExtRef );
params.put( "deleteBrandCss", "false" );
params.put( "tabStyle", currentTheme.getTabStyle().getAbbrevString() );
params.put( "tabAlign", currentTheme.getTabAlignment().toString() );
params.put( "frameSize", currentTheme.getFrameSize().toString() );
params.put( "bannerImage_attachmentType", "AL" );
params.put( "bannerImage_fileId", currentPortalBranding.getBannerImage() );
params.put( "bannerImage_LocalFile0", "" );
params.put( "bannerImageLink", currentPortalBranding.getBannerUrl() );
params.put( "bannerAltText", currentPortalBranding.getBannerText() );
params.put( "pde_institution_role", bbCtxt.getUser().getPortalRoleId().toExternalString() );
params.put( "courseNameUsage", branding.getCourseNameUsage().toExternalString() );
params.put( NonceUtil.NONCE_KEY, NonceUtil.create( bbCtxt.getSession(), NONCE_ID, NONCE_CONTEXT ) );
commands.add( new PostCommand( themeExtRef, URI, Category.THEME, params, "multipart/form-data" ) );
}
return commands;
}