Skip to content
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

[Fixes #9583] Unadvertised resources #332

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

afabiani
Copy link
Member

@afabiani afabiani commented Jan 16, 2024

Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • When I share a resource to everyone, it is listed despite is true or false. In fact the advertised flag doesn't look to make difference. From my understanding it should filter out the items on search/list services (e.g. extjs and more), while make the direct request to resource or resource data still available.
    image
  • see my comment about default value. I tested and the values become anyway null. This causes a null pointer exception on requests like get http://localhost:8081/rest/geostore/extjs/resource/52
@@ -15,3 +15,5 @@ create index idx_user_group_attr_text on gs_user_group_attribute (string);
create index idx_attr_user_group on gs_user_group_attribute (userGroup_id);

alter table gs_user_group_attribute add constraint fk_ugattrib_user_group foreign key (userGroup_id) references gs_usergroup;

alter table gs_resource add column advertised bool not null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it goes on a different file. Next version is 2.1.0
See also my comment about default value

doc/sql/002_create_schema_oracle.sql Outdated Show resolved Hide resolved
doc/sql/002_create_schema_postgres.sql Outdated Show resolved Hide resolved
@offtherailz
Copy link
Member

offtherailz commented Jan 18, 2024

one hint. For testing MapStore with your changes I did the following (because master is pointing on latest GeoStore )

  • build your pr geostore (using the proper profiles, i did it with mvn clean install -Pall,extjs,postgres,h2 (not sure all these profiles exists 😄 )
  • run mapstore with npm start. It will build mapstore with geostore found in .m2
  • To configure the database in the instance started with npm start edit java/web/src/main/resources/geostore-datasource-ovr.properties as following before to run npm start
# Setup driver and dialect for PostgreSQL database
geostoreDataSource.driverClassName=org.postgresql.Driver
geostoreVendorAdapter.databasePlatform=org.hibernate.dialect.PostgreSQLDialect

# Connection parameters
geostoreDataSource.url=jdbc:postgresql://localhost:5432/geostore
geostoreDataSource.username=geostore
geostoreDataSource.password=geostore
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.default_schema]=geostore

# Automatic create-update database mode
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=update

# Other options
geostoreVendorAdapter.generateDdl=true
geostoreVendorAdapter.showSql=false

@tdipisa tdipisa linked an issue Jan 19, 2024 that may be closed by this pull request
6 tasks
@afabiani
Copy link
Member Author

@offtherailz the resources should be still listed to their owners, at least this was a requirement. When you toggle advertised to false, are those resources listed to other users too?

@offtherailz
Copy link
Member

Yes, during my test, that's what I noticed.
In the screenshot I'm not logged (so I theoretically belong to group everyone) and I can see the records, marked with advertised=true or false.
I can suggest start MapStore as described here to verify it by yourself.

@tdipisa
Copy link
Member

tdipisa commented Jan 22, 2024

@afabiani I think you can proceed fixing this according to the above review. I'm available if you have something to discuss.

@offtherailz
Copy link
Member

please @afabiani if you are not able to replicate let me know, we can try together.

@afabiani
Copy link
Member Author

@offtherailz the requested changes have been done

Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great 👍

@tdipisa tdipisa merged commit 5a546d1 into geosolutions-it:master Jan 26, 2024
2 checks passed
@afabiani afabiani deleted the ISSUE_9583 branch January 29, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment