当前位置: 首页>>代码示例>>Java>>正文


Java NavigationItemDbLoader类代码示例

本文整理汇总了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());
}
 
开发者ID:eveoh,项目名称:blackboard-mytimetable,代码行数:27,代码来源:ConfigUtil.java

示例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 );
  }
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:36,代码来源:SendEmailProvider.java

示例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;
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:10,代码来源:UserManagerProvider.java

示例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;
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:11,代码来源:UserManagerProvider.java

示例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;
}
 
开发者ID:blackboard,项目名称:hayabusa,代码行数:81,代码来源:ThemeProvider.java


注:本文中的blackboard.persist.navigation.NavigationItemDbLoader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。