本文整理匯總了Java中blackboard.persist.navigation.NavigationItemDbLoader.loadByInternalHandle方法的典型用法代碼示例。如果您正苦於以下問題:Java NavigationItemDbLoader.loadByInternalHandle方法的具體用法?Java NavigationItemDbLoader.loadByInternalHandle怎麽用?Java NavigationItemDbLoader.loadByInternalHandle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類blackboard.persist.navigation.NavigationItemDbLoader
的用法示例。
在下文中一共展示了NavigationItemDbLoader.loadByInternalHandle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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()
{
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;
}