base/src/sqwl/cms/datamodel.scala
changeset 33 fa0f19a74283
parent 27 8529ce302f7c
equal deleted inserted replaced
32:2d14f02ba3bd 33:fa0f19a74283
       
     1 /*
       
     2  * Copyright 2018-2020 Tomas Zeman <tomas@functionals.cz>
       
     3  *
       
     4  * Licensed under the Apache License, Version 2.0 (the "License");
       
     5  * you may not use this file except in compliance with the License.
       
     6  * You may obtain a copy of the License at
       
     7  *
       
     8  *     http://www.apache.org/licenses/LICENSE-2.0
       
     9  *
       
    10  * Unless required by applicable law or agreed to in writing, software
       
    11  * distributed under the License is distributed on an "AS IS" BASIS,
       
    12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13  * See the License for the specific language governing permissions and
       
    14  * limitations under the License.
       
    15  */
     1 package sqwl.cms
    16 package sqwl.cms
     2 
    17 
     3 import java.nio.file.Path
    18 import java.nio.file.Path
       
    19 
       
    20 import scalatags.Text.all._
     4 
    21 
     5 trait Named {
    22 trait Named {
     6   def name: String
    23   def name: String
     7 }
    24 }
     8 
    25 
    14 
    31 
    15 trait iTag extends Named with Navigable
    32 trait iTag extends Named with Navigable
    16 
    33 
    17 trait iArticle extends Navigable {
    34 trait iArticle extends Navigable {
    18   def title: String
    35   def title: String
    19   def htmlContent: String
    36   def htmlContent: SeqFrag[Frag]
    20   def category: Option[iCategory]
    37   def category: Option[iCategory]
    21   def tags: Seq[iTag]
    38   def tags: Seq[iTag]
    22   def assets: Path
       
    23   def rank: Int
    39   def rank: Int
    24 }
    40 }
    25 
    41 
    26 trait iContent {
    42 trait iContent {
    27   def appTitle: String
    43   def appTitle: String
    34   def tags: Seq[iTag]
    50   def tags: Seq[iTag]
    35   def categories: Seq[iCategory]
    51   def categories: Seq[iCategory]
    36   def articleByPath(path: String): Option[iArticle]
    52   def articleByPath(path: String): Option[iArticle]
    37   def categoryByPath(path: String): Option[iCategory]
    53   def categoryByPath(path: String): Option[iCategory]
    38   def tagByPath(path: String): Option[iTag]
    54   def tagByPath(path: String): Option[iTag]
       
    55   def articleAssets(a: iArticle): Path
    39 }
    56 }