Tabnine Logo
Content.getProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
getProperties
method
in
it.tidalwave.northernwind.core.model.Content

Best Java code snippets using it.tidalwave.northernwind.core.model.Content.getProperties (Showing top 16 results out of 315)

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

  @Override @Nonnull
  public ResourceProperties getContentProperties()
   {
    if (contentHolder.get() == null) // FIXME: should never occur
     {
      log.warn("NO CONTENT IN CONTEXT");
//            Thread.dumpStack(); // FIXME
      return modelFactory.createProperties().build();
     }

    return contentHolder.get().getProperties();
   }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

 @Override
 public int compare (final @Nonnull Content post1, final @Nonnull Content post2)
  {
   final DateTime dateTime1 = post1.getProperties().getDateTimeProperty(DATE_KEYS, TIME0);
   final DateTime dateTime2 = post2.getProperties().getDateTimeProperty(DATE_KEYS, TIME0);
   return dateTime2.compareTo(dateTime1);
  }
};
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

/*******************************************************************************************************************
 *
 * Adds to {@code destinationPosts} all the {@code sourcePosts} that matches the selected {@code category}; all
 * posts if the category is empty.
 *
 * @param  sourcePosts          the source posts
 * @param  destinationPosts     the destination posts
 * @param  category             the category
 *
 ******************************************************************************************************************/
private void filterByCategory (final @Nonnull List<Content> sourcePosts,
                final @Nonnull List<Content> destinationPosts,
                final @Nonnull String category)
 {
  for (final Content post : sourcePosts)
   {
    try
     {
      if (category.equals("")
        || category.equals(post.getProperties().getProperty(PROPERTY_CATEGORY, "---")))
       {
        destinationPosts.add(post);
       }
     }
    catch (IOException e2)
     {
      log.warn("", e2);
     }
   }
 }
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

/*******************************************************************************************************************
 *
 * Adds to {@code destinationPosts} all the {@code sourcePosts} that matches the selected {@code tag}; all
 * posts if the category is empty.
 *
 * @param  sourcePosts          the source posts
 * @param  destinationPosts     the destination posts
 * @param  tag                  the tag
 *
 ******************************************************************************************************************/
private void filterByTag (final @Nonnull List<Content> sourcePosts,
             final @Nonnull List<Content> destinationPosts,
             final @Nonnull String tag)
 {
  for (final Content post : sourcePosts)
   {
    try
     {
      final List<String> tags = Arrays.asList(post.getProperties().getProperty(PROPERTY_TAGS, "").split(","));
      if (tags.contains(tag))
       {
        destinationPosts.add(post);
       }
     }
    catch (IOException e2)
     {
      log.warn("", e2);
     }
   }
 }
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

 @Override
 protected List<? extends SiteNode> computeResults()
  {
   log.info("findCompositeContents()");
   final List<SiteNode> results = new ArrayList<>();
   try
    {
     final ResourceProperties componentProperties = siteNode.getPropertyGroup(view.getId());
     for (final Content post : findAllPosts(componentProperties))
      {
       try
        {
         final ResourcePath relativeUri = siteNode.getRelativeUri().appendedWith(post.getExposedUri());
         results.add(new ChildSiteNode(siteNode, relativeUri, post.getProperties()));
        }
       catch (NotFoundException | IOException e)
        {
         log.warn("While reading properties", e);
        }
      }
    }
   catch (NotFoundException | IOException e)
    {
     log.warn("While reading property group", e);
    }
   log.info(">>>> returning: {}", results);
   return results;
  }
};
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

builder.append(script.getProperties().getProperty(PROPERTY_TEMPLATE));
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

 /*******************************************************************************************************************
  *
  * Returns the template.
  *
  ******************************************************************************************************************/
 @Nonnull
 private String getTemplate (final @Nonnull ResourceProperties viewProperties)
  throws IOException
  {
   try
    {
     final String templateRelativePath = viewProperties.getProperty(PROPERTY_WRAPPER_TEMPLATE_RESOURCE);
     final Content content = site.find(Content).withRelativePath(templateRelativePath).result();
     final ResourceProperties templateProperties = content.getProperties();
     return templateProperties.getProperty(PROPERTY_TEMPLATE, "$content$");
    }
   catch (NotFoundException e)
    {
     return "$content$";
    }
  }
}
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

for (final String tag : post.getProperties().getProperty(PROPERTY_TAGS).split(","))
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

