package com.smartling.marketo.sdk.domain.folder;

import java.util.Date;

public class FolderDetails {

    private static final String EMAIL_FOLDER_TYPE = "Email";
    private static final String FORM_FOLDER_TYPE = "Landing Page Form";
    private static final String LANDING_PAGE_FOLDER_TYPE = "Landing Page";
    private static final String PROGRAM_FOLDER_TYPE = "Email Batch Program";
    private static final String EVENT_FOLDER_TYPE = "Marketing Event";
    private static final String MARKETING_FOLDER_TYPE = "Marketing Folder";

    private String name;
    private String description;
    private Date createdAt;
    private Date updatedAt;
    private String url;
    private FolderId folderId;
    private String folderType;
    private FolderId parent;
    private String path;
    private boolean isArchive;
    private boolean isSystem;
    private int accessZoneId;
    private String workspace;
    private int id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public FolderId getFolderId() {
        return folderId;
    }

    public void setFolderId(FolderId folderId) {
        this.folderId = folderId;
    }

    public String getFolderType() {
        return folderType;
    }

    public void setFolderType(String folderType) {
        this.folderType = folderType;
    }

    public FolderId getParent() {
        return parent;
    }

    public void setParent(FolderId parent) {
        this.parent = parent;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public boolean isArchive() {
        return isArchive;
    }

    public void setIsArchive(boolean isArchive) {
        this.isArchive = isArchive;
    }

    public boolean isSystem() {
        return isSystem;
    }

    public void setIsSystem(boolean isSystem) {
        this.isSystem = isSystem;
    }

    public int getAccessZoneId() {
        return accessZoneId;
    }

    public void setAccessZoneId(int accessZoneId) {
        this.accessZoneId = accessZoneId;
    }

    public String getWorkspace() {
        return workspace;
    }

    public void setWorkspace(String workspace) {
        this.workspace = workspace;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isFolderForEmails() {
        return this.folderType.equals(EMAIL_FOLDER_TYPE) ||
                this.folderType.equals(EVENT_FOLDER_TYPE) ||
                this.folderType.equals(PROGRAM_FOLDER_TYPE) ||
                (this.folderType.equals(MARKETING_FOLDER_TYPE) && this.parent.getType().equals(FolderType.PROGRAM));
    }

    public boolean isFolderForForms() {
        return this.folderType.equals(FORM_FOLDER_TYPE) ||
                this.folderType.equals(EVENT_FOLDER_TYPE) ||
                this.folderType.equals(PROGRAM_FOLDER_TYPE) ||
                (this.folderType.equals(MARKETING_FOLDER_TYPE) && this.parent.getType().equals(FolderType.PROGRAM));
    }

    public boolean isFolderForLandingPages() {
        return this.folderType.equals(LANDING_PAGE_FOLDER_TYPE) ||
                this.folderType.equals(EVENT_FOLDER_TYPE) ||
                this.folderType.equals(PROGRAM_FOLDER_TYPE) ||
                (this.folderType.equals(MARKETING_FOLDER_TYPE) && this.parent.getType().equals(FolderType.PROGRAM));
    }
}

@@ -97,16 +97,37 @@
 ails %7B%0A%0A
+    // Design Studio%0A
     priv
@@ -179,16 +179,16 @@
 Email%22;%0A
-
     priv
@@ -325,16 +325,143 @@
 g Page%22;
+%0A%0A    // Marketing Folder%0A    private static final String MARKETING_FOLDER_TYPE = %22Marketing Folder%22;%0A%0A    // Marketing Program
 %0A    pri
@@ -635,38 +635,39 @@
 tring MARKETING_
-FOLDER
+PROGRAM
 _TYPE = %22Marketi
@@ -661,38 +661,113 @@
 PE = %22Marketing 
-Folder
+Program%22;%0A    private static final String NURTURE_PROGRAM_TYPE = %22Nurture Program
 %22;%0A%0A    private 
@@ -3347,247 +3347,34 @@
 ) %7C%7C
-%0A                this.folderType.equals(EVENT_FOLDER_TYPE) %7C%7C%0A                this.folderType.equals(PROGRAM_FOLDER_TYPE) %7C%7C%0A                (this.folderType.equals(MARKETING_FOLDER_TYPE) && this.parent.getType().equals(FolderType.PROGRAM)
+ isMarketingProgramFolder(
 );%0A 
@@ -3481,150 +3481,106 @@
 ) %7C%7C
-%0A                this.folderType.equals(EVENT_FOLDER_TYPE) %7C%7C
+ isMarketingProgramFolder();
 %0A    
+%7D%0A%0A
     
-        this.folderType.equals(PROGRAM_FOLDER_TYPE) %7C%7C%0A                (
+public boolean isFolderForLandingPages() %7B%0A        return 
 this
@@ -3594,33 +3594,36 @@
 Type.equals(
-MARKETING
+LANDING_PAGE
 _FOLDER_TYPE
@@ -3628,59 +3628,36 @@
 PE) 
-&& this.parent.getType().equals(FolderType.PROGRAM)
+%7C%7C isMarketingProgramFolder(
 );%0A 
@@ -3659,37 +3659,38 @@
 ();%0A    %7D%0A%0A    p
-ublic
+rivate
  boolean isFolde
@@ -3684,37 +3684,38 @@
 olean is
-FolderForLandingPages
+MarketingProgramFolder
 () %7B%0A   
@@ -3745,36 +3745,29 @@
 Type.equals(
-LANDING_PAGE
+EVENT
 _FOLDER_TYPE
@@ -3763,33 +3763,32 @@
 FOLDER_TYPE) %7C%7C%0A
- 
                t
@@ -3801,37 +3801,39 @@
 lderType.equals(
-EVENT
+PROGRAM
 _FOLDER_TYPE) %7C%7C
@@ -3825,33 +3825,32 @@
 FOLDER_TYPE) %7C%7C%0A
- 
                t
@@ -3867,32 +3867,40 @@
 Type.equals(
+NURTURE_
 PROGRAM_
 FOLDER_TYPE)
@@ -3879,39 +3879,32 @@
 NURTURE_PROGRAM_
-FOLDER_
 TYPE) %7C%7C%0A       
@@ -3915,10 +3915,8 @@
     
- (
 this
@@ -3948,53 +3948,63 @@
 ING_
-FOLDER_TYPE) && this.parent.get
+PROGRAM_TYPE) %7C%7C%0A               this.folder
 Type
-()
 .equals(
 Fold
@@ -4003,27 +4003,29 @@
 als(
-FolderType.PROGRAM)
+MARKETING_FOLDER_TYPE
 );%0A 

Change logic of determining if particular asset can be searched in the given folder