Renaming a resource?

View: New views
5 Messages — Rating Filter:   Alert me  

Renaming a resource?

by Jeff-247 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I see that I can edit a resource, but it doesn't appear that I can edit the name of the resource, only other details such as Email, Email Subject, etc.

(I'm looking at the Edit Appointment Resources in the Administration)

Is it possible?

Thanks,
Jeff


Re: Renaming a resource?

by Adam Tauno Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-08-18 at 12:58 -0400, Jeff wrote:
> I see that I can edit a resource, but it doesn't appear that I can
> edit the name of the resource, only other details such as Email, Email
> Subject, etc.
> (I'm looking at the Edit Appointment Resources in the Administration)
> Is it possible?

It is 'possible' but not I think through the WebUI.  A problem is that
resources are identified BY NAME in appointments, so if you rename you
potentially loose the reference [it has always been that way, not sure
why, it sucks].

It is pretty trivial to change in the database:

SELECT COUNT(*) FROM date_x WHERE resource_names LIKE '%Big Classroom%';

UPDATE appointment_resource
SET name = 'GRD Classroom'
WHERE name = 'Big Classroom';

UPDATE date_x
SET resource_names = REPLACE(resource_names, 'Big Classroom', 'GRD
Classroom'), object_version = (object_version + 1);

SELECT COUNT(*) FROM date_x WHERE resource_names LIKE '%GRD Classroom%'

--
OpenGroupware.org Users
users@...
http://mail.opengroupware.org/mailman/listinfo/users

Re: Renaming a resource?

by Jeff-247 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, Aug 18, 2009 at 1:11 PM, Adam Tauno Williams <awilliam@...> wrote:
It is 'possible' but not I think through the WebUI.  A problem is that
resources are identified BY NAME in appointments, so if you rename you
potentially loose the reference [it has always been that way, not sure
why, it sucks].

It is pretty trivial to change in the database:

Thanks Adam!

Jeff

Re: Renaming a resource?

by Jeff-247 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Finally got around to renaming the resource, and these database queries did the trick, thanks!

However, the old resource name is still showing up in the calendar view in the dropdown (where it defaults to my account - but we have the Resources listed there too).

What table is that stored in so I can update that without having the users change it manually?   And wherever that table is, does it need an object_version increment as well?

Thanks!
Jeff

On Tue, Aug 18, 2009 at 12:11 PM, Adam Tauno Williams <awilliam@...> wrote:
On Tue, 2009-08-18 at 12:58 -0400, Jeff wrote:
> I see that I can edit a resource, but it doesn't appear that I can
> edit the name of the resource, only other details such as Email, Email
> Subject, etc.
> (I'm looking at the Edit Appointment Resources in the Administration)
> Is it possible?

It is 'possible' but not I think through the WebUI.  A problem is that
resources are identified BY NAME in appointments, so if you rename you
potentially loose the reference [it has always been that way, not sure
why, it sucks].

It is pretty trivial to change in the database:

SELECT COUNT(*) FROM date_x WHERE resource_names LIKE '%Big Classroom%';

UPDATE appointment_resource
SET name = 'GRD Classroom'
WHERE name = 'Big Classroom';

UPDATE date_x
SET resource_names = REPLACE(resource_names, 'Big Classroom', 'GRD
Classroom'), object_version = (object_version + 1);

SELECT COUNT(*) FROM date_x WHERE resource_names LIKE '%GRD Classroom%'

--
OpenGroupware.org Users
users@...
http://mail.opengroupware.org/mailman/listinfo/users


Re: Renaming a resource?

by Adam Tauno Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-11-12 at 12:21 -0500, Jeff wrote:
> Finally got around to renaming the resource, and these database
> queries did the trick, thanks!

Excellent.

> However, the old resource name is still showing up in the calendar
> view in the dropdown (where it defaults to my account - but we have
> the Resources listed there too).

Right it is stored in your user defaults, in the
schedular_panel_resourceNames attribute.

> What table is that stored in so I can update that without having the
> users change it manually?   And wherever that table is, does it need
> an object_version increment as well?

User defaults are stored in OpenSTEP style PList (property list) files
in the OpenGroupware documents root.  So, for example, if your account's
objectId is 10,100 then there is
a /var/lib/opengroupware.org/documents/10100.defaults file.  If you have
just a couple to edit you can do it by hand if your careful (just use a
text editor).

Otherwise I just the other day implemented an OpenSTEP PList writer
OpenGroupware Coils so you can script mass changes with Python.  Coils
will soon have an RPC for reading / writing user defaults as an admin
since that is a feature we need.  Source for the OpenSTEP PList reader /
writer is at
<http://coils.hg.sourceforge.net/hgweb/coils/coils/file/4ed140ab0c93/src/coils/model/plist>

I probably should just have an admin RPC to rename a resource?

--
OpenGroupware.org Users
users@...
http://mail.opengroupware.org/mailman/listinfo/users