Tabnine Logo
PortalPage.getLayout
Code IndexAdd Tabnine to your IDE (free)

How to use
getLayout
method
in
com.atlassian.jira.portal.PortalPage

Best Java code snippets using com.atlassian.jira.portal.PortalPage.getLayout (Showing top 8 results out of 315)

origin: com.atlassian.jira/jira-core

@Override
public List<List<PortletConfiguration>> getPortletConfigurations(final Long portalPageId)
{
  final List<List<PortletConfiguration>> columns = new ArrayList<List<PortletConfiguration>>();
  final List<PortletConfiguration> portletConfigurations = portletConfigurationManager.getByPortalPage(portalPageId);
  final PortalPage portalPage = getPortalPageById(portalPageId);
  if ((portalPage != null) && !portletConfigurations.isEmpty())
  {
    initColumns(portalPage.getLayout().getNumberOfColumns(), columns);
    for (final PortletConfiguration portletConfiguration : portletConfigurations)
    {
      final int column = portletConfiguration.getColumn();
      columns.get(column).add(portletConfiguration);
    }
    //Once all portlet configs are inserted, sort each column then make it an unmodifieable list.
    for (int i = 0; i < columns.size(); i++)
    {
      final List<PortletConfiguration> column = columns.get(i);
      Collections.sort(column);
      columns.set(i, Collections.<PortletConfiguration> unmodifiableList(column));
    }
  }
  return Collections.unmodifiableList(columns);
}
origin: com.atlassian.jira/jira-core

private void updatePortalPage(final PortalPage portalPage, final DashboardState dashboardState)
{
  //update the portalPageStore's title and layout if they changed.
  if (!portalPage.getLayout().equals(dashboardState.getLayout()) ||
      !StringUtils.equals(portalPage.getName(), dashboardState.getTitle()))
  {
    final PortalPage.Builder builder = PortalPage.portalPage(portalPage);
    builder.name(dashboardState.getTitle());
    builder.layout(dashboardState.getLayout());
    portalPageStore.update(builder.build());
  }
}
origin: com.atlassian.jira/jira-api

public Builder portalPage(PortalPage page)
{
  id = page.getId();
  name = page.getName();
  description = page.getDescription();
  isSystemDashboard = page.isSystemDefaultPortalPage();
  favouriteCount = page.getFavouriteCount();
  permissions = page.getPermissions();
  layout = page.getLayout();
  owner = page.getOwner();
  version = page.getVersion();
  return this;
}
origin: com.atlassian.jira/jira-core

@Override
public PortalPage createBasedOnClone(final ApplicationUser pageOwner, final PortalPage portalPage, final PortalPage clonePortalPage)
{
  assertCreate(portalPage);
  notNull("clonePortalPage", clonePortalPage);
  //need to set the layout here since it determines the number of columns for the new portal page.  (JRA-16991)
  final PortalPage portalPageToCreate = PortalPage.portalPage(portalPage).layout(clonePortalPage.getLayout()).build();
  final PortalPage newPortalPage = createNoEvent(portalPageToCreate);
  clonePortletsFromOnePageToAnother(pageOwner, clonePortalPage, newPortalPage);
  eventPublisher.publish(new DashboardCreated(newPortalPage, authenticationContext.getUser()));
  return newPortalPage;
}
origin: com.atlassian.jira/jira-core

.version(portalPage.getVersion() == null ? 1L : portalPage.getVersion())
.dashboardColumns(dashboardColumns)
.layout(portalPage.getLayout())
.build();
origin: com.atlassian.jira/jira-core

public PortalPage create(final PortalPage portalPage)
{
  Assertions.notNull("portalPage", portalPage);
  Assertions.notNull("portalPage.name", portalPage.getName());
  Assertions.notNull("portalPage.owner", portalPage.getOwner());
  final GenericValue gv = delegator.createValue(Table.NAME, MapBuilder.<String, Object>newBuilder().
      add(Column.PAGENAME, portalPage.getName()).
      add(Column.DESCRIPTION, portalPage.getDescription()).
      add(Column.USERNAME, portalPage.getOwner().getKey()).
      add(Column.FAVCOUNT, 0L).
      add(Column.LAYOUT, portalPage.getLayout().name()).
      add(Column.VERSION, 0L).
      toMap());
  return gvToPortalPage(gv);
}
origin: com.atlassian.jira/jira-core

public void visit(final UpdateLayoutChange updateLayoutChange)
{
  final Long dashboardId = toLong(updateDashboardState.getId());
  final PortalPage portalPage = portalPageStore.getPortalPage(dashboardId);
  if (!portalPage.getLayout().equals(updateLayoutChange.getLayout()))
  {
    portalPageStore.update(PortalPage.portalPage(portalPage).layout(updateLayoutChange.getLayout()).build());
  }
  final GadgetLayout newLayout = updateLayoutChange.getGadgetLayout();
  for (int column = 0; column < newLayout.getNumberOfColumns(); column++)
  {
    int row = 0;
    final Iterable<GadgetId> gadgets = newLayout.getGadgetsInColumn(column);
    for (GadgetId gadgetId : gadgets)
    {
      final Long gadgetIdLong = toLong(gadgetId);
      final PortletConfiguration portletConfiguration = portletConfigurationStore.getByPortletId(gadgetIdLong);
      if (portletConfiguration.getColumn() != column || portletConfiguration.getRow() != row)
      {
        portletConfigurationStore.updateGadgetPosition(gadgetIdLong, row, column, dashboardId);
      }
      row += 1;
    }
  }
}
origin: com.atlassian.jira/jira-core

public PortalPage update(final PortalPage portalPage)
{
  Assertions.notNull("portalPage", portalPage);
  Assertions.notNull("portalPage.id", portalPage.getId());
  if (!portalPage.isSystemDefaultPortalPage())
  {
    Assertions.notNull("portalPage.owner", portalPage.getOwner());
  }
  final GenericValue gv = findByPrimaryKey(portalPage.getId());
  gv.setString(Column.PAGENAME, portalPage.getName());
  gv.setString(Column.DESCRIPTION, portalPage.getDescription());
  if (!portalPage.isSystemDefaultPortalPage())
  {
    gv.setString(Column.USERNAME, portalPage.getOwner().getKey());
  }
  else
  {
    gv.remove(Column.USERNAME);
  }
  gv.remove(Column.FAVCOUNT);
  gv.setString(Column.LAYOUT, portalPage.getLayout().name());
  delegator.store(gv);
  return getPortalPage(portalPage.getId());
}
com.atlassian.jira.portalPortalPagegetLayout

Popular methods of PortalPage

  • getId
  • getName
  • getDescription
  • getFavouriteCount
  • getOwner
  • getPermissions
  • getVersion
  • isSystemDefaultPortalPage
  • name
  • <init>
  • getEntityType
  • getOwnerKey
  • getEntityType,
  • getOwnerKey,
  • getOwnerUserName,
  • id,
  • portalPage

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFrame (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now