Quellcode durchsuchen

Fetch remote data of the activities table.

Iñigo Valentin vor 9 Jahren
Ursprung
Commit
e4e96f307e

+ 4 - 0
app.xcodeproj/project.pbxproj

@@ -8,6 +8,7 @@
 
 
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
 		931AA5891E1AFF8C003A2290 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 931AA5881E1AFF8C003A2290 /* String.swift */; };
 		931AA5891E1AFF8C003A2290 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 931AA5881E1AFF8C003A2290 /* String.swift */; };
+		931AA58B1E1DA911003A2290 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 931AA58A1E1DA910003A2290 /* CoreData.framework */; };
 		93B408031D9ED44C000FBC99 /* MenuCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B408021D9ED44C000FBC99 /* MenuCollectionViewCell.swift */; };
 		93B408031D9ED44C000FBC99 /* MenuCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B408021D9ED44C000FBC99 /* MenuCollectionViewCell.swift */; };
 		93B84B9A1D9C31AB006C0F67 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B84B991D9C31AB006C0F67 /* AppDelegate.swift */; };
 		93B84B9A1D9C31AB006C0F67 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B84B991D9C31AB006C0F67 /* AppDelegate.swift */; };
 		93B84B9C1D9C31AB006C0F67 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B84B9B1D9C31AB006C0F67 /* ViewController.swift */; };
 		93B84B9C1D9C31AB006C0F67 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B84B9B1D9C31AB006C0F67 /* ViewController.swift */; };
@@ -26,6 +27,7 @@
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
 		931AA5881E1AFF8C003A2290 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
 		931AA5881E1AFF8C003A2290 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
+		931AA58A1E1DA910003A2290 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
 		93B408021D9ED44C000FBC99 /* MenuCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MenuCollectionViewCell.swift; path = ../MenuCollectionViewCell.swift; sourceTree = "<group>"; };
 		93B408021D9ED44C000FBC99 /* MenuCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MenuCollectionViewCell.swift; path = ../MenuCollectionViewCell.swift; sourceTree = "<group>"; };
 		93B84B961D9C31AB006C0F67 /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		93B84B961D9C31AB006C0F67 /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		93B84B991D9C31AB006C0F67 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		93B84B991D9C31AB006C0F67 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -49,6 +51,7 @@
 			isa = PBXFrameworksBuildPhase;
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
+				931AA58B1E1DA911003A2290 /* CoreData.framework in Frameworks */,
 				93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */,
 				93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -98,6 +101,7 @@
 		93D9EA6F1DE37C7900089002 /* Frameworks */ = {
 		93D9EA6F1DE37C7900089002 /* Frameworks */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				931AA58A1E1DA910003A2290 /* CoreData.framework */,
 				93D9EA701DE37C7900089002 /* libsqlite3.tbd */,
 				93D9EA701DE37C7900089002 /* libsqlite3.tbd */,
 			);
 			);
 			name = Frameworks;
 			name = Frameworks;

BIN
app.xcodeproj/project.xcworkspace/xcuserdata/seavenois.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 1
app/AppDelegate.swift

@@ -26,6 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
 
 	var window: UIWindow?
 	var window: UIWindow?
 
 
+	
 
 
 	func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
 	func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
 		// Override point for customization after application launch.
 		// Override point for customization after application launch.
@@ -61,7 +62,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 	
 	
 	//Check: Why is this here?
 	//Check: Why is this here?
 
 
