New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A first version of having the possibility to create mobile apps #8045
Conversation
@@ -102,6 +102,14 @@ public function getTablesCreateSql() | |||
) ENGINE=$engine DEFAULT CHARSET=utf8 | |||
", | |||
|
|||
'site_setting' => "CREATE TABLE {$prefixTables}site_setting ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will store property settings in this table. The setting_value
will be serialized as a Setting
can define a type and we do not want to lose that type, eg an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be serialized using serialize()
? Unless it's really not practical it would be good to find alternatives instead of storing serialized strings: it is only readable by PHP, it forces us to keep the same class/property names for objects, the format could change (e.g. even today a Piwik install cannot be migrated from PHP to HHVM because of that: not same serialization format), etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be serialized for now yes. We might change it later but since it can store anything and we do need to keep the type of the setting_value
for now. json
etc would lose the type under circumstances eg Array
vs Objects
.
It doesn't store any instances there. Only array
, stdClass
, int
, float
, ...
32cc6e2
to
b5aec8c
Compare
I haven't had a look in details yet:
+1 for naming them with the |
We thought about many possible names for that and none of them was really good. Application is not really good as it could be anything, even a Retail Store. In the end we went with Something generic is actually good since it is a name for something generic, although not sure if "Projects" is better. Maybe there are some other suggestions by anyone? |
@@ -0,0 +1,4 @@ | |||
{ | |||
"name": "MobileAppType", | |||
"description": "Allows you to create Mobile Apps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested: Analytics for Mobile: lets you create 'Mobile App' properties. Measure user interactions on mobile with a SDK for iOS, Android or Titanium.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like Analytics for Mobile: lets you manage 'Mobile App' properties and creates an optimized perspective of your mobile data.
. The SDKs are rather irrelevant and what the type actually does is presenting the data in a different perspective by showing different reports, using different naming, etc.
Haven't looked much, quick wording suggestions:
Can you provide in the ticket description an overview of the entire system? |
@diosmosis If I understand correctly a E.g. type could be "Mobile App", and property could be "Uber" (which is a mobile app). The thing is I don't see what they are a property of? When I lookup the definition of the word, the closest thing is:
Or also:
I find this word very confusing as it suggests there is a larger entity to which properties are attached (and properties "describe" this larger entity). How about
|
definitely it's good to discuss whether there is a better name
eg. a website property is an abstract quality of an individual (or organisation or business) It is a bit far fetched but it works
|
Not really. In the future we will not only have Trackable things. We will also import data etc.
What do you mean of the entire system? I haven't added "much" yet so not sure what do describe.
That could work. I think they see "Property" rather as "Possessions/Goods/Wares/Things/Movables/..." it's also a synonym for Resource. As a developer we might see this rather from a technical view which makes it more confusing for us than for users. The closest definition that you mentioned are only the closest from a technical view, not from an everyday English equivalent. When choosing a name please also keep in mind that we do not only want to have tracked "things" but also imported "things" etc.
Yep that's pretty much it. A property can be associated with any type, eg "Mobile App". |
I think I understand what you're saying, measuring relates more to individual metrics (ie, measuring length or measuring time) rather than whole reports. Which isn't to say tracking relates to reporting in any way. It just doesn't make you think about measurements vs aggregated reports, so you don't notice it. I suppose this is a variation of the problem w/ Trackable, which makes you think of tracking, even though tracking may not be involved. I think Measurable still works as viable wording though, and it's definitely better than Property/Resource, IMO ;) |
So from my understanding we go with I'd maybe also rename the plugins |
+1 For the plugins we could name them on what they do (what they bring to Piwik): e.g. |
/** | ||
* Provides access to individual properties. | ||
*/ | ||
class Property extends Site |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does property/measurable extends site (and not the other way around)? Is it only a shortcut for now (will be changed later)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will most likely change it later. For now not really important. I only want to add this feature on top of the current solution as simple as possible so we can later easily change it again
|
Actually, after starting to rename them I'm not sure about |
The classes |
Changed the naming to Renamed the plugins to |
use Piwik\Plugin\Manager as PluginManager; | ||
use Piwik\Measurable\Type; | ||
|
||
class Manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could avoid another Manager
class that would be great :)
use Piwik\Plugin\Manager as PluginManager
are so boring to write (e.g. in this very file), and Manager
type-hints are confusing. TypeManager
or MeasurableTypeManager
? (I have no preference between both)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename it but we should discuss this in general at some point. I don't mind writing the as
statements. MeasurableTypeManager
then we can also just avoid namespaces and put everything in one folder :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed it to TypeManager
. Btw I often just write Type\Manager
see eg 1e9e91b#diff-700dbb21e8c2b2cf9dc0a56a71eb86b4L49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created follow up issue #8115
one last comment about a class name (above) and looks good to me |
Hi @kaz231 - this is the Pull request that should help you with Mobile App Manager. feel free to ask thomas any question if you have! |
A first version of having the possibility to create mobile apps
refs #7893
fixes #7803
New wording
Sites
but onProperties
. Not for now though...This is only a first version since we will need this feature for a Piwik Pro plugin soon. To make it really nice we need to refactor the Settings API (which let's you currently create PluginSettings only, so everything is related to plugins, not properties). Also we need to change many other things and this is not doable in a short time frame. Therefore I made it more or less "work". It will be a bit nicer for Piwik 3.0.0 when we can also change APIs and spend more time on it. None of the new
PropertySettings
API etc will be actually public API as we will remove/change it very soon again.There are new plugins
WebsiteType
andMobileAppType
. Let me now re naming. I can name it onlyWebsite
andMobileApp
but we might want to use this for other things in the future. I do not really mind.MobileAppType
is disabled by default so far most users nothing really changes. I do not think we will announce this MobileAppType thing big is it does not yet have a real value. This will be added over time.Once multiple types are enabled we use "Add new property" (in Sites Management only so far) and we will let a user choose what type to create. The PropertySettings API let's you define custom settings for properties. Eg the type MobileAppType defines a custom setting "App ID". On top plugins can add custom settings for all properties or only settings for a certain type.
@mattab you might want to have a look re the descriptions in the Types. I will leave a note in the code.