AW: [opencms-dev] RE: vfslink confusion

Thomas Weckert t.weckert at alkacon.com
Thu Feb 19 17:28:41 CET 2004


Hello Aaron,

if I understood you right, you wish to keep track which images are used
in which pages for example. Unfortunately, the OpenCms 5.0 VFS link
mechanism is not capable to do that. The link target saves in it's
resources flag attrib. the number of VFS links pointing to this file.
Each VFS link saves in it's resource flag attrib. the primary key of the
target resource. Thus, the Cms is able to identify all VFS links
pointing to a specified file. But this has nothing to do with image tags
or anchor tags in pages.

Regards,
Thomas Weckert
Alkacon Software - The OpenCms Experts
http://www.alkacon.com 



-----Ursprüngliche Nachricht-----
Von: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org] Im Auftrag von aaron butler
Gesendet: Donnerstag, 19. Februar 2004 16:00
An: opencms-dev at opencms.org
Betreff: [opencms-dev] RE: vfslink confusion


OK, I've looked at the other side of these links and I'm even more mixed
up.

  It looks like CMS_ResourceBroker.joinLinksToTargets (v5.0.1) 
uses  CMSDbAccess.updateResourceFlags in 2 different ways: in the
commented 
section 5
// 5) update the VFS link count per target resource
it stores the count of unique pointers to a resource in the
ResourceFlags 
column:
m_dbAccess.updateResourceFlags(theProject, targetIDs[i],
linksPerTarget[i]);

then in section 6
// 6) update the target resource ID's in each VFS link
it keeps the current targetID for a given link
m_dbAccess.updateResourceFlags(theProject, linkID, targetID);

For me to track this information, will I need to create a link resource
for 
each graphic in my galleries, and use those links instead of the
graphics 
in the sourcecode editor?  That seems very wrong, since the work of 
generating the internal link references is done in 
com.opencms.util.LinkSubstitution, and the core engine is clearly able
to 
find the resource from the publication direction.

My inclination is to find out when the editor saves its changes, and
make 
sure it is automatically creating a new link resource for each new
anchor, 
graphic, or other resource included.

Am I going about this the right way?  It still seems more likely that I
am 
completely missing the point of something.


-Aaron



>Date: Wed, 18 Feb 2004 13:50:33 -0500
>To: opencms-dev at opencms.org
>From: aaron butler <abutler at trstone.com>
>Subject: vfslink confusion
>
>I am trying to track which pages use particular graphics.  I thought 
>that
>would be done using the "Show Filesystem Links" option in the offline
file 
>dropdown list, but that doesn't seem to work.  If I understand the code

>correctly, there is no way for it to work in version 5.0.1 - the 
>query.properties file in com.opencms.file.genericSql is
>
>C_SELECT_VFS_LINKS=SELECT CMS_RESOURCES.RESOURCE_NAME \
>         FROM CMS_RESOURCES \
>         WHERE CMS_RESOURCES.RESOURCE_FLAGS = ? \
>         AND CMS_RESOURCES.RESOURCE_TYPE = ? \
>         AND CMS_RESOURCES.STATE != ? \
>         ORDER BY CMS_RESOURCES.RESOURCE_NAME ASC
>
>The stacktrace goes like
>CmsNewExplorerFileList.getContent ->  
>CmsNewExplorerFileList.getRessources
>->  CMSObject.fetchVfsLinksForResource
>->  CMSResourceBroker.fetchVfsLinksForResource 
>->  DBAccess.fetchVfsLinksForResourceID
>  where DBAccess.fetchVfsLinksForResourceID has the following code:
>---------
>String query = "C_SELECT_VFS_LINKS";
>         String pool = m_poolName;
>         PreparedStatement stmnt = null;
>         Connection con = null;
>         ResultSet result = null;
>         ArrayList vfsLinks = new ArrayList();
>
>         // check if we need to use the same query working on the 
> tables
> of the online project
>         if (theProject.getId() == I_CmsConstants.C_PROJECT_ONLINE_ID)
{
>             pool = m_poolNameOnline;
>             query += "_ONLINE";
>         }
>
>         try {
>             // execute the query
>             con = DriverManager.getConnection(pool);
>             stmnt = con.prepareStatement(m_cq.get(query));
>             stmnt.setInt(1, theResourceID);
>             stmnt.setInt(2, theResourceTypeLinkID);
>             stmnt.setInt(3, C_STATE_DELETED);
>             result = stmnt.executeQuery()
>----------
>which means theResourceID is getting put into the slot marked for
>Resource_Flags.
>Changing the reference in the query.properties file to ResourceID
didn't 
>solve the problem, though.
>
>Should CMSResourceBroker be calling 
>CMSDbAccess.fetchAllVfsLinks(CmsProject theProject, ArrayList 
>theResourceIDs, ArrayList theLinkContents, ArrayList theLinkResources, 
>int
>theResourceTypeLinkID)
>instead?
>
>Am I completely misunderstanding the point of Show Filesystem Links?  I
>built 5.3.3 from CVS source (anon/anon, whatever branch/tag that will
give 
>me) and that doesn't seem to mesh with my understanding either.  I can 
>forcefully change the LinkCount for a given resource and thereby get
the 
>Show Filesystem Links to be selectable in the dropdown list (or type in

>vfslink:/path/to/file) but I don't know what to do to make it show all
the 
>places I use a particular graphic.  I haven't dug in much on the 5.3.3 
>source, though, and link management seems a bit buggy in other ways;
maybe 
>this is the right code base, but it needs the rest of the inclusion of 
><img src= "">, <link /> or <cms:link /> to be handled correctly for
this 
>feature to work...
>
>Can someone point me in the right direction for this?  It would be 
>great
>if I could work with 5.0.1, since I'm on a short timeframe, but that
may 
>not be possible.
>
>
>-Aaron
>


_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list