-	/*lazy var persistentContainer: NSPersistentContainer = {
+	 /*lazy var persistentContainer: NSPersistentContainer = {
 		/*
 		/*
 		 The persistent container for the application. This implementation
 		 The persistent container for the application. This implementation
 		 creates and returns a container, having loaded the store for the
 		 creates and returns a container, having loaded the store for the

+ 44 - 3
app/Sync.swift

@@ -19,16 +19,21 @@
 // If not, see <http://www.gnu.org/licenses/>.
 // If not, see <http://www.gnu.org/licenses/>.
 
 
 import Foundation
 import Foundation
+import CoreData
+import UIKit
 
 
 /**
 /**
  Class to handle server sync.
  Class to handle server sync.
  */
  */
 class Sync{
 class Sync{
 	
 	
+	var cnt: NSManagedObjectContext
+	
 	/**
 	/**
 	 Starts the sync process.
 	 Starts the sync process.
 	*/
 	*/
-	init(){
+	init(cnt: NSManagedObjectContext){
+		self.cnt = cnt
 		let url = buildUrl();
 		let url = buildUrl();
 		sync(url: url)
 		sync(url: url)
 	
 	
@@ -45,6 +50,8 @@ class Sync{
 		
 		
 	}
 	}
 	
 	
+	
+	
 	/**
 	/**
 	 Performs an asynchronous sync.
 	 Performs an asynchronous sync.
 	 It fethes the info from the server and stores as Core Data
 	 It fethes the info from the server and stores as Core Data
@@ -126,10 +133,15 @@ class Sync{
 	}
 	}
 	
 	
 	func saveTableActivity(entries : [String]){
 	func saveTableActivity(entries : [String]){
-		
+				
 		let dateFormatter = DateFormatter()
 		let dateFormatter = DateFormatter()
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		dateFormatter.timeZone = TimeZone.ReferenceType.local
 		
 		
+		let context = self.cnt //getContext()
+		let entity =  NSEntityDescription.entity(forEntityName: "Activity", in: context)
+		
+		var transc: NSManagedObject
+		
 		//TODO: Delete all previous entries
 		//TODO: Delete all previous entries
 		
 		
 		//Loop new entries
 		//Loop new entries
@@ -238,7 +250,36 @@ class Sync{
 			//Skipping comments
 			//Skipping comments
 			
 			
 			//TODO: Save CoreData
 			//TODO: Save CoreData
+			transc = NSManagedObject(entity: entity!, insertInto: context)
+			//set the entity values
+			transc.setValue(id, forKey: "id")
+			transc.setValue(permalink, forKey: "permalink")
+			transc.setValue(date, forKey: "date")
+			transc.setValue(city, forKey: "city")
+			transc.setValue(title_es, forKey: "title_es")
+			transc.setValue(title_en, forKey: "title_en")
+			transc.setValue(title_eu, forKey: "title_eu")
+			transc.setValue(text_es, forKey: "text_es")
+			transc.setValue(text_en, forKey: "text_en")
+			transc.setValue(text_eu, forKey: "text_eu")
+			transc.setValue(after_es, forKey: "after_es")
+			transc.setValue(after_en, forKey: "after_en")
+			transc.setValue(after_eu, forKey: "after_eu")
+			transc.setValue(price, forKey: "price")
+			transc.setValue(inscription, forKey: "inscription")
+			transc.setValue(maxPeople, forKey: "max_people")
+			if (album != -1){
+				transc.setValue(album, forKey: "album")
+			}
+
+			do {
+				try context.save()
+			} catch let error as NSError  {
+				print("Could not store Activity with id \(id) \(error), \(error.userInfo)")
+			} catch {
+				
+			}
+
 		}
 		}
 	}
 	}
-	
 }
 }

+ 9 - 2
app/ViewController.swift

@@ -19,6 +19,7 @@
 // If not, see <http://www.gnu.org/licenses/>.
 // If not, see <http://www.gnu.org/licenses/>.
 
 
 import UIKit
 import UIKit
+import CoreData
 
 
 /**
 /**
   The view controller of the app.
   The view controller of the app.
@@ -36,11 +37,17 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	@IBOutlet weak var containerViewLocation: UIView!
 	@IBOutlet weak var containerViewLocation: UIView!
 	@IBOutlet weak var containerViewHome: HomeView!
 	@IBOutlet weak var containerViewHome: HomeView!
 	
 	
+	func getContext () -> NSManagedObjectContext {
+		//let appDelegate = UIApplication.shared.delegate as! AppDelegate
+		//return appDelegate.persistentContainer.viewContext
+		return NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
+	}
+	
 	/**
 	/**
 	 Run when the app loads.
 	 Run when the app loads.
 	*/
 	*/
 	override func viewDidLoad() {
 	override func viewDidLoad() {
-		
+				
 		//Hide all sections, except for the first one
 		//Hide all sections, except for the first one
 		self.containerViewLocation.alpha = 0
 		self.containerViewLocation.alpha = 0
 		self.containerViewLablanca.alpha = 0
 		self.containerViewLablanca.alpha = 0
@@ -49,7 +56,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		self.containerViewGallery.alpha = 0
 		self.containerViewGallery.alpha = 0
 		
 		
 		print("ViewController:viewDidLoad()")
 		print("ViewController:viewDidLoad()")
-		Sync()
+		Sync(cnt: getContext())
 		
 		
 		super.viewDidLoad()
 		super.viewDidLoad()
 		// Do any additional setup after loading the view, typically from a nib.
 		// Do any additional setup after loading the view, typically from a nib.

+ 25 - 25
app/app.xcdatamodeld/app.xcdatamodel/contents

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11542" systemVersion="16B2657" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
-    <entity name="Activity" representedClassName="Activity" syncable="YES" codeGenerationType="class">
+<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11759" systemVersion="16B2657" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
+    <entity name="Activity" representedClassName=".Activity" syncable="YES" codeGenerationType="class">
         <attribute name="after_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_eu" optional="YES" attributeType="String" syncable="YES"/>
@@ -21,7 +21,7 @@
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Activity_comment" representedClassName="Activity_comment" syncable="YES" codeGenerationType="class">
+    <entity name="Activity_comment" representedClassName=".Activity_comment" syncable="YES" codeGenerationType="class">
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
@@ -29,13 +29,13 @@
         <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Activity_image" representedClassName="Activity_image" syncable="YES" codeGenerationType="class">
+    <entity name="Activity_image" representedClassName=".Activity_image" syncable="YES" codeGenerationType="class">
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Activity_itinerary" representedClassName="Activity_itinerary" syncable="YES" codeGenerationType="class">
+    <entity name="Activity_itinerary" representedClassName=".Activity_itinerary" syncable="YES" codeGenerationType="class">
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
@@ -48,11 +48,11 @@
         <attribute name="place" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="place" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="start" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="start" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Activity_tag" representedClassName="Activity_tag" syncable="YES" codeGenerationType="class">
+    <entity name="Activity_tag" representedClassName=".Activity_tag" syncable="YES" codeGenerationType="class">
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="tag" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="tag" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Album" representedClassName="Album" syncable="YES" codeGenerationType="class">
+    <entity name="Album" representedClassName=".Album" syncable="YES" codeGenerationType="class">
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
@@ -63,7 +63,7 @@
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Festival" representedClassName="Festival" syncable="YES" codeGenerationType="class">
+    <entity name="Festival" representedClassName=".Festival" syncable="YES" codeGenerationType="class">
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="img" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="img" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="summary_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="summary_en" optional="YES" attributeType="String" syncable="YES"/>
@@ -74,7 +74,7 @@
         <attribute name="text_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Festival_day" representedClassName="Festival_day" syncable="YES" codeGenerationType="class">
+    <entity name="Festival_day" representedClassName=".Festival_day" syncable="YES" codeGenerationType="class">
         <attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="name_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="name_en" optional="YES" attributeType="String" syncable="YES"/>
@@ -82,7 +82,7 @@
         <attribute name="name_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="name_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="price" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="price" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Festival_event" representedClassName="Festival_event" syncable="YES" codeGenerationType="class">
+    <entity name="Festival_event" representedClassName=".Festival_event" syncable="YES" codeGenerationType="class">
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
@@ -96,13 +96,13 @@
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Festival_event_image" representedClassName="Festival_event_image" syncable="YES" codeGenerationType="class">
+    <entity name="Festival_event_image" representedClassName=".Festival_event_image" syncable="YES" codeGenerationType="class">
         <attribute name="event" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="event" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Festival_offer" representedClassName="Festival_offer" syncable="YES" codeGenerationType="class">
+    <entity name="Festival_offer" representedClassName=".Festival_offer" syncable="YES" codeGenerationType="class">
         <attribute name="days" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="days" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
@@ -114,12 +114,12 @@
         <attribute name="price" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="price" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Location" representedClassName="Location" syncable="YES" codeGenerationType="class">
+    <entity name="Location" representedClassName=".Location" syncable="YES" codeGenerationType="class">
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="lat" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="lat" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="lon" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="lon" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Notification" representedClassName="Notification" syncable="YES" codeGenerationType="class">
+    <entity name="Notification" representedClassName=".Notification" syncable="YES" codeGenerationType="class">
         <attribute name="action" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="action" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="duration" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="duration" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
@@ -133,7 +133,7 @@
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Photo" representedClassName="Photo" syncable="YES" codeGenerationType="class">
+    <entity name="Photo" representedClassName=".Photo" syncable="YES" codeGenerationType="class">
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
@@ -151,11 +151,11 @@
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="width" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="width" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Photo_album" representedClassName="Photo_album" syncable="YES" codeGenerationType="class">
+    <entity name="Photo_album" representedClassName=".Photo_album" syncable="YES" codeGenerationType="class">
         <attribute name="album" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="album" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="photo" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="photo" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Place" representedClassName="Place" syncable="YES" codeGenerationType="class">
+    <entity name="Place" representedClassName=".Place" syncable="YES" codeGenerationType="class">
         <attribute name="address_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_eu" optional="YES" attributeType="String" syncable="YES"/>
@@ -167,7 +167,7 @@
         <attribute name="name_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="name_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="name_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="name_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Post" representedClassName="Post" syncable="YES" codeGenerationType="class">
+    <entity name="Post" representedClassName=".Post" syncable="YES" codeGenerationType="class">
         <attribute name="comments" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="comments" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
@@ -180,7 +180,7 @@
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Post_comment" representedClassName="Post_comment" syncable="YES" codeGenerationType="class">
+    <entity name="Post_comment" representedClassName=".Post_comment" syncable="YES" codeGenerationType="class">
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="lang" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="lang" optional="YES" attributeType="String" syncable="YES"/>
@@ -188,17 +188,17 @@
         <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Post_image" representedClassName="Post_image" syncable="YES" codeGenerationType="class">
+    <entity name="Post_image" representedClassName=".Post_image" syncable="YES" codeGenerationType="class">
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="idx" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="post" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="post" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Post_tag" representedClassName="Post_tag" syncable="YES" codeGenerationType="class">
+    <entity name="Post_tag" representedClassName=".Post_tag" syncable="YES" codeGenerationType="class">
         <attribute name="post" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="post" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="tag" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="tag" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Sponsor" representedClassName="Sponsor" syncable="YES" codeGenerationType="class">
+    <entity name="Sponsor" representedClassName=".Sponsor" syncable="YES" codeGenerationType="class">
         <attribute name="address_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="address_eu" optional="YES" attributeType="String" syncable="YES"/>
@@ -214,12 +214,12 @@
         <attribute name="text_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="text_eu" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     </entity>
-    <entity name="Version" representedClassName="Version" syncable="YES" codeGenerationType="class">
+    <entity name="Version" representedClassName=".Version" syncable="YES" codeGenerationType="class">
         <attribute name="section" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="section" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="version" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="version" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
     </entity>
     </entity>
     <elements>
     <elements>
-        <element name="Activity" positionX="-56" positionY="-4059" width="128" height="328"/>
+        <element name="Activity" positionX="-56" positionY="-4059" width="128" height="330"/>
         <element name="Activity_comment" positionX="-45" positionY="-3906" width="128" height="135"/>
         <element name="Activity_comment" positionX="-45" positionY="-3906" width="128" height="135"/>
         <element name="Activity_image" positionX="-36" positionY="-3897" width="128" height="105"/>
         <element name="Activity_image" positionX="-36" positionY="-3897" width="128" height="105"/>
         <element name="Activity_itinerary" positionX="-18" positionY="-3888" width="128" height="210"/>
         <element name="Activity_itinerary" positionX="-18" positionY="-3888" width="128" height="210"/>
@@ -231,7 +231,7 @@
         <element name="Festival_event_image" positionX="9" positionY="-3888" width="128" height="105"/>
         <element name="Festival_event_image" positionX="9" positionY="-3888" width="128" height="105"/>
         <element name="Festival_offer" positionX="18" positionY="-3879" width="128" height="195"/>
         <element name="Festival_offer" positionX="18" positionY="-3879" width="128" height="195"/>
         <element name="Location" positionX="27" positionY="-3870" width="128" height="90"/>
         <element name="Location" positionX="27" positionY="-3870" width="128" height="90"/>
-        <element name="Notification" positionX="36" positionY="-3861" width="128" height="30"/>
+        <element name="Notification" positionX="36" positionY="-3861" width="128" height="225"/>
         <element name="Photo" positionX="-9" positionY="-3906" width="128" height="285"/>
         <element name="Photo" positionX="-9" positionY="-3906" width="128" height="285"/>
         <element name="Photo_album" positionX="0" positionY="-3897" width="128" height="75"/>
         <element name="Photo_album" positionX="0" positionY="-3897" width="128" height="75"/>
         <element name="Place" positionX="9" positionY="-3888" width="128" height="195"/>
         <element name="Place" positionX="9" positionY="-3888" width="128" height="195"/>