gklyne / annalist Goto Github PK
View Code? Open in Web Editor NEWFree-form web data notebook - "Data management for little guys"
License: MIT License
Free-form web data notebook - "Data management for little guys"
License: MIT License
When adding a new field from the entity edit view, a view description view is displayed. But this in turn will typically require that a new field type is created. This is a bit awkward, and not obvious.
Options:
Needs thinking about.
Renaming a record type with existing data causes the data for they type to be orphaned; i.e. inaccessible.
E.g.
t
t
t
to t1
The presumed problem is that the RecordTypeData
directory is not renamed when the type is renamed. Manual renaming of the data means that the data is once again visible. But the data records will still carry the original type name.
Running the test suite on Windows gives inconsistent results.
The cause seems to be erratic behaviour of the Windows file system when deleting and/or copying directory trees. Delete operations fail with permission denied or directory not empty errors.
I've tried to isolate the problem, but have so far failed to find a fix.
Supporting Windows is not a priority for me (but it may be for users), so I'm not scheduling this as a must-have for the initial release.
Think about handling of identifier renaming (re-write data, record equivalence, or ...). (See also "data storage".)
Currently there's some inconsistency about view handling which may affect this: confirm views are rendered directly (as this allows form parameters to be provided directly), but other form action links are handled by redirection. Try to be more consistent about this? Create a more general pattern for handling continuation forms? Note: redirect means that different view GET function signatures, with values provided in the request URI, are handled in generic fashion. POST views are more easily handled directly with form parameters as supplied dictionary
E.g.
user-guest
for username, and select Google for the login providerBrowser displays "Server error"
But the same sequence using user_guest
for the username is fine.
The login view should check the username is a valid_id before proceeding. Also, the permissions access should be more resilient to ill-formed user ids
There is a possible "Define view+list" bug in the software that needs investigating: when clicking "Define view+list" while defining a new type in the type definition view, a message saying the new type already exists may be displayed.
If this happens, , click Cancel
then select the new type in the "List types" display and click Edit
. Then click the Define view+list
button.
(I'm not sure if this Is now fixed.)
If a type is deleted, its corresponding RecordTypeData directory is not removed, which results in warning messages to the Annalist server log.
If there are no entities of the deleted type, the deletion should also delete the RecordTypeData entity and directory.
If data for the type still exists, then the delete operation should be refused.
This list should probably be reviewed and broken out into sub-issues
Create facility to built repeat field and group structure for existing simple field
These are the notes on introducing "tasks" from the TODO file:
Introduce notion of "Task", based on form, but linked to "script" action.
It looks as if the problem is related to lack of an annal:uri
field. I was trying to copy a view record without a URI. This line should specify a default value:
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/annalist/views/entityedit.py", line 307, in form_render
entityvals.pop(ANNAL.CURIE.uri)
KeyError: 'annal:uri'
Do a code-wide search for dictionary .pop
functions and check they specify default values where needed (at one point, I thought the default just defaulted to None
).
From the server log:
INFO 2014-11-21 16:59:16,383 views.entityedit.get: coll_id test, type_id _view, entity_id Data_view, view_id View_view, action copy
ERROR 2014-11-21 16:59:16,464 Internal Server Error: /annalist/c/test/v/View_view/_view/Data_view/!copy
Traceback (most recent call last):
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/annalist/views/entityedit.py", line 127, in get
return self.form_render(viewinfo, entity, add_field, continuation_url)
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/annalist/views/entityedit.py", line 307, in form_render
entityvals.pop(ANNAL.CURIE.uri)
KeyError: 'annal:uri'
ERROR 2014-11-21 16:59:16,464 Internal Server Error: /annalist/c/test/v/View_view/_view/Data_view/!copy
Traceback (most recent call last):
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/annalist/views/entityedit.py", line 127, in get
return self.form_render(viewinfo, entity, add_field, continuation_url)
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/annalist/views/entityedit.py", line 307, in form_render
entityvals.pop(ANNAL.CURIE.uri)
KeyError: 'annal:uri'
This lists needs breaking down into minor usability fixes, technical code improvements, and significant new features.
Presentaton:
Technical debt:
Request URL:http://localhost:8000/annalist/login_done/?state=P5L-vLeiKCJcLSn5-OpK1zoxNDgxMDA2NTA2&code=4/4nz4vfkKdY-gqB0xpJAOXzV4XaymX3rcJzQwOquA_1c&authuser=0&hd=zymr.com&session_state=a06cbf8e7e7256806e37b5bce6ede1ce254f8f65..39ae&prompt=consent
Request Method:GET
Status Code:500 INTERNAL SERVER ERROR
Remote Address:127.0.0.1:8000
Response Headers
view source
Content-Type:text/html
Date:Tue, 06 Dec 2016 06:42:30 GMT
Server:WSGIServer/0.1 Python/2.7.10
Vary:Cookie
X-Frame-Options:SAMEORIGIN
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip, deflate, sdch, br
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:csrftoken=U9fQzrrP2dFBfKtDjkSStFgWdHkKjcRd; sessionid=y7fk75jl8bf4fy4b844403f1jr4z7dzf
Host:localhost:8000
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
Query String Parameters
view source
view URL encoded
state:P5L-vLeiKCJcLSn5-OpK1zoxNDgxMDA2NTA2
code:4/4nz4vfkKdY-gqB0xpJAOXzV4XaymX3rcJzQwOquA_1c
authuser:0
hd:zymr.com
session_state:a06cbf8e7e7256806e37b5bce6ede1ce254f8f65..39ae
prompt:consent
Created entry with default type, tried to save, error with id, fixed and saved again. Then edit and change type. Saved OK, but entry with default type not removed.
Exact steps to reproduce not yet clear - needs investigation
Possibly related to #22 ?
E.g. in CruisingLog collection, place name links in daily log link to to daily log record, not place record.
Consider refactoring form generator around Idiom/Formlet work; cf.
The originally-entered label is shown instead of the blank just entered. Also, it shows in the list display.
The heading displayed before a list of entities is useless clutter. It would be better to display the label from the list description.
Also, the main page heading is arguably useless clutter, though it is taken from the site description metadata. Maybe it would be more useful if taken from the collection label?
From Kingsley Idehen: https://lists.w3.org/Archives/Public/public-lod/2015Feb/0116.html
[email protected]
Kingsley requests at least one of:
My comment: WebDAV(ish) was on the original roadmap - see #32. The intent has been to use vanilla HTTP as far as possible (GET, PUT, POST, etc.) and then use WebDAV PROPFIND(?) to enumerate directory contents. The more complex stuff isn't needed.
Kingsley also mentions not to worry about access control, but leave that to the backend. But it woud be the Annalist server, not the browser, that acesses the backend data so there would need to be some way to convey whatever authentication/authosization tokens are needed. My rough plan was to use an OAUTH2/OIDC enabled backend that should be a small extension from the current OIDC authentication logic already used by Annalist, but the details still need to be worked out.
I am running from the docker inside Ubuntu:
# annalist-manager createadminuser
INFO:annalist.apps:Annalist version 0.1.22 (development configuration)
INFO:annalist.apps:SETTINGS_MODULE: annalist_site.settings.devel
INFO:annalist.apps:BASE_DATA_DIR: /usr/local/lib/python2.7/dist-packages/annalist_root/devel
INFO:annalist.apps:CONFIG_BASE: /annalist_site/.annalist/
INFO:annalist.apps:DJANGO_ROOT: /usr/local/lib/python2.7/dist-packages/django
INFO:annalist.apps:SITE_CONFIG_DIR: /usr/local/lib/python2.7/dist-packages/annalist_root/annalist_site
INFO:annalist.apps:SITE_SRC_ROOT: /usr/local/lib/python2.7/dist-packages/annalist_root
INFO:annalist.apps:STATICFILES_DIRS: /usr/local/lib/python2.7/dist-packages/annalist_root/annalist/static/
INFO:annalist.apps:DB PATH: /usr/local/lib/python2.7/dist-packages/annalist_root/db.sqlite3
INFO:annalist.apps:ALLOWED_HOSTS:
INFO:annalist.apps:LOGGING_FILE: None (output to console)
Admin user name: admin
Traceback (most recent call last):
File "/usr/local/bin/annalist-manager", line 9, in <module>
load_entry_point('Annalist==0.1.22', 'console_scripts', 'annalist-manager')()
File "/usr/local/lib/python2.7/dist-packages/annalist_root/annalist_manager/am_main.py", line 180, in runMain
return runCommand(userhome, userconfig, sys.argv)
File "/usr/local/lib/python2.7/dist-packages/annalist_root/annalist_manager/am_main.py", line 169, in runCommand
status = run(userhome, userconfig, options, progname)
File "/usr/local/lib/python2.7/dist-packages/annalist_root/annalist_manager/am_main.py", line 120, in run
return am_createadminuser(annroot, userhome, options)
File "/usr/local/lib/python2.7/dist-packages/annalist_root/annalist_manager/am_createuser.py", line 177, in am_createadminuser
if User.objects.filter(username=user_name):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 145, in __nonzero__
self._fetch_all()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 966, in _fetch_all
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 265, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 700, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 81, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 485, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user
root@3fce21e26d9d:/#
Steps to reproduce:
Modify Default_view in new collection. It now shows up in the default list of all entities.
Click on it, change it's Id and click 'Save'
Message displayed is "Record view in collection does not exist"
Expected behaviour is that record is renamed.
But, if item checkbox is selected and edit button used, rename works OK.
annal:value_type
value types (text, longtext, etc...); use in fields display
The grid view will be an alternative form of list display that places each record in a cell, which can then be arranged horizontally and vertically to form a grid. It would be used when it is not practical to gert a useful summary of ann entity in a single tabulated row. This could be used for things like thumbnail galleries with associated metadata.
(Needs planning)
Hi Graham,
what is status of Annalist? I was pointed to the project by @stain.
I wonder if you can see some parallels with your approach and the LDT specification we have developed: https://atomgraph.github.io/Linked-Data-Templates/
We have also developed a platform based on the LDT technolgoy.
Later:
This list should be reviewed broken out into separate issues, or moved to other issues.
field_context
- currently defined implicitly in views.entityeditbase
(overtaken by redesign)The plan for Annalist has always been to separate the backend entity storage from the front end user interface, thereby allowing hosting of data separately from the Annalist service. Currently Annalist uses a file-based back-end which is not separately deployable.
Entity access has been isolated in a single module, so the effort required to replace file access with HTTP access should be modest once the design details have been worked out.
Notes:
Currently, it's (3) or (4), but I think I favour (2) (or (5)?). The intent is that the URI field can be fixed by explicitly entering an absolute URI, but until then they are allocated per site. The expectation is that if data are moved, it will be as complete collections to ensure they are accompanied by their associated metadata. This is easiest with (5), but (2) may be easier to implement.
__init__
?When a new entity is created, the label and comment fields are populated with useless junk descriptions. This was helpful in early testing, but is now just clutter. Also, the placeholder logic since added makes this less needed to provide clues to what a field should contain.
Also, new field types default to Default_field, which isn't really helpful. Probably better to leave blank so it's easier to spot that a value should be provided.
Tasks:
Details:
With a newly installed Annalist server (using --personal config), the front page displays OK, but clicking the Login link gives a 500 server error response (an un-pretty one at that).
The server log shows
OSError: [Errno 2] No such file or directory: '/home/annalist/.annalist/providers/'
redirect_uri: /annalist/login/?continuation=http%3A//annalist.net%3A8000/annalist/profile/&message=&scope=openid%20profile%20email
Internal Server Error: /annalist/login/
Traceback (most recent call last):
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/annalist/anenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/oauth2/views.py", line 228, in get
collect_client_secrets()
File "/home/annalist/anenv/lib/python2.7/site-packages/annalist_root/oauth2/views.py", line 66, in collect_client_secrets
clientsecrets_files = os.listdir(clientsecrets_dirname)
OSError: [Errno 2] No such file or directory: '/home/annalist/.annalist/providers/'
The problem here is that the providers directory does not exist.
Also, the software itself should be more resilient against this failure.
Review and tidy
Identify duplicated test cases; eliminate duplication
Identify over-complex test cases, split down into simpler test cases
If default list description for a collection is deleted, collection cannot display. Should revert to default default?
Security, robustness, deployability:
The 'Select' label on view description forms, used to label the drop-drown box for selecting field type, is unhelpful and possibly confusing. Suggest use 'Field type' or similar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.