Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
prog20901
@prog20901

I need to generate PDF as report...Come across the following options

Birt
Jtidy
Apache FOP
Jasper
Spring PDF
Docmosis

Not sure which one is better among the above and which one to choose

Please advise.

Thanks,

Rubina Kari
@rubinakarki

Hello,I am trying to trigger a signal for every file downloaded for which I created a views.py inside a new folder called stats.

from flask import request, jsonify, redirect, url_for, Response
from invenio_files_rest.signals import file_downloaded

def listener(sender, *args, **kwargs):
       print(sender.basename)

file_downloaded.connect(listener)

When I put this code in the module whose entrypoint is registered then it works but in the stats module it does not work.Is it because of not registering the entrypoints?If yes,how do I register the entrypoints for this views in which there is no blueprints?

Lars Holm Nielsen
@lnielsen
@prog20901 I cannot advice you which one is better, but e.g. for python there’s also https://pypi.org/project/reportlab/
prog20901
@prog20901
@lnielsen thanks a lot
Adam Mills
@adammills_twitter
Good Afternoon, how steep a learning curve would be involved to utilise invenio ils for a school library?
Lars Holm Nielsen
@lnielsen
@adammills_twitter InvenioILS is under heavy development right now, and hasn’t been deployed yet so it depends on your timeline
It’s likely not out until summer 2020
Also, it depends on which features you need.
Eugenio Corso
@EugenioCorso

Hi everyone i was tring to implement the download for files, i modified the config.py file as specified adding the recdwnld entry:

RECORDS_UI_ENDPOINTS = {
    #...
    'recdwnld': {
        'pid_type': 'recid',
        'route': '/records/<pid_value>/files/<filename>',
        'view_imp': 'invenio_records_files.utils:file_download_ui',
        'record_class': 'invenio_records_files.api:Record',
    },
}

it works but i have one question: what should i do if i want to implement some kind of check, for example let download a file only if a field in his metadata is True?
I tried to implement a view that use file_download_ui, but it doesn't work

Nicola
@ntarocco
@EugenioCorso you have an example in the documentation: https://invenio.readthedocs.io/en/latest/tutorials/handling-files.html#permissions
let us know if it helps
ugswork
@ugswork
If it is ok to ask a question now, I am trying to find how to recover from the following error. This happens whenever ES index is called. Thank you.
PUT http://localhost:9200/records-record-v1.0.0/record-v1.0.0/dd878e7d-bfae-4059-a4c8-b369c4140d49?version=25&version_type=external_gte [status:N/A request:0.020s]
Traceback (most recent call last):
  File "/opt/invenio/invenio-env/set-repo-venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/opt/invenio/invenio-env/set-repo-venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib64/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1065, in _send_output
    self.send(chunk)
  File "/usr/lib64/python3.6/http/client.py", line 986, in send
    self.sock.sendall(data)
ConnectionResetError: [Errno 104] Connection reset by peer
Colin Sippl
@cs-ubr
Hi, I ran into the same ES issue a few weeks ago, but I can't remember the exact solution to the problem right now... How much data are you trying to index and did you take a look at the ES logs?
Are you sure you' re not having problems with the mapping?
ugswork
@ugswork
@cs-ubr I see the following in gc.log. I do not see anything else logged since we started getting this error few days back.
2020-03-18T09:12:40.627-0400: 417478.849: [GC (Allocation Failure) 2020-03-18T09:12:40.627-0400: 417478.849: [ParNew
Desired survivor size 56688640 bytes, new threshold 1 (max 6)
- age   1:  108477248 bytes,  108477248 total
: 957473K->106188K(996800K), 0.0323794 secs] 1214799K->565846K(10375040K), 0.0326007 secs] [Times: user=0.37 sys=0.00, real=0.04 secs]
Eugenio Corso
@EugenioCorso
@ntarocco Thank you for your respnse, can't i make a call to the file_download_ui function through my view and do the check there?
Nicola
@ntarocco
@EugenioCorso I am not sure I understand, can you copy/paste your function?
Lars Holm Nielsen
@lnielsen
@ugswork I haven’t seen that error before……how are you running elasticsearch? in a container?
Eugenio Corso
@EugenioCorso
@ntarocco I did in this way but it didn't work, i get a 404 and i don't understand why
from invenio_records.api import Record

