anchor.diff:          {<<"containerDir">>, <<"containerDir.", ShareId/binary>>},
           {<<"publicUrl">>, PublicURL}
       ]};
  -find(<<"file-public">>, FileId) ->
  -    try
  -        file_record(?GUEST_SESS_ID, FileId)
  -    catch T:M ->
  -        ?warning("Cannot get meta-data for file (~p). ~p:~p", [
  -            FileId, T, M
  -        ]),
  -        {ok, [{<<"id">>, FileId}, {<<"type">>, <<"broken">>}]}
  -    end;
  -find(<<"file-property-public">>, FileId) ->
  -    try
  -        metadata_record(?GUEST_SESS_ID, FileId)
  -    catch T:M ->
  -        ?warning("Cannot get metadata for file (~p). ~p:~p", [
  -            FileId, T, M
  -        ]),
  -        gui_error:internal_server_error()
  -    end.
  -
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% {@link data_backend_behaviour} callback find_all/1.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec find_all(ResourceType :: binary()) ->
  -    {ok, [proplists:proplist()]} | gui_error:error_result().
  -find_all(_) ->
  -    gui_error:report_error(<<"Not iplemented">>).
  -
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% {@link data_backend_behaviour} callback find_query/2.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec find_query(ResourceType :: binary(), Data :: proplists:proplist()) ->
  -    {ok, proplists:proplist()} | gui_error:error_result().
  -find_query(_, _Data) ->
  -    gui_error:report_error(<<"Not implemented">>).
  -
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% {@link data_backend_behaviour} callback create_record/2.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec create_record(RsrcType :: binary(), Data :: proplists:proplist()) ->
  -    {ok, proplists:proplist()} | gui_error:error_result().
  -create_record(_, _Data) ->
  -    gui_error:report_error(<<"Not implemented">>).
  -
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% {@link data_backend_behaviour} callback update_record/3.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec update_record(RsrcType :: binary(), Id :: binary(),
  -    Data :: proplists:proplist()) ->
  -    ok | gui_error:error_result().
  -update_record(_, _Id, _Data) ->
  -    gui_error:report_error(<<"Not implemented">>).
  -
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% {@link data_backend_behaviour} callback delete_record/2.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec delete_record(RsrcType :: binary(), Id :: binary()) ->
  -    ok | gui_error:error_result().
  -delete_record(_, _Id) ->
  -    gui_error:report_error(<<"Not implemented">>).
  -
  -
  -%%%===================================================================
  -%%% Internal functions
  -%%%===================================================================
  -
  -%%--------------------------------------------------------------------
  -%% @private
  -%% @doc
  -%% Constructs a file record from given FileId.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec file_record(SessionId :: binary(), FileId :: binary()) ->
  -    {ok, proplists:proplist()}.
  -file_record(SessionId, FileId) ->
  +find(<<"file-public">>, <<"containerDir.", ShareId/binary>>) ->
  +    UserAuth = op_gui_utils:get_user_auth(),
  +    {ok, #document{
  +        value = #share_info{
  +            name = Name,
  +            root_file_id = RootFileId
  +        }}} = share_logic:get(UserAuth, ShareId),
  +    FileId = fslogic_uuid:share_guid_to_guid(RootFileId),
  +    Res = [
  +        {<<"id">>, <<"containerDir.", ShareId/binary>>},
  +        {<<"name">>, Name},
  +        {<<"type">>, <<"dir">>},
  +        {<<"permissions">>, 0},
  +        {<<"modificationTime">>, 0},
  +        {<<"size">>, 0},
  +        {<<"parent">>, null},
  +        {<<"children">>, [op_gui_utils:ids_to_association(ShareId, FileId)]},
  +        {<<"fileAcl">>, null},
  +        {<<"share">>, null},
  +        {<<"provider">>, null},
  +        {<<"fileProperty">>, null}
  +    ],
  +    {ok, Res};
  +
  +find(<<"file-public">>,AssocId) ->
  +    SessionId = g_session:get_session_id(),
  +    {ShareId, FileId} = op_gui_utils:association_to_ids(AssocId),
       case logical_file_manager:stat(SessionId, {guid, FileId}) of
           {error, ?ENOENT} ->
               gui_error:report_error(<<"No such file or directory.">>);
  
positive.code: -export([init/0, terminate/0]).
  -export([find/2, find_all/1, find_query/2]).
  -export([create_record/2, update_record/3, delete_record/2]).
  -export([file_record/2]).
  
  %%%===================================================================
  %%% API functions
  
negative.code:                 size = SizeAttr,
                  mtime = ModificationTime,
                  mode = PermissionsAttr,
                  shares = Shares,
                  provider_id = ProviderId
              } = FileAttr,
  
              ParentUUID = case Shares of
                  [ShareId] ->
                      % Check if this is the root dir
                      <<"containerDir.", ShareId/binary>>;
                  [] ->
                      op_gui_utils:ids_to_association(
                          ShareId, get_parent(SessionId, FileId)
                      )
              end,
  
              {Type, Size} = case TypeAttr of
                  ?DIRECTORY_TYPE -> {<<"dir">>, null};
                  _ -> {<<"file">>, SizeAttr}
  