本文整理汇总了Java中blackboard.persist.navigation.NavigationItemDbLoader类的典型用法代码示例。如果您正苦于以下问题:Java NavigationItemDbLoader类的具体用法?Java NavigationItemDbLoader怎么用?Java NavigationItemDbLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavigationItemDbLoader类属于blackboard.persist.navigation包,在下文中一共展示了NavigationItemDbLoader类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: redirectUser
import blackboard.persist.navigation.NavigationItemDbLoader; //导入依赖的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: getCommands
import blackboard.persist.navigation.NavigationItemDbLoader; //导入依赖的package包/类
@Override
public Iterable<Command> getCommands()
{
try
{
// TODO wire these dependencies as fields/constructor inject
NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
// For admin
List<NavigationItemControl> nics_admin = NavigationItemControl.createList( niLoader
.loadByFamily( INTERNAL_HANDLER ) );
ModuleDbLoader moduleLoader = ModuleDbLoader.Default.getInstance();
Module module = moduleLoader.loadByExtRef( "platform/admin-tools" );
NavigationItemControl family = NavigationItemControl.createInstance( niLoader
.loadByInternalHandle( INTERNAL_HANDLER ) );
Set<Command> commands = Sets.newTreeSet();
for ( NavigationItemControl nic : nics_admin )
{
if ( !nic.userHasAccess() )
{
continue;
}
String title = String.format( "%s - %s: %s", module.getTitle(), family.getLabel(), nic.getLabel() );
String url = FramesetUtil.getTabGroupUrl(blackboard.data.navigation.Tab.TabType.admin, nic.getUrl());
commands.add( new SimpleCommand( title, url, Category.SYSTEM_ADMIN ) );
}
return commands;
}
catch ( PersistenceException e )
{
throw new PersistenceRuntimeException( e );
}
}
示例3: getPersonalEditNics
import blackboard.persist.navigation.NavigationItemDbLoader; //导入依赖的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;
}
示例4: getUserAdminNics
import blackboard.persist.navigation.NavigationItemDbLoader; //导入依赖的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;
}
示例5: getCommands
import blackboard.persist.navigation.NavigationItemDbLoader; //导入依赖的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;
}