@blueprint.route('/download/', methods=('GET', 'POST'))
@login_required
def download():
    """The download view."""

    record_id = request.form['record_id']
    record = Record.get_record(record_id)

    return file_download_ui(record['id'], record)
Nicola
@ntarocco
record = Record.get_record(record_id) are you sure that this line works? what is this record_id that you are passing from the form? if it is the PID, you cannot fetch the record like this, but you will have to do something like this
Eugenio Corso
@EugenioCorso
@ntarocco sorry i forget to specify that variable, record_id is the uuid of the record, i print it and is 0de5239b-57b9-4a90-b3d4-dd685499d664
Nicola
@ntarocco
ok then this is solved, now you will have to copy/paste this file_download_ui method, hard to say what it is doing :)
ugswork
@ugswork

@ugswork I haven’t seen that error before……how are you running elasticsearch? in a container?

@lnielsen Thank you for following this up. This error is happening on the production server. Elasticsearch is NOT run in a container. While it is still being debugged, so far it is observed that the error is happening only in one or possibly more records, whenever RecordIndexer().index(record) is called. One record where the error is happening contains files totaling about 55MB. The heap size for elasticsearch has been increased from 10GB to 40GB. It is not clear (if the file types) what is causing this error. I did not get to explore this before as the reindexing has been working fine so far. Any input on this will be very helpful. Thank you.

ugswork
@ugswork
@ntarocco or any angular expert. I have a question regarding calling an angular function from html. In invenio-communities, results_curate.html, I want to display only those records which have inclusion requests for the community. I have a function hasInclusionRequest similar to handleCommunityClick. I would like to know what is the syntax/directives to call and check results of this function in html. Following is the psuedo code. I tried different variations but it hasn't worked correctly yet. Hence this post. Thank you.
<div ng-if="!inclusionRequestResults[record.id]"> <!-- if no result for record.id -->
     {{ hasInclusionRequest(record.id) }}          <!-- call function  -->
</div>   
<div ng-if=inclusionRequestResults[record.id].success> <!-- if result dict has success -->
        ....                                <!-- display more details  -->
</div>
Eugenio Corso
@EugenioCorso
@ntarocco is a function of invenio_records_files.utils (link), i would like to do a view and do the proper check there instead of do something like the one you suggested me because i need to implement a view for the download
Colin Sippl
@cs-ubr

The only suffix possible so far is timestamp if the index is created using invenio index init CLI, right?
I do not see any config variable to specify the function, and it's creating indexes everytime
Can provide a PR, just wanted to check first
theres SEARCH_INDEX_PREFIX but not SEARCH_INDEX_SUFFIX?

@ppanera @zzacharo Currently I'm migrating from Invenio 3.1 to 3.2. Is it (still im)possible to disable the suffix or at least to set it manually? I'm working with an index alias to bundle different indices, so changing index name suffixes are an unforeseen obstacle for me.

prog20901
@prog20901

I would like to do some UX designs for existing web application...

When i searched for template or screen or UX desigining..

I come across Adobe XD, Invision App

Can someone let me know any open source to do this?

Thanks