htmlBuilder.append(content.getProperties().getProperty(PROPERTY_FULL_TEXT)).append("\n");
htmlBuilder.append(content.getProperties().getProperty(PROPERTY_TEMPLATE)).append("\n");
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

/*******************************************************************************************************************
 *
 * .
 *
 ******************************************************************************************************************/
private void setCustomTemplate (final @Nonnull ResourceProperties viewProperties)
 throws IOException
 {
  try
   {
    final String templateRelativePath = viewProperties.getProperty(PROPERTY_TEMPLATE_PATH);
    final Content template = site.find(Content).withRelativePath(templateRelativePath).result();
    view.setTemplate(template.getProperties().getProperty(PROPERTY_TEMPLATE));
   }
  catch (NotFoundException e)
   {
    log.warn("Cannot find custom template, using default ({})", e.toString());
   }
 }
origin: it.tidalwave.northernwind.rca/it-tidalwave-northernwind-rca-ui-content-editor

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@BeforeMethod
public void setup()
 {
  ContextManager.Locator.set(null);
  context = (ClassPathXmlApplicationContext)helper.createSpringContext();
  underTest = context.getBean(DefaultContentEditorPresentationControl.class);
  embeddedServer = context.getBean(EmbeddedServer.class);
  presentation = context.getBean(ContentEditorPresentation.class);
  content = mock(Content.class);
  properties = mock(ResourceProperties.class);
  presentable = mock(Presentable.class);
  pm = mock(PresentationModel.class);
  propertyBinder = mock(PropertyBinder.class);
  when(embeddedServer.putDocument(anyString(), any(Document.class))).thenReturn(registeredUrl);
  when(content.getProperties()).thenReturn(properties);
  when(presentable.createPresentationModel(anyVararg())).thenReturn(pm);
  when(properties.as(eq(Presentable))).thenReturn(presentable);
  when(properties.as(eq(PropertyBinder))).thenReturn(propertyBinder);
  document = new Document().withContent("proxy for: full text")
               .withMimeType("text/html");
  when(propertyBinder.createBoundDocument(any(Key.class), any(PropertyBinder.UpdateCallback.class)))
            .thenAnswer(invocation -> document);
  underTest.initialize();
 }
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

final ResourceProperties contentProperties = content.getProperties();
appendTitle(contentProperties, htmlFragmentBuilder, "h" + titleLevel++);
appendText(contentProperties, htmlFragmentBuilder);
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

/*******************************************************************************************************************
 *
 * {@inheritDoc}
 *
 ******************************************************************************************************************/
@Nonnull
protected String loadTemplate (final @Nonnull GalleryAdapterContext context, final @Nonnull String templateName)
 throws IOException
 {
  try
   {
    final SiteNode siteNode = context.getSiteNode();
    final GalleryView view = context.getView();
    final Site site = context.getSite();
    final ResourceProperties viewProperties = siteNode.getPropertyGroup(view.getId());
    final String templateRelativePath = viewProperties.getProperty(new Key<String>(templateName + "Path"));
    final Content template = site.find(Content).withRelativePath(templateRelativePath).result();
    return template.getProperties().getProperty(PROPERTY_TEMPLATE);
   }
  catch (NotFoundException e)
   {
    return loadDefaultTemplate(templateName + ".txt");
   }
 }

origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

post.getProperties().getProperty(PROPERTY_TITLE); // Skip folders used for categories - this throws exception
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

 @PostConstruct
 /* package */ void initialize()
  throws IOException
  {
   try
    {
     // First search the template in a path, which could be useful for retrieving from a library; if not
     // found, a property with the contents is searched.
     final ResourceProperties viewProperties = siteNode.getPropertyGroup(view.getId());
     final String templateRelativePath = viewProperties.getProperty(PROPERTY_TEMPLATE_PATH);
     final Content template = site.find(Content.class).withRelativePath(templateRelativePath).result();
     view.setTemplate(template.getProperties().getProperty(PROPERTY_TEMPLATE));
    }
   catch (NotFoundException e)
    {
     // ok, use the default template
    }
   final ResourceProperties viewProperties = siteNode.getPropertyGroup(view.getId());
   view.setClassName(viewProperties.getProperty(PROPERTY_CLASS, "nw-" + view.getId()));
  }
}
origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

view.setTemplate(template.getProperties().getProperty(PROPERTY_TEMPLATE));
it.tidalwave.northernwind.core.modelContentgetProperties

Popular methods of Content

  • getExposedUri
  • as
  • findChildren

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ImageIO (javax.imageio)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top PhpStorm 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