Dan Granville
@dfdan
Can anyone help with what's broken here? I have a fresh instance build with 3.2, when it tries to generate email (eg for signup) -
[2020-03-23 13:38:06,483] ERROR in app: Exception on /signup/ [POST]
Traceback (most recent call last):
  File "/home/blip/.virtualenvs/eprints-dev/lib/python3.6/site-packages/kombu/serialization.py", line 50, in _reraise_errors
    yield
  File "/home/blip/.virtualenvs/eprints-dev/lib/python3.6/site-packages/kombu/serialization.py", line 221, in dumps
    payload = encoder(data)
  File "/home/blip/.virtualenvs/eprints-dev/lib/python3.6/site-packages/kombu/serialization.py", line 370, in pack
    return packb(s, use_bin_type=True)
  File "/home/blip/.virtualenvs/eprints-dev/lib/python3.6/site-packages/msgpack/__init__.py", line 35, in packb
    return Packer(**kwargs).pack(o)
  File "msgpack/_packer.pyx", line 286, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 292, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 289, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 258, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 258, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 225, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 283, in msgpack._cmsgpack.Packer._pack
TypeError: can not serialize 'LocalProxy' object
Lars Holm Nielsen
@lnielsen
Hmm….msgpack oribkens…. i think it’s relate to celery version and msgpack combination
which version of celery do you have
and msgpack version
Dan Granville
@dfdan
celery 4.4.2, msgpack 1.0.0
invenio-celery is 1.1.3
Lars Holm Nielsen
@lnielsen
1) try to downgrade ot msgpack 0.6.2
2) try to upgrade to invenio-celery 1.2.0
Dan Granville
@dfdan
thanks, Lars - is that an either or (guess I don't want msgpack 0.6.2 and invenio-celery 1.2.0 together)?
Lars Holm Nielsen
@lnielsen
I don’t know :-) I can just see latest msgpack was released feb 20, so could cause troubles with datetime objects perhaps
invenio-celery was out of not knowing better :-)
Colin Sippl
@cs-ubr

The only suffix possible so far is timestamp if the index is created using invenio index init CLI, right?
I do not see any config variable to specify the function, and it's creating indexes everytime
Can provide a PR, just wanted to check first
theres SEARCH_INDEX_PREFIX but not SEARCH_INDEX_SUFFIX?

@ppanera @zzacharo Currently I'm migrating from Invenio 3.1 to 3.2. Is it (still im)possible to disable the suffix or at least to set it manually? I'm working with an index alias to bundle different indices, so changing index name suffixes are an unforeseen obstacle for me.

Fixed it. ES allows wildcards to select indices for alias assigning:

{
   "actions":[
      {
         "add":{
            "index":"an-index-v1.0.0-*",
            "alias":"my_alias"
         }
      },
      {
         "add":{
            "index":"another-index-v1.0.0-*",
            "alias":"my_alias"
         }
      }
   ]
}
Nicola
@ntarocco
@EugenioCorso can you copy/paste the content of your record? I think it is missing the attribute files, see here
@ugswork for the sanitization of HTML, you can have a look here on Zenodo: https://github.com/zenodo/zenodo/blob/master/zenodo/modules/theme/static/js/zenodo/filters/safe.js#L24
Nnenanya Obinna Kingsley
@obinnaeye
Hello here, I'm following the Invenio tutorials. Can anyone help me confirm that the content of Tuturial 08 is still valid. Here is the link: https://github.com/inveniosoftware/training/tree/v3.1/08-data-models-from-scratch. It appears to be outdated.
Nicola
@ntarocco
@obinnaeye can you please give more details? where are you blocked?
ugswork
@ugswork
@ntarocco Thank you for providing me the references.
Nnenanya Obinna Kingsley
@obinnaeye
@ntarocco Thank you for the response, I've fixed the issue. When I ran ./bootstrap.sh, it was requesting for a file name. So, I opened and simply ran the command in the file; which was just copying a file. Sorry for the noise.
Lars Holm Nielsen
@lnielsen
@dfdan Did any of the changes work?
Dan Granville
@dfdan
@lnielsen - yes, thanks. I think msgpack==0.6.2 did it, but I had made a mess of some other stuff. I will spin up another instance to test properly and let you know if there's an issue that wasn't my fault
Gabriele Corso
@CorsoGabriele
hi everyone, i was tring to test my module, but i having some trouble, when i create a record, making the request POST to the view, and then try to GET the page in the /records/1 url, it does not exist. Maybe i do not configured the conftest properly, here the conftest and here the tests